Microsoft PowerShell
PowerShell was originally developed by Microsoft and has become an extremely powerful scripting and shell language for system administration since it was first released. Thanks to its platform independence, PowerShell is no longer limited to Windows, but also runs on macOS and Linux. This wide availability increases both versatility and popularity among administrators and developers.
Especially in Microsoft 365 administration, PowerShell can be used excellently to automate recurring tasks and efficiently manage complex scenarios. Here are some basic PowerShell commands that can be especially helpful when working with Microsoft 365.

MS365 | Azure – PowerShell
On-Premise PowerShell

An overview
Get-Help
- How it works:
- The command
Get-Helpis your guide to the world of PowerShell. It provides detailed information about PowerShell commands, including their syntax, parameters, and examples.
- The command
- Application:
- To get help with a specific command, simply
Get-Helptype followed by the command name, e.g.Get-Help Get-Process.
- To get help with a specific command, simply
- Extended use:
- You can also
Get-Helpuse parameters such as-Examples,-Detailed-Full, or-Onlineto get more specific information.
- You can also
Set-ExecutionPolicy
- How it works:
- Use
Set-ExecutionPolicyto specify which PowerShell scripts are allowed to run on your system. This is an important command to ensure the security of your system.
- Use
- Application:
- To change the execution policy, use
Set-ExecutionPolicy, followed by the desired policy, for exampleSet-ExecutionPolicy RemoteSigned.
- To change the execution policy, use
- Policy options:
- Common guidelines include
Restricted,AllSigned,RemoteSignedandUnrestricted. Each has its own security levels and use cases.
- Common guidelines include
Get-Command
- How it works:
Get-Commandlists all available commands in PowerShell. This is especially useful for discovering new commands or finding existing commands.
- Application:
- Just
Get-Commandtype to get a list of all commands. You can also specify specific patterns or modulesGet-Command -Module MicrosoftTeams, such as .
- Just
- Advanced search:
- You can also use
Get-Commandto search for commands that contain specific words, suchGet-Command *Item*as , to see all commands that have “Item” in their name.
- You can also use
[COMMAND] -WhatIf
- How it works:
- When you
-WhatIfattach to a command, PowerShell shows what would happen if the command was executed without actually executing it. - For example, suppose you want to delete a directory, but you’re not sure if the command works as expected. You can
Remove-Item -Path C:\MeinVerzeichnis -WhatIfuse to see what would happen if the directory was deleted.
- When you
- Application:
- Before running potentially dangerous commands such as
Remove-Item,Stop-Serviceor changes to system settings.
- Before running potentially dangerous commands such as
- Important:
- Not all PowerShell commands support the
-WhatIfparameter. It is important toGet-Helpuse to check if the parameter is available for a particular command.
- Not all PowerShell commands support the


