mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-06-16 01:46:38 +02: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…
x
Reference in New Issue
Block a user