【PowerShell】Microsoft 365管理 ~GAL編~

Microsoft 365 グループを作るとグループアドレスが量産されていくので非表示

#基本のコマンドレット

Set-UnifiedGroup -Identity <DisplayName> -HiddenFromAddressListsEnabled $true

#まとめて実行

Get-UnifiedGroup | Select-Object DisplayName,PrimarySmtpAddress | Export-Csv -Path "C:\Users\☓☓☓\Desktop\UnifiedGroup_all.csv" -Encoding UTF8 -NoTypeInformation
Import-Csv -Path "C:\Users\☓☓☓\Desktop\UnifiedGroup_all.csv" | ForEach {Set-UnifiedGroup -Identity $_.DisplayName -HiddenFromAddressListsEnabled $true}
GALにフリガナを表示
Set-User -Identity <UserPrincipalName> -PhoneticDisplayName "フリガナ"
GALに階層型アドレス帳を表示

#階層許可

Set-Group -Identity <WindowsEmailAddress> -Ishierarchicalgroup $true

#階層トップ

Set-Group -Identity <WindowsEmailAddress> -Ishierarchicalgroup $true

#階層配下

Add-Distributiongroupmember -Identity <WindowsEmailAddress> -Member <WindowsEmailAddress>

#階層順位

Set-Group -Identity <WindowsEmailAddress> –Seniorityindex ☓☓☓