Windows PowerShell for Active Directory includes the ability to manage replication, sites, domains, and forests, domain controllers, and partitions. For example, Active Directory Sites and Services snap-in and Repadmin.exe will notice that similar features are now available in the context of Active Directory Windows PowerShell. Existing Windows PowerShell cmdlets for Active Directory include the original cmdlet, thus simplifying the user experience and making it easy for customers to create automation scripts that are compatible.
For active Directory replication and Topology cmdlets, Windows PowerShell is available in the following environments:
Windows Server 2012 domain controller or above;
Remote server Administration Tools for AD DS and AD LDS with Windows Server 2016 installation;
Install active Directory for Windows PowerShell modules;
When you install an AD DS server role server that is running Windows Server 2016, the Windows PowerShell module for Active directory is installed by default. No other steps need to be added outside of the server role. You can also install the Remote Server Administration tool on the server to run the Active Directory module that is installed on Windows Server 2016
The following situations are useful for administrators who are familiar with the new management cmdlet:
Get a list of all domain controllers and their corresponding sites
Managing Replication topologies
Viewing replication status and information
First, to view the details of each site:
1.1. View all Active Directory Sites:
Get-adreplicationsite-filter *
Must be a member of the administrator domain Group or have equivalent permissions.
This will return detailed information for each site. The filter parameter restricts the list of returned objects to the entire Active Directory PowerShell cmdlet. In this case, the asterisk (*) indicates all site objects.
To format the output of the Get-adreplicationsite command as a table and restrict specific fields to be displayed, you can pipe output to the format-table command (or "FT" abbreviation):
Get-adreplicationsite-filter * | FT Name
This returns the list of sites, including only the shorter version of the Name field.
Get-addomaincontroller-filter * | FT Hostname,site
This command returns the names that are hosted by the domain controllers, as well as their site associations.
II. Management of replication topologies:
2.1. Create the Test branch site:
New-adreplicationsite TEST
2.2. Create a new site link for site A-site B:
New-adreplicationsitelink ' default-first-site-name-test '-sitesincluded default-first-site-name,test- Otherattributes @{' Options ' = 1}
Use the auto-complete parameter names on the tabs, such as-sitesincluded and-otherattributes instead of manually launching them into the type.
2.3. Set the site link cost and Replication frequency:
Set-adreplicationsitelink Default-first-site-name-test-cost 100-replicationfrequencyinminutes 15
This command sets the site link cost at 100 and sets the replication to the site frequency to 15 minutes.
2.4. Move the domain controller to a different site: (Move the domain controller BRODC to the test site)
Get-addomaincontroller BRODC | Move-addirectoryserver-site TEST
Verify site information:
Open the Site and service window for Active Directory validation:
or through PowerShell command validation:
Get-addomaincontroller-filter * | FT Hostname,site
Third, view the replication status information:
3.1. View the latest vector table for a domain controller:
Get-adreplicationuptodatenessvectortable BRODC
3.2. View the latest vector tables for all domain controllers in the domain:
Get-adreplicationuptodatenessvectortable * | Sort Partner,server | FT Partner,server,usnfilter
Today's share is here, I hope in the wrong side can help everyone, thank you for your support.
Windows Server 2016-powershell Manage Site Replication