Technical requirements
Before diving into the recipes, administrators must have PowerShell 5.1 or later installed on their systems. Both the command-line version and the Integrated Scripting Environment (ISE) are suitable for following along with the examples provided in this chapter. Administrators should ensure they possess valid credentials and appropriate roles, such as the Global Administrator role, to execute the tasks outlined.
For all recipes in this chapter, right-click PowerShell and select Run as administrator before you begin.
Your PowerShell script execution policy must be either remote-signed or less restrictive. Run the following to make it so:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
As a Microsoft 365 Administrator, you should install the Microsoft Graph and Microsoft Graph Beta PowerShell modules, which are compatible with PowerShell 5.1 or later, and work on Windows, macOS, and Linux platforms. Install them by running the following...