我会添加 -AccessRights fullaccess
,但它只在 csv 文件看起来像
"Name","GrantSendonBehalfTo"
"OJE01","ore.se/lk/forv/socf/NYMXX04"
当它不止一对一时,csvfile 不起作用如何解决这个问题????
"Name","GrantSendonBehalfTo"
"KEU01","ore.se/lk/forv/socf/BEAXX37;ore.se/lk/forv/socf/ERC01"
第一步
Get-mailbox -ResultSize Unlimited -Identity *
| where {$_.GrantSendOnBehalfTo}
| Select-Object name,@{Name='GrantSendonBehalfTo';Expression={[string]::join(";", ($_.GrantSendonBehalfTo))}}
| Export-Csv c:\Grant.txt -Delimiter ','
第二步
Import-Csv C:\Grant.txt
| foreach{Add-MailboxPermission -Identity $_.Name -User $_.GrantSendonBehalfTo -AccessRights fullaccess}
任何想法?