获取用户属性 passwordexpires


PowerShell交流中心分类: Powershell基础获取用户属性 passwordexpires
0
edwardkdh asked 4年 ago

版主
我通过get-wmiobject 获取用户属性

Get-WmiObject -Query "select * from win32_account where name='administrator'"|Get-Member
有 passwordexpires 这个属性

但是

报错  Get-WmiObject -Query "select passwordexpires from win32_account where name='administrator'"
正常  Get-WmiObject -Query "select status from win32_account where name='administrator'" 
这种情况如何导致的?

×用微信扫描并分享
1 Answers
0
Best Answer
Mooser Lee 管理员 answered 4年 ago
不支持,直接select property
PS C:\Users\libao> $admin = Get-WmiObject -Query "select * from win32_account where name='administrator'"
PS C:\Users\libao> $admin.PasswordExpires
False