Answers for "powershell determine logged in user"

1

powershell get current user

$env:UserName
Posted by: Guest on April-23-2021
0

powershell check if user is admin

$elevated = ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
Posted by: Guest on October-29-2021

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language