troubleshooting Question

Powershell script change DNS

Avatar of Omar Lujan
Omar Lujan asked on
DNSPowershell
3 Comments1 Solution24 ViewsLast Modified:
Hi Experts,

I'm trying to run the script from here out of the box

https://gallery.technet.microsoft.com/Modify-DNS-Server-0ec651e7

BatchModifyDNSConfiguration.ps1 -OU 'OU=FAKE GROUP, OU=FAKE,DC=DOMAIN,DC=com' –OldsDNS 192.168.9.9 –NewDNS 192.168.9.99



Get-ADComputer : An empty SearchBase is only supported while connected to a GlobalCatalog.
At C:\Users\olujan\Desktop\BatchModifyDNSConfiguration\BatchModifyDNSConfiguration\BatchModifyDNSConfiguration.ps1:57 char:12
+ $Servers = Get-ADComputer -SearchBase "$DistName" -Filter "*" | ForEa ...
+            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Get-ADComputer], ArgumentException
    + FullyQualifiedErrorId : ActiveDirectoryCmdlet:System.ArgumentException,Microsoft.ActiveDirectory.Management.Commands.GetADComputer


I've tried with single and double quotes, re-order the switches... Feels like I'm making a rooking mistake. What am I doing wrong?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros