我希望获得Exchange中所有分发列表及其成员的列表?这是否可以使用任何内置的Exchange工具?电源外壳?第三方工具?
通讯组存储在Active Directory中.此Power
shell脚本将列出AD域中的所有通讯组及其成员.如果您最初将它们存储为安全组,请删除“(|(groupType = 2)(groupType = 4)(groupType = 8))”.
原文链接:https://www.f2er.com/windows/366494.html$strFilter = "(&(objectCategory=Group)(|(groupType=2)(groupType=4)(groupType=8)))" $objDomain = New-Object System.DirectoryServices.DirectoryEntry $objSearcher = New-Object System.DirectoryServices.DirectorySearcher $objSearcher.SearchRoot = $objDomain $objSearcher.PageSize = 1000 $objSearcher.Filter = $strFilter $objSearcher.SearchScope = "Subtree" $objSearcher.PropertiesToLoad.Add("cn") | Out-Null $objSearcher.PropertiesToLoad.Add("member") | Out-Null $colResults = $objSearcher.FindAll() foreach ($objResult in $colResults){ $objItem = $objResult.Properties; Write-Output $objItem.cn foreach ($objMember in $objItem.member) { Write-Output " $objMember" } }