Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

query of AD not working ??

$
0
0

$user1=read-host"Enter the users Login ID"
$GetData=Get-ADPrincipalGroupMembership$user1 | Select-Object-ExpandProperty name
$GetData

The code above works fine when I enter a valid users active directory login ID.    But if I enter a bad user name like 'MrBadUser' it returns all the groups that my ID is a member of.  Why?  

Thank you.  


Viewing all articles
Browse latest Browse all 6937

Trending Articles