Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1435
  • Last Modified:

dsquery question

To display the pre-windows 2000 logon names of all users in the Sydney office, use this command:

dsquery user -office "Sydney" | dsget user -samid

dsquery failed:'-office' is an unknown parameter.

What am I doing wrong?

I am getting this example from the MCTS Exam 70-640 Training Kit, Page 122.

No URLs please.
0
motnahp00
Asked:
motnahp00
3 Solutions
 
AnuroopsunddCommented:
dsquery do not have office parameter. please see below link to check for valid parameters in dsquery

http://technet.microsoft.com/en-us/library/cc725702(v=ws.10).aspx
0
 
motnahp00Author Commented:
So what should be the correct syntax to accomplish the query?
0
 
arnoldCommented:
Is Sydney a site, OU?
dsquery site | find "Sydney"
Switch site with OU.

You may have to chain queries.

Without knowing your structure it is hard to point out a specific solution

dsquery user -o "string from the earlier find"
0
 
Venugopal NCommented:
Office parameter is not available with dsquery

dsquery user domainroot | dsget user - smaid -office >> test.xls

The above command will list all the suer of current domain and with the samid and the office location.It will be export to an excel file and you can filter the file for the office location
0
 
motnahp00Author Commented:
Thanks for helping.
0

Featured Post

Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now