Hi
I am attempting to update over one hundred servers, DNS server settings using a PS script i came across here:
http://gallery.technet.microsoft.com/scriptcenter/Modify-DNS-Server-0ec651e7
I cant get the script to run correctly and receive the following errors:
My syntax is as follows: (real IPs and OU names omitted)
PS C:\BatchModifyDNSConfiguration> .\BatchModifyDNSConfiguration.ps1 –OU "OU=Test,OU=Servers,OU=Non-SOE users & computers,DC=xxx,DC=xxxx" –OldDNS x.x.x.x. –NewDNS x.x.x.x
Get-ADOrganizationalUnit : The search filter cannot be recognized
At C:\BatchModifyDNSConfiguration\BatchModifyDNSConfiguration.ps1:55 char:13
+ $DistName = Get-ADOrganizationalUnit -Filter 'Name -like $OU' | ForEach-Object{$ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-ADOrganizationalUnit], ADException
+ FullyQualifiedErrorId : ActiveDirectoryServer:8254,Microsoft.ActiveDirectory.Management.Commands.GetADOrganizationalUnit
Get-ADComputer : An empty SearchBase is only supported while connected to a GlobalCatalog.
At C:\BatchModifyDNSConfiguration\BatchModifyDNSConfiguration.ps1:57 char:12
+ $Servers = Get-ADComputer -SearchBase "$DistName" -Filter "*" | ForEach-Object { ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Get-ADComputer], ArgumentException
+ FullyQualifiedErrorId : ActiveDirectoryCmdlet:System.ArgumentException,Microsoft.ActiveDirectory.Management.Commands.GetADComputer
I am knew to PS so would appreciate a few pointers with this one!
Thanks in advance.