Active Directory Administration Cookbook
上QQ阅读APP看书,第一时间看更新

Using Windows PowerShell

Alternatively, Active Directory sites can be managed using the Active Directory module for Windows PowerShell.

Use the following lines of PowerShell to rename an Active Directory site:

Import-Module ActiveDirectory 

Rename-ADObject -Identity "CN=
Default-First-Site-Name,CN=Sites,CN=Configuration,DC=Lucernpub,DC=com" -NewName "ADSite2"

Use the following lines of PowerShell to change the description of an Active Directory site:

Import-Module ActiveDirectory 

Set-ADReplicationSite -Identity "CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=Lucernpub,DC=com" -Description "New description here"

Use the following lines of PowerShell to change the location of an Active Directory site:

Import-Module ActiveDirectory 

Set-ADReplicationSite "CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=Lucernpub,DC=com" -Location "New location here"