首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >控制微软团队统一组的AllowToAddGuests值

控制微软团队统一组的AllowToAddGuests值
EN

Stack Overflow用户
提问于 2019-05-31 21:53:49
回答 1查看 222关注 0票数 0

我正在尝试在统一组级别控制团队的访客访问权限。

我试着阅读这篇文章,但似乎有些变量(例如$SettingID)没有值:

https://techcommunity.microsoft.com/t5/Microsoft-Teams/Allow-or-Block-Guest-Users-from-a-Specific-Team-in-Microsoft/td-p/175918

代码语言:javascript
复制
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行开始就失败了。这个变量给我一个空值的结果。

EN

回答 1

Stack Overflow用户

发布于 2019-10-18 20:45:52

该问题来自AzureAD模块,该设置仅在AzureADPreview上可用。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56396437

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档