[英]Office365 Groups PowerShell to Subscribe Members
我使用下面的 powershell 创建了一个新的 office365 组
New-UnifiedGroup -DisplayName "Office 365 Group" -AccessType "Private" -PrimarySmtpAddress "new-group@example.com" -Owner "e.moshaya" -Members "e.moshaya" -Alias "new-group" -Notes "Office 365 Group" -SubscriptionEnabled -RequireSenderAuthenticationEnabled $false -AlwaysSubscribeMembersToCalendarEvents
但是,正如您在下面的屏幕截图中看到的那样,它没有启用订阅成员切换。 我正在尝试启用“订阅成员”切换,这将允许“将群组对话和事件的副本发送到群组成员的收件箱”。
我检查了https://docs.microsoft.com/en-us/powershell/module/exchange/users-and-groups/new-unifiedgroup?view=exchange-ps并且没有启用此切换的选项。
AFAIK可以将Set-UnifiedGroup cmdlet与AutoSubscribeNewMembers参数一起使用来满足您的要求。
注意:AutoSubscribeNewMembers开关指定是否自动将添加到Office 365组的新成员订阅对话和日历事件。 启用此设置后,只有添加到组中的用户才会自动订阅该组。 因此,您可以在创建组之后以及在将成员添加到该组之前将Set-UnifiedGroup cmdlet与AutoSubscribeNewMembers参数一起使用为true。
希望这可以帮助!! 干杯!!
这是我几年前构建的脚本,它将扫描所有可用组并订阅任何未订阅其组的用户。
# ref: https://answers.microsoft.com/en-us/msoffice/forum/msoffice_outlook-mso_win10-mso_o365b/how-to-subscribe-all-members-to-office-365-group/e998a92e-04a0-4d56-8b99-67099d1babb3
# when you create group without changing subscriber setting, all group member added during the creation will not subscribe to group msg. Even worse, when you create a group by creating a new team, this option won't even show up (in older versions).
# this script will list and re-configure so all group members will subscribe to all of their groups
#Set-ExecutionPolicy RemoteSigned
$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session
# get array of the user emails whose user is not subscribing to current group
function Get-NaughtyUserList {
Param($GroupName)
$MemberList = Get-UnifiedGroupLinks -Identity $($GroupName) -LinkType Members | ForEach-Object{$_.PrimarySmtpAddress}
$SubscriberList = Get-UnifiedGroupLinks -Identity $($GroupName) -LinkType Subscribers| ForEach-Object{$_.PrimarySmtpAddress}
$NaughtyUser = $MemberList |Where-Object {$SubscriberList -notcontains $_}
If($NaughtyUser) {
Write-Host $NaughtyUser
Return $NaughtyUser
} Else {
Write-Host All Clean!
}
}
Get-UnifiedGroup | ForEach-Object {
Write-Host $_.Name
$List = Get-NaughtyUserList -GroupName $_.Name
If($List) {
Add-UnifiedGroupLinks -Identity $_.Name -LinkType Subscribers -Links $List.Split(',')
Get-NaughtyUserList -GroupName $_.Name
}
}
Remove-PSSession $Session
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.