【问题标题】:Exchange online - Copy mailbox permissions from one user to anotherExchange online - 将邮箱权限从一个用户复制到另一个用户
【发布时间】:2022-04-16 08:51:22
【问题描述】:

我正在尝试找到一种将用户邮箱权限复制给另一个用户的方法,我可以在 PS 中输出我需要的数据,只是找不到将这些权限应用到新用户的方法。

我对 PS 并不好,所以请与我裸露:)

Get-Mailbox -RecipientTypeDetails UserMailBox,SharedMailbox | Get-MailboxPermission -User

然后输出用户权限,但我希望能够在同一个脚本中将这些权限添加到我的新用户。

【问题讨论】:

    标签: powershell exchange-server


    【解决方案1】:

    希望这会有所帮助:

    $FromUser = Read-Host "Enter the email address of the user you want to copy mailbox permissions from"
    $ToUser = Read-Host "Enter the email address of the user you want to set mailbox permissions for"
    
    $Perm = Get-Mailbox | Get-MailboxPermission -User $FromUser
    
    $Perm | ForEach-Object { $_ 
    Add-MailboxPermission -Identity $_.Identity -AccessRights FullAccess -InheritanceType All -AutoMapping:$true -User $ToUser
    Add-RecipientPermission -Identity $_.Identity -AccessRights SendAs -Confirm:$false -Trustee $oTUser
    }
    

    这将自动查找从 User1 到 User2 的权限。您可以根据 Microsoft 允许的命令将参数更改为您想要放置的任何内容。

    https://docs.microsoft.com/en-us/powershell/module/exchange/add-mailboxpermission?view=exchange-ps

    https://docs.microsoft.com/en-us/powershell/module/exchange/add-recipientpermission?view=exchange-ps

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-06-13
      • 1970-01-01
      • 2015-10-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-11-23
      • 2015-01-23
      相关资源
      最近更新 更多