Hi, I am trying to write a simple script to loop through users in a specified OU but am getting an error "Directory object not found".
The specified OU definitely has user accounts inside. Here is my code:
Powershell
$users=Get-ADUser-Filter*-SearchBase"OU=TestOU,DC=clf,DC=internal"
I've tried substituting OU=TestOU for CN=TestOU as recommended amongst the many articles I read online to no avail. If I use Get-ADUser on it's own it will return all the users on the domain. My structure within ADUC is as so:
1-Users
2-Students
3-Controlled Assessment
4-TestOU
Any recommendations greatly appreciated, trying to learn :)