Windows 如何获取所有远程计算机';通过Powershell的用户名?
是否有任何方法可以通过Powershell获取远程计算机上所有本地用户帐户的列表?您可以通过WMI查询获取此信息Windows 如何获取所有远程计算机';通过Powershell的用户名?,windows,powershell,Windows,Powershell,是否有任何方法可以通过Powershell获取远程计算机上所有本地用户帐户的列表?您可以通过WMI查询获取此信息 function Get-LocalUser ($Computername = $env:COMPUTERNAME) { Get-WmiObject -Query "Select * from Win32_UserAccount Where LocalAccount = 'True'" -ComputerName $ComputerName | Select-Obje
function Get-LocalUser ($Computername = $env:COMPUTERNAME) {
Get-WmiObject -Query "Select * from Win32_UserAccount Where LocalAccount = 'True'" -ComputerName $ComputerName |
Select-Object -ExpandProperty Name
}
Get-LocalUser -ComputerName "TestPC1"
您是指本地用户帐户还是当前登录的用户?是的,指存储在SAM中的所有用户。