
会議室はITのシステムを利用しているが、総務部などが管理している事があります。
そのため頻繁にアクセス権の変更が発生することがあるので、すべての会議室に一括して権限を付与するPS1スクリプト。
IDなどはご自身のIDに変更して利用してください。
$Password = Get-Content $env:UserProfile\desktop\pass.txt | ConvertTo-SecureString
$ID = “自分のO365管理者アカウント”
$LiveCred = New-Object System.Management.Automation.PSCredential $ID,$password
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $LiveCred -Authentication Basic -AllowRedirection
Import-PSSession $Session
$Mailbox = Get-Mailbox -RecipientTypeDetails RoomMailbox -ResultSize Unlimited | Select Alias
$Mailbox | % {
$path = $null
$Alias = $_.Alias
$path = (Get-MailboxFolderStatistics $alias | ? {$_.FolderType -eq “Calendar”}).Identity -replace “\\”,”:\”
Add-MailboxFolderPermission -Identity $path -User “付与したいユーザーorグループのUPN” -AccessRights Owner
}
大事なのは $path を取得していること。
これをやらないと、フォルダ名が Calendar なのか会議室なのかあらかじめ調べておく必要がでてしまいます。
パスは事前にコンバートして保存していますが、毎回手入力しても大丈夫です。
この記事へのコメントはありません。