powershell - list local users and their groups

I'd like to have a report with all the local users and their relative groups (users, power users, administrators and so on.

I get the users in this way:

$adsi = [ADSI]"WinNT://."
$adsi.psbase.children | where {$_.psbase.schemaClassName -match "user"} | select @{n="Name";e={$_.name}}

but I don't know how to retrieve their groups. Thanks in advance.

25
задан rmtheis 22 February 2015 в 20:18
поделиться