Indie101
asked on
Script to find any empty OU and nested OU in Active Directory
Hi,
Looking for a best way to do this
I was checking out script below
Get-ADObject -filter * -SearchBase $ou | Where {$_.distinguishedname -ne $ou.distinguishedname} keep getting error below
Get-ADObject : Cannot validate argument on parameter 'SearchBase'. The argument is null. Provide a valid value for the argument, and then try running the command again.
At line:1 char:36
+ Get-ADObject -filter * -SearchBase $ou | Where {$_.distinguishedname ...
+ ~~~
+ CategoryInfo : InvalidData: (:) [Get-ADObject], ParameterBindingValidation Exception
+ FullyQualifiedErrorId : ParameterArgumentValidatio nError,Mic rosoft.Act iveDirecto ry.Managem ent.Comman ds.GetADOb ject
Looking for a best way to do this
I was checking out script below
Get-ADObject -filter * -SearchBase $ou | Where {$_.distinguishedname -ne $ou.distinguishedname} keep getting error below
Get-ADObject : Cannot validate argument on parameter 'SearchBase'. The argument is null. Provide a valid value for the argument, and then try running the command again.
At line:1 char:36
+ Get-ADObject -filter * -SearchBase $ou | Where {$_.distinguishedname ...
+ ~~~
+ CategoryInfo : InvalidData: (:) [Get-ADObject], ParameterBindingValidation
+ FullyQualifiedErrorId : ParameterArgumentValidatio
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER