Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Using -SearchBase to search AD using powershell

$
0
0

I am using powershell to search active directory but I can seem to read the child OU's. Under "US" in active directory there are cities. For some reason the line below only returns the first city listed on US. I think I need to modify my search base to specify the OU under US?

$Computers = Get-ADComputer -Property Name, lastLogonDate -Filter { lastLogonDate -lt $Days } -Server servername -Searchbase "OU=US,DC=mydomain,DC=net" `


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>