且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何计算foreach循环中if循环的结果

更新时间:2022-10-15 18:43:57

Get-ADGroup can do much of what you ask without going away from AD.

Getting this done with the Filter parameter is painful. The LDAP filter however is simple.

For empty groups:

Get-ADGroup -LdapFilter "(!member=*)"

For empty groups which are also not nested inside other groups:

Get-ADGroup -LdapFilter "(&(!memberOf=*)(!member=*))"

相关阅读

技术问答最新文章