Powershell About Active Directory Server
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Powershell About Active Directory Server相关的知识,希望对你有一定的参考价值。
一、获取域控制器服务器清单
(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的主要内容,如果未能解决你的问题,请参考以下文章
powershell 用于将Active Directory组添加到Active Directory的Powershell脚本
powershell PowerShell:备份Active Directory#PowerShell#ActiveDirectory
powershell PowerShell:列出Active Directory子网
powershell PowerShell:备份Active Directory组策略#PowerShell#ActiveDirecoty