Add list-user-accounts.ps1

This commit is contained in:
Markus Fleschutz 2022-10-25 15:58:33 +02:00
parent 1a83a3032d
commit 3aefcfd2a0

View File

@ -0,0 +1,20 @@
<#
.SYNOPSIS
Lists user accounts
.DESCRIPTION
This PowerShell script lists the user accounts on the local computer.
.EXAMPLE
PS> ./list-user-accounts
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
Author: Markus Fleschutz | License: CC0
#>
try {
net user
exit 0 # success
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}