Wednesday, August 14, 2013

List users in security group.

So group you want to target is vpn_users and you want to output to a text file called vpnusers.txt.

1st option is very detailed and has OU information in it. 2nd option is on the fly kind of deal and useful for just looking at members.


dsquery group -name "vpn_users" | dsget group -members -expand > c:\vpnusers.txt

Or

net group vpn_users /domain > c:\vpnusers.txt

Also you might like net user ijaved/domain command as well :) I love it to check details like if account has expired password or account is locked. Saves me from going into AD and checking Account tab.

No comments:

Post a Comment