Cheatsheet

November 4, 2025 ยท View on GitHub

Cheatsheet of offensive PowerShell commands that are supported by NoPowerShell.

ActionCommand
List all properties of the Administrator domain userGet-ADUser -Identity Administrator -Properties *
List all Administrative users in domainGet-ADUser -LDAPFilter "(admincount=1)"
List all users in domainGet-ADUser -Filter *
List specific attributes of userGet-ADUser -Identity Administrator -Properties SamAccountName,ObjectSID
List all users in a specific OUGet-ADUser -SearchBase "CN=Users,DC=MyDomain,DC=local" -Filter *
Get the sites from the configuration naming contextGet-ADObject -LDAPFilter "(objectClass=site)" -SearchBase "CN=Configuration,DC=MyDomain,DC=local" -Properties whenCreated,cn
Get specific objectGet-ADObject -Identity "CN=Directory Service,CN=Windows NT,CN=Services,CN=Configuration,DC=MyDomain,DC=local" -Properties *
List all global groupsGet-ADObject -LDAPFilter "(GroupType:1.2.840.113556.1.4.803:=2)" -SearchBase "DC=MyDomain,DC=local"
List only users that are directly in the OU (not in sub-OUs)Get-ADObject -SearchBase "CN=Users,DC=MyDomain,DC=local" -LDAPFilter "(objectClass=user)" -SearchScope OneLevel
Obtain distinguishedname of domainGet-ADObject -LDAPFilter "(objectClass=*)" -SearchScope Base -Server MyServer
Get all subnetsGet-ADReplicationSubnet
Get subnets with a specified nameGet-ADReplicationSubnet -Identity "10.0.10.0/24"
Get the properties of a specified subnetGet-ADReplicationSubnet -Identity "10.0.10.0/24" -Properties *
List all user groups in domainGet-ADGroup -Filter *
List all administrative groups in domainGet-ADGroup -LDAPFilter "(admincount=1)" | select Name
List all members of the "Domain Admins" groupGet-ADGroupMember -Identity "Domain Admins"
List all members of the "Domain Admins" group - AlternativeGet-ADGroupMember "Domain Admins"
List all properties of the DC1 domain computerGet-ADComputer -Identity DC1 -Properties *
List all Domain ControllersGet-ADComputer -LDAPFilter "(msDFSR-ComputerReferenceBL=*)"
List all computers in domainGet-ADComputer -Filter *
List domain controllersGet-ADComputer -searchBase "OU=Domain Controllers,DC=mydomain,DC=local" -Filter *
List specific attributes of the DC1 domain computerGet-ADComputer -Identity DC1 -Properties Name,operatingSystem
List domain controllersGet-ADDomainController
List all domain controllers, including read-only onesGet-ADDomainController -Filter *
List all direct trustsGet-ADTrust -Filter *
List trusts recursively till depth 3Get-ADTrust -Filter * -Depth 3
List all details of a certain trustGet-ADTrust -LDAPFilter "(Name=mydomain.com)"
List specific details of a certain trustGet-ADTrust -LDAPFilter "(Name=mydomain.com)" -Properties Name,trustDirection,securityIdentifier
Copy ACL from file to another fileCopy-Acl C:\Data\file.txt C:\Data\destination.txt
Recursively copy ACLs from source to destination folderCopy-Acl -Recurse -Path C:\SourceDir -Destination C:\DestinationDir
List local SMB sharesGet-RemoteSmbShare
List SMB shares of MyServerGet-RemoteSmbShare \\MyServer
List DNS zonesGet-ADObject -SearchBase "CN=MicrosoftDNS,DC=DomainDnsZones,DC=AD,DC=bitsadmin,DC=com" -LDAPFilter "(ObjectClass=dnsZone)" -SearchScope OneLevel
Obtain IP address of host W11Resolve-AdiDnsName -ZoneName ad.bitsadmin.com -Name W11
Obtain LDAP servers in domainResolve-AdiDnsName -ZoneName ad.bitsadmin.com -Name _ldap._tcp
Show the current userwhoami
List groups the current user is member ofwhoami -Groups
Query sessions on local machineGet-WinStation
Query sessions on a remote machineGet-WinStation -Server MyServer
Query sessions on a remote machine - Alternativeqwinsta MyServer
Compress folder to zipCompress-Archive -Path C:\MyFolder -DestinationPath C:\MyFolder.zip
Compress folder to zip - Alternativezip C:\MyFolder C:\MyFolder.zip
Extract zipExpand-Archive -Path C:\MyArchive.zip -DestinationPath C:\Extracted
Extract zip - Alternativeunzip C:\MyArchive.zip C:\Extracted
Extract zip into current directoryunzip C:\MyArchive.zip
Get help for a commandGet-Help -Name Get-Process
Get help for a command - Alternativeman ps
List all commands supported by NoPowerShellGet-Command
List commands of a certain moduleGet-Command -Module ActiveDirectory
List all processes containing PowerShell in the process nameGet-Process | ? Name -Like *PowerShell*
List local drivesGet-PSDrive | ? Provider -EQ FileSystem
Resolve domain nameResolve-DnsName microsoft.com
Resolve domain name - Alternativehost linux.org
Lookup specific recordResolve-DnsName -Type MX pm.me
Reverse DNS lookupResolve-DnsName 1.1.1.1
List members of the Administrators groupGet-LocalGroupMember -Group Administrators
List all local groupsGet-LocalGroup
List details of a specific groupGet-LocalGroup Administrators
List members of Administrators group on a remote computer using WMIGet-LocalGroup -ComputerName Myserver -Username MyUser -Password MyPassword -Name Administrators
List members of Administrators group on a remote computer using WMI - AlternativeGet-LocalGroup -ComputerName Myserver -Name Administrators
Put string on clipboardSet-Clipboard -Value "You have been PWNED!"
Put string on clipboard - Alternativescb "You have been PWNED!"
Clear the clipboardSet-Clipboard ""
Place output of command on clipboardGet-Process | Set-Clipboard
List drivesGet-PSDrive
List drives - Alternativegdr
Get all hotfixes on the local computerGet-HotFix
Get all hotfixes from a remote computer using WMIGet-HotFix -ComputerName MyServer -Username MyUser -Password MyPassword
Get all hotfixes from a remote computer using WMI - AlternativeGet-HotFix -ComputerName MyServer
Gracefully stop processesStop-Process -Id 4512,7241
Kill processStop-Process -Force -Id 4512
Kill all cmd.exe processesGet-Process cmd | Stop-Process -Force
Locate KeePass files in the C:\Users\ directoryGet-ChildItem -Recurse -Force C:\Users\ -Include *.kdbx
Locate KeePass files in the C:\Users\ directory - Alternativels -Recurse -Force C:\Users\ -Include *.kdbx
List autorunsls HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
Search for files which can contain sensitive data on the C-drivels -Recurse -Force C:\ -Include *.cmd,*.bat,*.ps1,*.psm1,*.psd1
Create directory listing of SYSVOLls -Recurse -FollowSymlinks \\DC1\SYSVOL
Directory listing using LiteralPathGet-ChildItem -Recurse -LiteralPath \\?\C:\SomeVeryLongPath\ -Include *.pem
Copy file from one location to anotherCopy-Item C:\Tmp\nc.exe C:\Windows\System32\nc.exe
Copy file from one location to another - Alternativecopy C:\Tmp\nc.exe C:\Windows\System32\nc.exe
Copy foldercopy C:\Tmp\MyFolder C:\Tmp\MyFolderBackup
Launch processInvoke-WmiMethod -Class Win32_Process -Name Create "cmd /c calc.exe"
Launch process on remote systemInvoke-WmiMethod -ComputerName MyServer -Username MyUser -Password MyPassword -Class Win32_Process -Name Create "powershell -NoP -W H -E ZQBjAGgAbwAgACcASABlAGwAbABvACAATgBvAFAAbwB3AGUAcgBTAGgAZQBsAGwAIQAnAA=="
Launch process on remote system - Alternativeiwmi -ComputerName MyServer -Class Win32_Process -Name Create "powershell -NoP -W H -E ZQBjAGgAbwAgACcASABlAGwAbABvACAATgBvAFAAbwB3AGUAcgBTAGgAZQBsAGwAIQAnAA=="
Delete a fileRemove-Item C:\tmp\MyFile.txt
Delete a file - Alternativerm C:\tmp\MyFile.txt
Delete a read-only fileRemove-Item -Force C:\Tmp\MyFile.txt
Recursively delete a folderRemove-Item -Recurse C:\Tmp\MyTools\
Show current user's PATH variableGet-ItemPropertyValue -Path HKCU:\Environment -Name Path
Show current user's PATH variable - Alternativegpv HKCU:\Environment Path
List autoruns in the registryGet-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Run | ft
Show information about the systemGet-ComputerInfo
Show information about the system - Alternativesysteminfo
Show information about the system not listing patchessysteminfo -Simple
Show information about a remote machine using WMIGet-ComputerInfo -ComputerName MyServer -Username MyUser -Password MyPassword
Show information about a remote machine using WMI - AlternativeGet-ComputerInfo -ComputerName MyServer
List cached DNS entries on the local computerGet-DnsClientCache
List cached DNS entries from a remote computer using WMIGet-DnsClientCache -ComputerName MyServer -Username MyUser -Password MyPassword
List cached DNS entries from a remote computer using WMI - AlternativeGet-DnsClientCache -ComputerName MyServer
List processesGet-Process
List processes - Alternativeps
List processes on remote host using WMIGet-Process -ComputerName MyServer -Username MyUser -Password MyPassword
List processes on remote host using WMI - Alternativeps -ComputerName MyServer
List local sharesGet-WmiObject -Namespace ROOT\CIMV2 -Query "Select * From Win32_Share Where Name LIKE '%$'"
List local shares - Alternativegwmi -Class Win32_Share -Filter "Name LIKE '%$'"
Obtain data of Win32_Process class from a remote system and apply a filter on the outputGet-WmiObject "Select ProcessId,Name,CommandLine From Win32_Process" -ComputerName MyServer -Username MyUser -Password MyPassword | ? Name -Like *PowerShell* | select ProcessId,CommandLine
Obtain data of Win32_Process class from a remote system and apply a filter on the output - Alternativegwmi "Select ProcessId,Name,CommandLine From Win32_Process" -ComputerName MyServer | ? Name -Like *PowerShell* | select ProcessId,CommandLine
View details about a certain serviceGet-WmiObject -Class Win32_Service -Filter "Name = 'WinRM'"
List installed antivirus products (on non-server OS)Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct
Show text contents of clipboardGet-Clipboard
Show text contents of clipboard - Alternativegcb
View contents of a fileGet-Content C:\Windows\WindowsUpdate.log
View contents of a file - Alternativecat C:\Windows\WindowsUpdate.log
Send ICMP request to hostTest-NetConnection 1.1.1.1
Send ICMP request to host - Alternativetnc 1.1.1.1
Send 2 ICMP requests to IP address 1.1.1.1 with half a second of timeoutTest-NetConnection -Count 2 -Timeout 500 1.1.1.1
Perform a traceroute with a timeout of 1 second and a maximum of 20 hopsTest-NetConnection -TraceRoute -Timeout 1000 -Hops 20 bitsadmin.com
Perform ping with maximum TTL specifiedping -TTL 32 1.1.1.1
Check for open porttnc bitsadmin.com -Port 80
Show TCP connections on the local machineGet-NetTCPConnection
Show TCP connections on the local machine - Alternativenetstat
Show TCP connections on a remote machineGet-NetTCPConnection -ComputerName MyServer
List ARP table entriesGet-NetNeighbor
List ARP table entries - Alternativearp
Show the IP routing tableGet-NetRoute
Show the IP routing table - Alternativeroute
Show the IP routing table on a remote machine using WMIGet-NetRoute -ComputerName MyServer -Username MyUser -Password MyPassword
Show the IP routing table on a remote machine using WMI - Alternativeroute -ComputerName MyServer
Show network interfacesGet-NetIPAddress
Show network interfaces - Alternativeipconfig
Show network interfaces - Alternativeifconfig
Show all network interfacesGet-NetIPAddress -All
Show all network interfaces - Alternativeipconfig -All
Show all network interfaces on a remote machine using WMIGet-NetIPAddress -All -ComputerName MyServer -Username MyUser -Password MyPassword
Show all network interfaces on a remote machine using WMI - AlternativeGet-NetIPAddress -All -ComputerName MyServer
Get all services on the local computerGet-Service
Get a specific service by nameGet-Service -Name wuauserv
Get services by display nameGet-Service -DisplayName "Windows Update"
Get services on a remote computerGet-Service -ComputerName MyServer
Filter services using Include and ExcludeGet-Service -Include "Win"
Filter services using Include and Exclude - AlternativeGet-Service -Exclude "WinRM"
Gets all the local user accounts on the computerGet-LocalUser | select Name,Enabled,Description
Gets the local user account with the name AdministratorGet-LocalUser -Name Administrator
Gets all the local user accounts that match the name patternGet-LocalUser -Name Admin* | fl
Gets the local user account that has the specified SIDGet-LocalUser -SID S-1-5-21-222222222-3333333333-4444444444-5555
Gets all the local user accounts on a remote computerGet-LocalUser -ComputerName MyServer | select Name,Enabled,Description
Gets all the local user accounts on a remote computer using WMI instead of Netapi32!NetUserEnumGet-LocalUser -UseWMI -ComputerName MyServer -Username LabAdmin -Password Password1!
List oldest 10 events of Application logGet-WinEvent -LogName Application -MaxEvents 10 -Oldest
Determine the IP address from where a specific user is authenticating to the DCGet-WinEvent -LogName Security -FilterXPath "*[System[(EventID=4624)]] and *[EventData[Data[@Name='TargetUserName']='bitsadmin']]" -ComputerName MyServer -MaxEvents 1
Create basic shortcutNew-Shortcut -Path C:\Users\Public\Desktop\Notepad.lnk -TargetPath C:\Windows\notepad.exe
Create advanced shortcutNew-Shortcut -Path "C:\Users\User1\Desktop\Microsoft Edge.lnk" -TargetPath C:\Windows\System32\cmd.exe -Arguments "/C echo PWNED>pwned.txt" -IconLocation "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe,0" -WorkingDirectory "%~dp0" -WindowStyle Minimized -Hotkey "Ctrl+Shift+C" -Force
List ACLs of fileGet-Acl C:\Windows\explorer.exe
List ACLs of file - AlternativeGet-Acl -Path C:\Windows\explorer.exe
List ACLs of directoryGet-Acl C:\Windows
List ACLs of AD ObjectGet-Acl "AD:\CN=User One,CN=Users,DC=ad,DC=bitsadmin,DC=com"
List mapped network drivesGet-SmbMapping
List mapped network drives - Alternativenetuse
List SMB shares on the computerGet-SmbShare
List local SQL Server versionInvoke-Sqlcmd -Query "SELECT @@version"
Query specific serverInvoke-Sqlcmd -Query "SELECT username,password FROM users" -ServerInstance SQL1
Use explicit authenticationInvoke-Sqlcmd -Query "exec xp_cmdshell 'dir C:\'" -ServerInstance SQL1 -Username sa -password Password1!
Use encrypted connectionInvoke-Sqlcmd -Query "INSERT INTO logins (username,password) VALUES ('newuser', 'MyPass')" -ServerInstance SQL1 -Database CRM -EncryptConnection
Use connectionstring to named pipeInvoke-Sqlcmd -Query "SELECT * FROM transactions LIMIT 10'" -ConnectionString "Server=\\.\pipe\sql\query; Database=Sales; Integrated Security=True;"
Calculate commonly used hashes (MD5,SHA1,SHA256) for fileGet-FileHash C:\Windows\explorer.exe
Calculate commonly used hashes (MD5,SHA1,SHA256) for file - AlternativeGet-FileHash -Path C:\Windows\explorer.exe -Algorithm common
Calculate SHA256 hash of a fileGet-FileHash -Path C:\Windows\explorer.exe -Algorithm SHA256
Calculate specific hashes for fileGet-FileHash C:\file.bin -Algorithm MD5,SHA1
Calculate all supported hashes (MD5,SHA1,SHA256,SHA384,SHA512,RIPEMD160) for fileGet-FileHash C:\file.bin -Algorithm *
Convert Active Directory SDDL (nTSecurityDescriptor) to readable format' commandConvertFrom-SddlString "D:(A;;CR;;;S-1-5-21-2137271609-6538894-3613171323-1144)" -Type ActiveDirectoryRights
Convert filesystem SDDL to readable formatConvertFrom-SddlString "O:BAG:BAD:(A;;FA;;;BA)(A;;0x1200a9;;;SY)"
Convert filesystem SDDL to readable format - AlternativeConvertFrom-SddlString "O:BAG:BAD:(A;;FA;;;BA)(A;;0x1200a9;;;SY)" -Type FileSystemrights
Sort processes by name descendingps | sort -d name
Count number of resultsGet-Process | Measure-Object
Count number of results - AlternativeGet-Process | measure
Count number of lines in filegc C:\Windows\WindowsUpdate.log | measure
View external IP address using custom user agentiwr ifconfig.io/ip -UserAgent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36 Edg/142.0.0.0"
View external IP using explicit proxyInvoke-WebRequest https://ifconfig.io/ip -Proxy http://proxy:8080
Download file from the Internet to diskwget https://live.sysinternals.com/psexec.exe -OutFile C:\Tmp\psexec.exe
Perform request ignoring invalid TLS certificatesiwr https://74.242.189.11/about_this_site.txt -SkipCertificateCheck
Show certificate chain detailsInvoke-WebRequest -Verbose -SkipCertificateCheck https://74.242.189.11/about_this_site.txt
Show only the Name in a file listingls C:\ | select Name
Show first 10 results of file listingls C:\Windows\System32 -Include *.exe | select -First 10 Name,Length
Create file hello.txt on the C: drive containing the "Hello World!" ASCII stringWrite-Output "Hello World!" | Out-File -Encoding ASCII C:\hello.txt
Create file hello.txt on the C: drive containing the "Hello World!" ASCII string - Alternativeecho "Hello World!" | Out-File -Encoding ASCII C:\hello.txt
Create file with newlinesecho "@echo offrnecho Hello World!" | Out-File -Encoding ASCII C:\hello.cmd
Format output as a tableGet-Process | Format-Table
Format output as a table - AlternativeGet-Process | ft
Format output as a table showing only specific attributesGet-Process | ft ProcessId,Name
Format output as a listGet-LocalUser | Format-List
Format output as a list - AlternativeGet-LocalUser | fl
Format output as a list showing only specific attributesGet-LocalUser | fl Name,Description
Store list of commands as CSVGet-Command | Export-Csv -Encoding ASCII -Path commands.csv
Display process list as CSVGet-Process | ConvertTo-Csv
Use tab delimiterGet-Process | ConvertTo-Csv -Delimiter "t"`
Echo string to the consoleWrite-Output "Hello World!"
Echo string to the console - Alternativeecho "Hello World!"
Echo string with escaped charactersWrite-Output "backtick: ``; tab: t; lf: ncr: rrc"`