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

Comments

Popular posts from this blog

altiris software key

Service Principal Names (SPNs) SetSPN Syntax (Setspn.exe)

Troubleshooting Netlogon Error Codes