Exchange 搜索非组织架构非空邮件组

Get-ADGroup -Filter {GroupCategory -eq "Distribution" } -Properties members,mail,description | Where-Object {$_.members } | %{
if (($_.distinguishedName).contains("OU=xxxxx,DC=xxxxx,DC=xxxxxx")){
#####标记的OU为在职人员OU路径
}

else{
Get-ADGroup -Filter {mail -eq $_.mail} -Properties members,mail,description | Select-Object name,mail,description,members

}

}

posted @ 2021-07-19 10:05  小木目心  阅读(49)  评论(0编辑  收藏  举报