Unable to Find a Default Server With Active Directory Web Services Running

I am using window server 2016. I get this error every-time “Unable to Find a Default Server With Active Directory Web Services Running” when i run the the following command and other get-commands like Get-ADComputer, Get-ADgroupmember.

Get-ADUser -Filter * -Property * | Select-Object Name | Export-CSV D:\Users\file.csv -NoTypeInformation -Encoding UTF8

Any idea please how can i get rid of this error and execute my command.

 

 

Thank you

Are you executing it in a DC ? make sure the ADWS service is running in the DC. if from a member server, make sure its joined to domain.

Try the following Steps:

  1. Run Nslookup for the Domain Controller.
  2. Check the Primary and Secondary DNS Settings.
  3. Do a ping to the Primary and secondary DNS Servers.
  4. Check and Add the DNS Suffix if required.
  5. Run ipconfig /registerdns
  6. Check the Netlog / FRS Service is running
Then try again.