您的位置:首页 > 运维架构 > Shell

Powershell脚本设置SharePoint自动更新托管账户密码

2015-07-29 10:13 771 查看
# 创建密码修改计划

$SPSchedule = new-object Microsoft.SharePoint.SPMonthlySchedule
$SPSchedule.BeginDay = 7
$SPSchedule.EndDay = 7
$SPSchedule.BeginHour = 2
$SPSchedule.EndHour = 3
$SPSchedule.BeginMinute = 0
$SPSchedule.EndMinute = 0
$SPSchedule.beginsecond = 0
$SPSchedule.endsecond = 0

# 设置托管账户的密码修改计划

$SPManagedAccount.ChangeSchedule = $SPSchedule
$SPManagedAccount.DaysBeforeExpiryToChange = 2

# 开启密码修改邮件提醒功能

$SPManagedAccount.EnableEmailBeforePasswordChange = $False
$SPManagedAccount.DaysBeforeChangeToEmail = 2

# 开启密码自动修改功能

$SPManagedAccount.AutomaticChange = $True
$SPManagedAccount.Update()
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  sharepoint 脚本