如何同时修改SharePoint帐号和AD帐号的密码

cls
if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null) {
    Add-PSSnapin "Microsoft.SharePoint.PowerShell"
}

$newPW = Read-Host "Enter new password" -AsSecureString
Get-SPManagedAccount | ForEach-Object {
      Write-Host $_.UserName        
      Set-SPManagedAccount -Identity $_.UserName -NewPassword $newPW -ConfirmPassword $newPW -Confirm:$false      
}
原文地址:https://www.cnblogs.com/fengwenit/p/3755436.html