mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-22 16:03:22 +01:00
Add list-user-accounts.ps1
This commit is contained in:
parent
1a83a3032d
commit
3aefcfd2a0
20
Scripts/list-user-accounts.ps1
Normal file
20
Scripts/list-user-accounts.ps1
Normal 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
|
||||
}
|
Loading…
Reference in New Issue
Block a user