nestedgroup membership of a user
hi,
i testing functions of powershell in ad. have script works way wanted. trying extract group , nested groups user memebr of user , assumed line here should able provide information $i.properties.item("memberof").
can me understand how achieve this?
$domainname = [adsi]""
$searcher = new-object directoryservices.directorysearcher($domainname)
$searcher.filter = "(&(objectclass=user)(name=*my*))"
$user = $searcher.findall()
$groupn = [adsi] "ldap://cn=ctxgroup,ou=ctx,dc=home,dc=lab"
foreach ($i in $user)
{
$userdn = $i.properties.distinguishedname
$guserdn = "ldap://$userdn"
$groupn.add($guserdn)
}
$i.properties.item("memberof")
Windows Server > Windows PowerShell
Comments
Post a Comment