Command Line...

Alright, so I put the command line and scripting off...
As an exercise in the command line I was trying to write something that would return all of the users who are a member of a specific group. I would have thought dsquery could do this but so far no luck.
Any ideas?
As an exercise in the command line I was trying to write something that would return all of the users who are a member of a specific group. I would have thought dsquery could do this but so far no luck.
Any ideas?
-Daniel
Comments
or if you don't want to bother with the DN
dsquery group domainroot -name group* | dsget group -members -expand
Muahahahahahhaa
Oh yea, you can use Ldp to get the Dn
Royal knows his stuff inside out, there's almost no beating him at anything even related to W2K3. Whenever he posts anything, everyone stands to learn something.
Blog >> http://virtual10.com
C:\Documents and Settings\Administrator>dsget group "CN=Administrators,OU=London,DC=ad,DC=
kahn,DC=com" -members -expand
dsget failed:Directory object not found.
type dsget /? for help.
If your domain name is only kahn,com the command should be
dsget group "CN=Administrators,OU=London,DC=kahn,DC=com" -members -expand
also, I beleive the dn is case sensitive.
__________________________________________________________
MCP (282 - 270 - 284 - 290 - 291 - 293 - 294 - 298 - 299 - 350)
MCTS (351 - 620 - 622 - 647 - 649 - 671)
MCSA / S / M - MCSE / S
MCITP (EST - EA ) - MCT
A+ - IBM - SBSS2K3 - CISCO_SMB
CompTIA : A+
So let me throw out a scenario.
You manager walks in and IT audit wants to know how many people are in group XYZ in every OU in the domain. He wants this in Excel format... is there a way to save this as a text file? CSV?
I just copied that from above. Be sure to use the correct string
Also, that works with pretty much any command line utility that generates output text. i.e. netstat -a > c:\netstat.txt
I beleive the correct answer to that os to use CSVDE, wich I remember is in the mspress as a tool you should know about.
http://technet2.microsoft.com/windowsserver/en/library/1050686f-3464-41af-b7e4-016ab0c4db261033.mspx?mfr=true
__________________________________________________________
MCP (282 - 270 - 284 - 290 - 291 - 293 - 294 - 298 - 299 - 350)
MCTS (351 - 620 - 622 - 647 - 649 - 671)
MCSA / S / M - MCSE / S
MCITP (EST - EA ) - MCT
A+ - IBM - SBSS2K3 - CISCO_SMB
CompTIA : A+