Check if specific user is member of specific group
hello everyone,
i'm trying find out if specific users member of specific group in active directory. google shows me lot of examples loginscripts, quest's tool , local groups. don't need local groups domain groups located in active directory , quest tool needs installment can't unfortunately.
i don't really have start although know how add specific user specific group. need know if member of group or not.
i'm hoping simple solution.
this have now:
$group = [adsi]"ldap://localhost:389/cn=ict,ou=ict,dc=oxl,dc=local" $group.ismember("ldap://localhost:389/cn=nathan,ou=ict,dc=oxl,dc=local")
keeps saying false
function get-groupmembership($dn,$group){ $objentry = [adsi]("ldap://"+$dn) $objentry.memberof | { $_ -match $group} } get-groupmembership "cn=kazun,dc=contoso,dc=com" "backup operators"
Windows Server > Windows PowerShell
Comments
Post a Comment