2014-03-30 72 views

回答

6

您可以通過WMI查詢獲取此信息。

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" 
相關問題