Forum Discussion
Rob M
Nov 22, 2021Copper Contributor
Get all AD computers excluding servers
Hi! I am trying to create a script that will retrieve all computers but exclude any servers found. I also discovered that using the most basic command will return about two dozen servers and then cr...
J Mymryk
Nov 22, 2021Copper Contributor
Hi, my best guess is that it is finding an object in AD that is corrupted and therfore throws an exception. you may want to try the older method of adsisearcher as per:
https://social.technet.microsoft.com/Forums/en-US/ec2732b9-d2dd-4592-82bc-71fae700a81b/powershell-list-all-servers-in-the-domain-and-the-ou?forum=ITCG
Have you done AD health checks to make sure you don't have orphan or corrupt objects?
https://social.technet.microsoft.com/Forums/en-US/ec2732b9-d2dd-4592-82bc-71fae700a81b/powershell-list-all-servers-in-the-domain-and-the-ou?forum=ITCG
Have you done AD health checks to make sure you don't have orphan or corrupt objects?
Rob M
Nov 23, 2021Copper Contributor
Hi J Mymryk,
I will look into your suggestions and also check AD health.
Thank you!
I will look into your suggestions and also check AD health.
Thank you!