【发布时间】:2018-08-21 15:42:10
【问题描述】:
我正在尝试列出所有设置了PasswordNeverExpires 标志的用户。
如果我使用
Get-ADUser
我获得了我域中所有用户的列表,以及大量默认属性。
如果我使用
Get-ADUser -Filter * -Properties Name | Format-Table -Property Name -AutoSize
我还获得了我域中所有用户名的列表,以表格形式。
当我使用时
Get-ADUser -Filter * -Properties Name,PasswordNeverExpires | Format-Table -Property Name,PasswordNeverExpire
我得到一个包含完整用户名列表的表格,但只有以下帐户在 PasswordNeverExpires 列中有 True 或 False
Guest
krbtgt
Administrator
SBSMonAcct
Network Administrator
<MyDomainAdminAccount>
SPSearch
<AnAdministratorAccountForOneOfOurSoftwareVendors>
<AnAccountThatWasCopiedFromTheDomainAdministratorAccount>
<AnotherAccountCopiedFromTheDomainAdministratorAccount>
表中的所有其他项目/用户名都有空/空白/不存在的值。
我也试过
Get-ADUser -LDAPFilter "(&(!userAccountControl:1.2.840.113556.1.4.803:=2)(userAccountControl:1.2.840.113556.1.4.803:=65536))"
但这只会返回
<MyDomainAdminAccount>
SPSearch
为什么没有为所有用户选择PasswordNeverExpires 标志?谢谢。
【问题讨论】:
标签: powershell active-directory passwords user-accounts