Users ADSI

#ADSI

$DomainObj = [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain() $Domain = [ADSI]”LDAP://$DomainObj” $DN = $Domain.distinguishedName $DomainAdmins = [ADSI]”LDAP://cn=Domain Admins,cn=Users,$DN” “Group name “ + $DomainAdmins.sAMAccountName ForEach ($MemberDN In $DomainAdmins.Member) { $Member = [ADSI]”LDAP://$MemberDN” “ “ + $Member.cn }

Last updated