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

2 OU and one Search Level

$
0
0

Hi all

I am no good at scripting and need a little help, I have taken a look at the forums and cannot get what I need working.

I have the following which is working fine.

Get-ADUser -Filter * -SearchBase "OU=Test DC=Test ,DC=Test" -Properties SamAccountName, Physicaldeliveryofficename | Select SamAccountName, Physicaldeliveryofficename | Export-csv "C:\Office.csv"

How do I add the following to this script

Another OU, we have several OUs in our Domain and I need to search 2 of them and I need to keep the search scope to one level.

Any help would be great.


I.T support


Viewing all articles
Browse latest Browse all 21975

Trending Articles



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