Powershell Cmd to fetch local computer users list
Powershell Cmd to fetch local computer users list:
$computers = Get-Content -Path C:\computers.txt
Get-WmiObject -ComputerName $computers -Class Win32_UserAccount -Filter "LocalAccount='True'" |
Select PSComputername, Name, Status, Disabled, AccountType, Lockout, PasswordRequired, PasswordChangeable, SID | Export-csv C:\local_users.csv -NoTypeInformation
$computers = Get-Content -Path C:\computers.txt
Get-WmiObject -ComputerName $computers -Class Win32_UserAccount -Filter "LocalAccount='True'" |
Select PSComputername, Name, Status, Disabled, AccountType, Lockout, PasswordRequired, PasswordChangeable, SID | Export-csv C:\local_users.csv -NoTypeInformation
Comments
Post a Comment