mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-22 07:53:21 +01:00
Added list-user-groups.ps1
This commit is contained in:
parent
56136da290
commit
8ba4c8887c
@ -46,6 +46,7 @@ list-random-passwords.ps1, prints a list of random passwords
|
||||
list-random-pins.ps1, prints a list of random PIN's
|
||||
list-scripts.ps1, lists the PowerShell scripts in this repository
|
||||
list-timezones.ps1, lists all time zones available
|
||||
list-user-groups.ps1, lists all user groups
|
||||
locate-city.ps1, prints the geographic location of the given city
|
||||
locate-ipaddress.ps1, prints the geographic location of the given IP address
|
||||
locate-zip-code.ps1, prints the geographic location of the given zip-code
|
||||
|
|
@ -54,6 +54,7 @@ The following PowerShell scripts can be found in the [Scripts/](Scripts/) subfol
|
||||
* [list-random-pins.ps1](Scripts/list-random-pins.ps1) - prints a list of random PIN's
|
||||
* [list-scripts.ps1](Scripts/list-scripts.ps1) - lists the PowerShell scripts in this repository
|
||||
* [list-timezones.ps1](Scripts/list-timezones.ps1) - lists all time zones available
|
||||
* [list-user-groups.ps1](Scripts/list-user-groups.ps1) - lists all user groups
|
||||
* [locate-city.ps1](Scripts/locate-city.ps1) - prints the geographic location of the given city
|
||||
* [locate-ipaddress.ps1](Scripts/locate-ipaddress.ps1) - prints the geographic location of the given IP address
|
||||
* [locate-zip-code.ps1](Scripts/locate-zip-code.ps1) - prints the geographic location of the given zip-code
|
||||
|
16
Scripts/list-user-groups.ps1
Executable file
16
Scripts/list-user-groups.ps1
Executable file
@ -0,0 +1,16 @@
|
||||
#!/snap/bin/powershell
|
||||
<#
|
||||
.SYNTAX ./list-user-groups.ps1
|
||||
.DESCRIPTION lists all user groups
|
||||
.LINK https://github.com/fleschutz/PowerShell
|
||||
.NOTES Author: Markus Fleschutz / License: CC0
|
||||
#>
|
||||
|
||||
try {
|
||||
Get-LocalGroup
|
||||
Get-LocalGroupMember -name users
|
||||
exit 0
|
||||
} catch {
|
||||
write-error "ERROR in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
Loading…
Reference in New Issue
Block a user