Fix: Unable to Find a Default Server with Active Directory Web Services Running

The error Cannot find the default server running Active Directory Web Services, may appear

  • when you import an ActiveDirectory module into your PowerShell session
  •  when you run various cmdlets from that module.

 For example, when you transfer FSMO roles with Move-ADDirectoryServerOperationMasterRole, creating bulk AD users using New-ADUser, and all other cmdlets:

Import-Module ActiveDirectory

WARNING: Error initializing default drive: ‘Unable to find a default server with Active Directory Web Services running’

Unable to find a default server with active directory web services running

Move-ADDirectoryServerOperationMasterRole -Identity dc01 –OperationMasterRole DomainNamingMaster,PDCEmulator,RIDMaster,SchemaMaster,InfrastructureMaster

CategoryInfo: ResourceUnavailable, ADServerDownException


Reason of error

This error occurs because your computer was unable to connect to Active Directory Web Services (ADWS) on the nearest domain controller.

The PowerShell AD module uses Active Directory Web Services on DC to communicate with ADDS. The TCP port 9389 on the domain controller must be accessible from your computer to communicate properly with ADWS.

Run the following command on any domain controller to find the nearest DC with the ADWS role:

Get-ADDomainController -Discover -Service ADWS

You can find a DC with the ADWS role in another AD site:

Get-ADDomainController -ForceDiscover -Discover -Service ADWS -NextClosestSite

To run AD PowerShell module cmdlets from your computer on a specific DC, use the –Server parameter. For example:

New-ADUSer –Server DC02 …..


Move-ADDirectoryServerOperationMasterRole -Server dc02 ……

Unable to find a default server with an active directory

hint. Also, the ‘Unable to find a default server with Active Directory Web Services running’ error may appear if your computer joined to the Active Directory domain. In this case, you must specify the domain controller name in all PowerShell cmdlets using the parameter –Server {DC_FQDN/IP address}.

You can check the availability of port 9389 on the domain controller with the command:

Test-NetConnection DC01 -port 9389

If the command returns TcpTestSucceeded: False, it means the connection is blocked by the firewall, the ADWS service is not running, or the DC is down.

Connect to the desired DC and make sure the ADWS service is running on it. To do this, open the services.MSc console, locate Active Directory Web Services and verify that it is in a Running state.

If the service is stopped, start it. If the service is running, restart the DC or restart the service with the PS command:

Restart-Service –name ADWS –verbose

Powershell is unable to find a default server with active directory web services running

ADWS is built into ADDS since Windows Server 2008 R2. If your Active Directory forest uses Windows Server 2003 R2/Windows Server 2008 domain controllers, this service must be installed separately.

ADWS is installed as an Active Directory Management Gateway Service package: KB969166 and KB968934. Learn more about ADMGS service requirements and installation here. ADMGS provides web-based management APIs on domain controllers running Windows Server 2003 SP2 and Windows Server 2008.

For the AD-PowerShell module cmdlets to work correctly, the ADWS service must be installed on at least one DC.

Leave a Reply

Your email address will not be published. Required fields are marked *

Enter Captcha Here :