Can I Create Active Directory site using Command Line Tool?

Windows Server 2012 and later Operating System offer creation of Active Directory site using PowerShell cmdlet. To create a new Active Directory site using a command line tool, execute the below PowerShell command:

  • New-ADReplicationSite -Name MyADSite

In case you need to create multiple Active Directory sites, you must use either a PowerShell FOR loop or create Active Directory sites from a CSV file as shown in the command below:

  • Import-CSV -Path C:\Sites\AllSites.CSV | New-ADReplicationSite

The Import-CSV command imports all site names mentioned in the C:\Sites\AllSites.CSV into memory. Once imported, each site name is passed to the New-ADReplicationSite PowerShell cmdlet, which, in turn, creates the Active Directory site.

About Nirmal Sharma

Nirmal is a MCSEx3, MCITP and was awarded Microsoft MVP award in Directory Services and Windows Networking. He is specialized in Directory Services, Failover cluster, Hyper-V, System Center, Windows Azure, and Exchange Servers and has been involved in Microsoft Technologies since 1994. In his spare time, he offers technical help by writing tips and articles on several web sites. Nirmal can be reached at [email protected].

About The Author

Leave a Comment

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

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Scroll to Top