Added list-user-groups.ps1

This commit is contained in:
Markus Fleschutz 2021-02-06 12:43:04 +01:00
parent 56136da290
commit 8ba4c8887c
3 changed files with 18 additions and 0 deletions

View File

@ -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-random-pins.ps1, prints a list of random PIN's
list-scripts.ps1, lists the PowerShell scripts in this repository list-scripts.ps1, lists the PowerShell scripts in this repository
list-timezones.ps1, lists all time zones available 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-city.ps1, prints the geographic location of the given city
locate-ipaddress.ps1, prints the geographic location of the given IP address 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 locate-zip-code.ps1, prints the geographic location of the given zip-code

1 Filename Description
46 list-random-pins.ps1 prints a list of random PIN's
47 list-scripts.ps1 lists the PowerShell scripts in this repository
48 list-timezones.ps1 lists all time zones available
49 list-user-groups.ps1 lists all user groups
50 locate-city.ps1 prints the geographic location of the given city
51 locate-ipaddress.ps1 prints the geographic location of the given IP address
52 locate-zip-code.ps1 prints the geographic location of the given zip-code

View File

@ -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-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-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-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-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-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 * [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
View 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
}