我正在尝试在统一组级别控制团队的访客访问权限。
我试着阅读这篇文章,但似乎有些变量(例如$SettingID)没有值:
import-module azureadpreview
connect-azuread
$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session -DisableNameChecking
$GroupID = get-unifiedgroup -Identity <smtpaddress> | Select-Object -ExpandProperty ExternalDirectoryObjectId
$SettingID = Get-AzureADObjectSetting -TargetType Groups -TargetObjectID $GroupID | select-object -expandproperty ID
remove-azureadobjectsetting -id $settingid -targettype Groups -TargetObjectID $GroupID
$template = Get-AzureADDirectorySettingTemplate | ? {$_.displayname -eq "group.unified.guest"}
$settingsCopy = $template.CreateDirectorySetting()
$settingsCopy["AllowToAddGuests"]=$False
New-AzureADObjectSetting -TargetType Groups -TargetObjectId $groupID -DirectorySetting $settingsCopy在我看来,脚本从$settingsid行开始就失败了。这个变量给我一个空值的结果。
发布于 2019-10-18 20:45:52
该问题来自AzureAD模块,该设置仅在AzureADPreview上可用。
https://stackoverflow.com/questions/56396437
复制相似问题