Hi,
I hope this is the correct place to ask this question
I am fairly new to PowerShell and am trying to perform a Get-ADComputer lookup on a specific OU in my domain, however the OU's are named $Servers for example.
So when I run...
Get-ADComputer -LDAPFilter "(name=*)" -SearchBase "CN=$Servers,DC=contoso,DC=com"
I receive the following error
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-ADComputer], ADException
+ FullyQualifiedErrorId : ActiveDirectoryServer:8335,Microsoft.ActiveDirectory.Management.Commands.GetADComputer
I have tried some other ways of presenting the value such as `$Servers to no avail.
Can anyone advise how to do this.
Many thanks.