A comprehensive cheatsheet for Microsoft-related commands across Windows, PowerShell, Azure, Office 365, and more.
This repository includes PowerShell scripts for some specific Microsoft tasks:
- Teams: Scripts for generating and distributing Microsoft Teams background images.
See our Teams README TEAMS.md - Install-Printer: PowerShell guide for installing printers and extracting the
.infdriver file from vendor packages.
See our README Prt.md
Refer to individual script folders for usage instructions.
systeminfo- Display detailed configuration information about a computerhostname- Display the name of the current hostwhoami- Display the current user namever- Display the Windows versionwmic os get caption- Get OS caption via WMIC
dir- List the contents of a directorycdorchdir- Change the current directorymdormkdir- Create a new directoryrdorrmdir- Remove a directorycopy- Copy filesmove- Move files or rename themdelorerase- Delete filesrenorrename- Rename filestype- Display the contents of a text filefind- Search for text in filesfindstr- Search for strings in files
ipconfig- Display IP configurationipconfig /all- Display detailed IP configurationping- Test connectivity to a hosttracert- Trace the route to a hostnetstat- Display network statisticsnslookup- Query DNS for domain informationnet view- Display a list of computers in the networknet use- Connect to or disconnect from a shared resource
net user- Manage user accountsnet localgroup- Manage local groupsnet accounts- Manage password and logon requirements
sc query- Query service statussc start- Start a servicesc stop- Stop a servicetasklist- Display a list of running processestaskkill- Terminate processes
diskpart- Disk partitioning utilitychkdsk- Check disk for errorsformat- Format a diskdefrag- Defragment a disk
Get-Help- Display help informationGet-Command- Get all commandsGet-Module- Get installed modules
Get-ChildItem(alias:ls,dir) - Get items in a locationSet-Location(alias:cd) - Set the current working locationNew-Item- Create a new itemCopy-Item(alias:cp,copy) - Copy an itemMove-Item(alias:mv,move) - Move an itemRemove-Item(alias:rm,del) - Remove an itemRename-Item(alias:ren) - Rename an item
Get-Process(alias:ps) - Get processesStop-Process(alias:kill) - Stop processesGet-Service- Get servicesStart-Service- Start a serviceStop-Service- Stop a serviceRestart-Service- Restart a serviceGet-EventLog- Get event log data
Test-Connection(alias:ping) - Test connectivityGet-NetAdapter- Get network adaptersGet-NetIPAddress- Get IP address configurationSet-NetIPAddress- Modify IP address configurationGet-NetRoute- Get IP route informationNew-NetFirewallRule- Create a new firewall rule
Get-LocalUser- Get local user accountsNew-LocalUser- Create a local user accountSet-LocalUser- Modify a local user accountGet-LocalGroup- Get local groupsAdd-LocalGroupMember- Add a member to a local group
Get-ItemProperty- Get registry key propertiesSet-ItemProperty- Set registry key propertiesNew-Item- Create a new registry key
az login- Log in to Azureaz account list- List subscriptionsaz account set- Set active subscription
az group list- List resource groupsaz group create- Create a resource groupaz group delete- Delete a resource group
az vm list- List VMsaz vm create- Create a VMaz vm start- Start a VMaz vm stop- Stop a VMaz vm delete- Delete a VM
az storage account list- List storage accountsaz storage account create- Create a storage accountaz storage blob list- List blobsaz storage blob upload- Upload a blob
az network vnet list- List virtual networksaz network public-ip list- List public IP addresses
Connect-ExchangeOnline- Connect to Exchange OnlineGet-Mailbox- Get mailbox informationGet-User- Get user informationNew-Mailbox- Create a new mailboxSet-Mailbox- Modify mailbox settings
Connect-SPOService- Connect to SharePoint OnlineGet-SPOSite- Get site collectionsGet-SPOWeb- Get subsitesNew-SPOSite- Create a new site collection
Connect-MicrosoftTeams- Connect to Microsoft TeamsGet-Team- Get teamsNew-Team- Create a new teamAdd-TeamUser- Add a user to a team
dsquery user- Query usersdsadd user- Add a userdsmod user- Modify a userdsrm user- Remove a user
Get-ADUser- Get Active Directory usersNew-ADUser- Create a new AD userSet-ADUser- Modify an AD userGet-ADGroup- Get AD groupsAdd-ADGroupMember- Add a member to an AD group
sqlcmd -S server -U user -P password -Q "query"- Execute a query
Invoke-Sqlcmd- Run a SQL script
Ctrl+Shift+P- Open command palettecode .- Open current directory in VS Codecode filename- Open file in VS Code
Feel free to contribute additional commands or corrections via pull requests.