Sorry for the simple question to start, but I am stumped on the answer.
My code is simple... I want to take a variable from command line into my script and use that variable as a Filter string within an AD command. I have as follows:
PARAM($myOU)
$FoundOUs = Get-ADOrganizationalUnit -Filter 'Name -like "*"' -SearchBase ="OU=Offices,DC=dc1,DC=domain,DC=com"
So, I want to replace "*" with $myOU... I am at a lost on how to do this. I have tried things like -Filter Name $myOU, etc, but no luck. Any suggestions would be great.