[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

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

domainroot, forestroot and specifying a domain

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
Simon336697
Asked:
Simon336697
  • 2
  • 2
1 Solution
 
RobSampsonCommented:
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
 
Simon336697Author Commented:
Thanks Rob that is awesome
0
 
Simon336697Author Commented:
Rob can I ask you, are you porting a lot of your scripts over to Powershell, and using Powershell instead of vbs now?
0
 
RobSampsonCommented:
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

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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