I am a gnats hair above a beginner in PS. I want to inventory all devices inside an AD Forest. I have 4 domains inside the forest. I was able to return the current domain with ease using this script:
Get-ADComputer -Filter * | Out-File $OutputFile
Is there a way to run a script that grabs all four domains, or do I need to perform 4 searches, one in each domain? Any help is appreciated
You’ll have to do each domain one at a time. The easiest was would be to map a new PSDrive to each of the four domains, using the Active Directory PSProvider. Then you can change to each “drive” and run the same command. The AD commands all target, by default, whatever domain “drive” you’re in at the time.
Yet, that one is a bit long… since you qualified your PoSH experience as you have. Maybe this will work for you. Well, along with the approach Don suggested to make it easier for you to hang your hat on…
Thank you Don. I was able to get all of the domains to report their devices under AD control. Now I am hearing that there are some XP machines outside of the domain but I dont know where they could be, kinda like a needle in a haystack. Any thoughts on how I can accomplish this.
Since the XP machines are outside domain you will not have access. Either look in DHCP server or you will need network sniffer to figure out live XP desktops out there.