Added 'list-local-groups-and-users.ps1'
This commit is contained in:
parent
be45a35893
commit
8a896fc940
1 changed files with 11 additions and 0 deletions
11
list-local-groups-and-users.ps1
Normal file
11
list-local-groups-and-users.ps1
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
$FormatEnumerationLimit=-1
|
||||||
|
$grouplist = get-localgroup
|
||||||
|
$array = @()
|
||||||
|
foreach ($G in $grouplist){ `
|
||||||
|
$line = new-object psobject; `
|
||||||
|
$line | add-member -membertype noteproperty -Name 'Group Name' -Value $G.Name; `
|
||||||
|
$user = get-localgroupmember -name $G.Name | Select-Object -Property Name; `
|
||||||
|
$line | add-member -membertype noteproperty -Name 'User' -Value $user.Name; `
|
||||||
|
$array += $line`
|
||||||
|
}
|
||||||
|
$array | ft -wrap -autosize
|
Loading…
Reference in a new issue