SQLServer Decimal数据类型怎么赋值
248
2022-10-04
Office 365 在邮件组中查询用户是否存在
#region IsIn 判断某个用户是否在邮件组中 Function IsIn([string]$User,[string] $GroupName){ if($User -eq "" -or $GroupName -eq ""){ Write-Warning "参数丢失,正确的格式为 IsIn userName GroupName" break } Write-Host "【Start】 Search $user in ("$GroupName ") group" $Result = Get-DistributionGroupMember -ResultSize unlimited $GroupName | where {$_.name -eq $User -or $_.PrimarySmtpAddress -eq $user} if($Result -eq $null){ $SubGroups = Get-DistributionGroupMember -ResultSize unlimited $GroupName | where {($_.RecipientType -eq "MailUniversalDistributionGroup") -or ($_.RecipientType -eq "MailUniversalSecurityGroup")} | select name if($SubGroups -ne $null){ ForEach($SubGroup in $SubGroups){ IsIn $user $SubGroup.name } }else{ Write-Host -fore red "$user is not in group ("$GroupName ")," $result=Get-Mailbox -Identity $User -errorAction silentlyContinue if($result -eq $null){ Write-Warning "The email account $user is not exist." break } } } else{ Write-Host $User "is found in group" $GroupName -foregroundcolor green } } #Example IsIn "用户邮箱" "邮件组名称" #endregion
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~