如何使用 PowerShell 脚本解锁 AD 账户

大多数管理员使用 PowerShell 命令解锁其环境中的所有 AD 用户账户。然而,使用 ADManager Plus 解锁被锁定的 AD 账户操作要简单得多。以下是使用 Windows PowerShell 和 ADManager Plus 执行相同操作的对比:

Windows PowerShell

使用 PowerShell 解锁 AD 账户的步骤:

  • 确定要解锁用户账户的域
  • 确定需要修改的 LDAP 属性。
  • 编写脚本。
  • 在 Windows PowerShell 中执行脚本。

解锁 AD 用户账户的 Windows PowerShell 示例脚本

 已复制
Unlock-ADAccount -Identity "CN=Scott John,OU=Finance,OU=UserAccounts,DC=ABCCompany,DC=COM"
点击复制整个脚本

ADManager Plus

如何批量解锁账户:

  • 选择 Unlock Users -> User Management – Management
  • 选择域和 OU。
  • 选择要解锁的用户或导入包含用户详细信息的 CSV 文件,然后点击 Apply。

截图

» 开始 30 天免费试用

使用 Windows PowerShell 命令解锁 Active Directory 用户账户存在以下限制:

  • 该脚本只能在具有 Active Directory Domain Services 角色的计算机上运行。
  • 每增加一个筛选条件,脚本都会变得更长更复杂。
  • 解决这些脚本问题需要丰富的 AD 和脚本编写经验

ADManager Plus 可以帮助您通过简单直观的 UI,仅使用 CSV 文件 批量解锁 AD 用户

使用 ADManager Plus 批量管理 AD 用户设置。

  获取 30 天免费试用。

开始您的 无脚本 AD 管理,报告和 自动化之旅 使用 ADManager Plus。

  •  
     
  • 提交即表示您同意根据 隐私政策 处理个人数据。

谢谢

您的下载将在 15 秒内自动开始。如未开始,点击此处手动下载。

相关 Powershell 操作指南:

Active Directory 管理和报告的一站式解决方案

电子邮件下载链接 Email the ADManager Plus download link