windows

A collection of 43 posts
Active Directory

Powershell 转移 FSMO

获取当前FSMO Get-ADForest | select SchemaMaster,DomainNamingMaster Get-ADDomain | select PDCEmulator,RIDMaster,InfrastructureMaster 转移FSMO Move-ADDirectoryServerOperationMasterRole -Identity -OperationMasterRole SchemaMaster,RIDMaster,InfrastructureMaster,DomainNamingMaster,PDCEmulator 强制转移FSMO Move-ADDirectoryServerOperationMasterRole -Identity -OperationMasterRole SchemaMaster,RIDMaster,InfrastructureMaster,DomainNamingMaster,PDCEmulator -Force
powershell

Powershell 操作 windows更新

定义更新搜索 $Criteria = "IsInstalled=0 and Type='Software'" 搜索可用的更新 $Searcher = New-Object -ComObject Microsoft.Update.Searcher $SearchResult = $Searcher.Search($Criteria).Updates 下载更新 $Session = New-Object -ComObject Microsoft.Update.Session $Downloader = $Session.CreateUpdateDownloader() $Downloader.Updates = $SearchResult $Downloader.Download() 安装更新 $Installer = New-Object -ComObject Microsoft.Update.Installer $Installer.Updates = $SearchResult $Result = $Installer.Install() 检查是否需要重启 $Resu
1 min read