标签:select 获取 dcs ima about write nbsp alt gpo
一、获取域控制器服务器清单
(Get-ADForest).Domains | %{ Get-ADDomainController -Filter * -Server $_ } | select hostname,ipv4address,OperatingSystem | Export-Csv d:\ps\List.csv
$allDCs = (Get-ADForest).Domains | %{ Get-ADDomainController -Filter * -Server $_ }
二:备份GPO
Import-Module grouppolicy $CurrtDate = Get-Date -UFormat %Y%m%d New-Item -Path "\\SERVERNAME\D$\ALLBackup\GPO\$CurrtDate" -ItemType Directory -Force Backup-GPO -all -Path "\\SERVERNAME\D$\ALLBackup\GPO\$CurrtDate" Get-Childitem "\\SERVERNAME\D$\ALLBackup\GPO" | Where {$_.LastWriteTime -lt (Get-Date).AddDays(-20)} | Foreach { Remove-Item $_.FullName -Recurse -Force}
三、查看/设置ADServer环境设定
Set-ADServerSettings Set-ADServersettings -recipientviewroot "wendy.com/accounts"
Powershell About Active Directory Server
标签:select 获取 dcs ima about write nbsp alt gpo
原文地址:http://www.cnblogs.com/scentpath/p/adpowershell.html