Solved

domainroot, forestroot and specifying a domain

Posted on 2010-11-17
4
632 Views
Last Modified: 2012-05-10
Hi guys hope you can help.
We have several subdomains, and when I run the following:

dsquery * domainroot -filter "(&(objectCategory=Computer))" -attr Name operatingSystem operatingSystemServicePack -limit 0

It targets the current domain I am in.

What Id like to do is to change the domain focus to point to another subdomain and perform the same query against that subdomain.

Any help greatly appreciated.
0
Comment
Question by:Simon336697
  • 2
  • 2
4 Comments
 
LVL 65

Accepted Solution

by:
RobSampson earned 500 total points
ID: 34160436
Hi, I don't have any subdomains, but can you use:
dsquery * "DC=subdomain,DC=domain,DC=com" -filter "(&(objectCategory=Computer))" -attr Name operatingSystem operatingSystemServicePack -limit 0

Regards,

Rob.
0
 
LVL 1

Author Comment

by:Simon336697
ID: 34199996
Thanks Rob that is awesome
0
 
LVL 1

Author Comment

by:Simon336697
ID: 34200004
Rob can I ask you, are you porting a lot of your scripts over to Powershell, and using Powershell instead of vbs now?
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 34201039
Hi.  I'd like to be, but no, I don't know PowerShell and don't have the time to learn it at the moment.  The time spend in writing a PowerShell script would take me about five times as long as writing a VBS at the moment, despite the fact it would be MUCH less code.

One day I hope to find some time to learn PowerShell, but for now, still going with VBS.

Rob.
0

Join & Write a Comment

Suggested Solutions

Resolve DNS query failed errors for Exchange
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now