mun*_*her 4 security-groups local-groups windows-10
以下命令在加入 AzureAD 的 Windows 10 VM 上运行:
PS C:\Windows\system32> Get-LocalGroupMember -Group Administrators
Get-LocalGroupMember:无法比较数组中的两个元素。在行:1 字符:1PS C:\Windows\system32> Get-LocalGroupMember -Group Users
Group NT AUTHORITY\Authenticated Users Unknown
Group NT AUTHORITY\INTERACTIVE UnknownPS C:\Windows\system32> net localgroup administrators
成员
管理员 AzureAD\UserName
知道为什么 PowerShell Get-LocalGroupMember 命令在管理员组上生成错误,而 net localgroup 像用户组的 Get-LocalGroupMember 一样工作吗?
这已被引用为官方错误:
https://github.com/PowerShell/PowerShell/issues/2996
这是解决方法:
http://jdhitsolutions.com/blog/scripting/2342/query-local-administrators-with-cim/
更新:
我在使用 CIM 和 WMI 时遇到了一些问题。
这是另一种对我有用的解决方法。
https://p0w3rsh3ll.wordpress.com/2016/06/14/any-documented-adsi-changes-in-powershell-5-0/
| 归档时间: |
|
| 查看次数: |
11591 次 |
| 最近记录: |