# icaclsView and change permissions
Syntax icacls path [options]
> icacls C:\DataCMD Copy
Show who may do what
> icacls C:\Data /grant Alice:(OI)(CI)MCMD Copy
Give Alice Modify rights to the folder and everything in it
> icacls C:\Data /remove BobCMD Copy
Remove Bob's entries
> icacls C:\Data /reset /TCMD Copy
Reset to inherited permissions for everything inside
Tip Letters: F = full, M = modify, RX = read and run, R = read.
# takeownTake ownership
Syntax takeown /F path
# whoamiWho am I?
Syntax whoami [/groups] [/priv]
> whoamiCMD Copy
Show DOMAIN\user
> whoami /groupsCMD Copy
The groups you belong to
> whoami /privCMD Copy
Your privileges
# runasRun as another user
Syntax runas /user:name program
> runas /user:Administrator cmdCMD Copy
Open a window as Administrator
PS> Start-Process powershell -Verb RunAsPowerShell Copy
Open an elevated PowerShell (asks for approval)
Tip To open a CMD or PowerShell window as administrator, right-click it in the Start menu and choose Run as administrator.
# net userManage accounts
Syntax net user [name] [password] [/add]
> net userCMD Copy
List accounts
> net user Alice * /addCMD Copy
Add an account and type the password when asked
> net localgroup Administrators Alice /addCMD Copy
Make Alice an administrator
> net user Alice /active:noCMD Copy
Disable the account
PS> Get-LocalUserPowerShell Copy
Account list in PowerShell
# gpresult / gpupdateGroup Policy
Syntax gpresult /r