当前位置:网站首页 > 更多 > 玩电脑 > 正文

[玩转系统] 使用 PowerShell 重置 Office 365 委托访问权限

作者:精品下载站 日期:2024-12-14 18:37:01 浏览:10 分类:玩电脑

使用 PowerShell 重置 Office 365 委托访问权限


如何使用 PowerShell 重置 Office 365 委托访问权限?您的用户每次在 Outlook 中打开代理访问权限时都会收到错误消息。您已经删除了委托权限,但这仍然给他们带来了问题。如何确保用户编辑和设置其委托访问权限时不会出现问题?让我们看看如何使用 PowerShell 重置 Office 365 委托权限。

介绍

要检查 Outlook 中的委托权限,请转至文件 > 帐户设置 > 委托访问

[玩转系统] 使用 PowerShell 重置 Office 365 委托访问权限

在那里您可以看到设置了哪些用户和访问权限。

[玩转系统] 使用 PowerShell 重置 Office 365 委托访问权限

如果您已尝试从日历中删除代理人访问权限,重新创建 Outlook 配置文件,但用户仍然无法添加代理人或删除代理人,您有两种选择:

  1. 下载 MFCMAPI 并删除委托访问权限

  2. 使用 PowerShell 重置委托访问权限

如果您的 Exchange 本地邮箱存在此问题,则 MFCMAPI 非常有用。这是因为您无法对本地邮箱使用 PowerShell 命令。但是,如果您在 Office 365/Microsoft 365 中有一个邮箱,最好运行一个 PowerShell 命令并重置委托访问权限。

要详细了解如何添加编辑删除日历权限,最好的方法是阅读文章使用 PowerShell 管理 Office 365 中的日历权限。

如何重置委托权限

完成这些步骤并重置 Office 365 日历委托访问权限。

1. 连接到 Exchange Online PowerShell

第一步是连接到 Exchange Online PowerShell。

PS C:\> Connect-ExchangeOnline

2. 获取委托权限

运行 Get-MailboxFolderPermission cmdlet 以获取日历权限。

PS C:\> Get-MailboxFolderPermission -Identity "[email protected]:\Calendar" | ft -auto

FolderName User           AccessRights       SharingPermissionFlags       
---------- ----           ------------       ----------------------       
Calendar   Default        {AvailabilityOnly}                              
Calendar   Rees, Grace    {Reviewer}                                      
Calendar   Grant, Richard {Editor}           Delegate                     
Calendar   Fraser, Max    {Editor}           Delegate, CanViewPrivateItems

将日历权限输出导出到 C:\temp 文件夹中的 CSV 文件,名称为 permissions.csv。如果没有临时文件夹,请创建一个。

PS C:\> Get-MailboxFolderPermission -Identity "[email protected]:\Calendar" | Select-Object FolderName,User,AccessRights,SharingPermissionFlags | Export-Csv "C:temp\permissions.csv" -NTI

现在您已经有了用于备份的输出和导出,让我们将 Office 365 日历权限重置为其默认设置。

3. 重置代理访问权限

运行包含-ResetDelegateUserCollection 参数的Remove-MailboxFolderPermission cmdlet。按YEnter

注意ResetDelageUserCollection开关将从邮箱中清除所有损坏的代理人信息。输出将显示它正在重置 DelegateUserCollection。

PS C:\> Remove-MailboxFolderPermission -Identity "[email protected]:\Calendar" -ResetDelegateUserCollection

Confirm
Are you sure you want to perform this action?
Using ResetDelegateUserCollection changes existing calendar Delegate permissions. You will need to re-assign the Delegate flag to these
recipients using Set-MailboxFolderPermission -SharingPermissionFlags Delegate. It is suggested that this ResetDelegateUserCollection
option is only used when you believe there is corruption that is preventing managing calendar permissions.
[Y] Yes [A] Yes to All [N] No [L] No to All [?] Help (default is "Y"): Y
WARNING: Resetting DelegateUserCollection...
WARNING: DelegateUserCollection is reset.

4. 验证代理访问重置

验证 SharingPermissionFlags 列是否为空。这意味着它成功重置了委托用户集合。

PS C:\> Get-MailboxFolderPermission -Identity "[email protected]:\Calendar" | ft -auto

FolderName User           AccessRights       SharingPermissionFlags
---------- ----           ------------       ----------------------
Calendar   Default        {AvailabilityOnly}                       
Calendar   Rees, Grace    {Reviewer}                               
Calendar   Grant, Richard {Editor}                                 
Calendar   Fraser, Max    {Editor}                                 

5. 设置代理访问权限

告诉用户他们可以在 Outlook 中访问其代理访问权限并添加删除编辑权限。另一种方法是使用 Set-MailboxFolderPermission cmdlet 将委托权限设置回原来的状态。

在我们的示例中,我们将为两个用户重新设置委托权限。

PS C:\> Set-MailboxFolderPermission -Identity "[email protected]:\Calendar" -User "Grant, Richard" -SharingPermissionFlags Delegate -AccessRights Editor

PS C:\> Set-MailboxFolderPermission -Identity "[email protected]:\Calendar" -User "Fraser, Max" -SharingPermissionFlags Delegate, CanViewPrivateItems -AccessRights Editor

6. 最终代表访问检查

最后一次检查确认委托访问权限已按原样设置。只是这一次,没有任何腐败的代表。

PS C:\> Get-MailboxFolderPermission -Identity "[email protected]:\Calendar" | ft -auto

FolderName User           AccessRights       SharingPermissionFlags       
---------- ----           ------------       ----------------------       
Calendar   Default        {AvailabilityOnly}                              
Calendar   Rees, Grace    {Reviewer}                                      
Calendar   Grant, Richard {Editor}           Delegate                     
Calendar   Fraser, Max    {Editor}           Delegate, CanViewPrivateItems

一切看起来都很棒!

继续阅读:在 Exchange Hybrid 中配置权限 »

结论

您了解了如何使用 PowerShell 重置 Office 365 委托访问权限。首先,连接到 Exchange Online 并运行 Remove-MailboxFolderPermission cmdlet,包括 -ResetDelegateUserCollection 参数。之后,重新添加委托权限或告诉用户他们可以自己编辑权限。

您喜欢这篇文章吗?您可能还喜欢管理团队会议委托权限。不要忘记关注我们并分享这篇文章。

您需要 登录账户 后才能发表评论

取消回复欢迎 发表评论:

关灯