This PowerShell script automates the process of creating and configuring a Microsoft Entra ID application registration for Moodle integration.
- PowerShell 7.5 or later on any supported platform (Windows, MacOS, Linux)
- Administrator access to your Microsoft Entra ID tenant
- A Moodle server with HTTPS enabled
- Download and extract the
Moodle-EntraID-PowerShell.zip
file. - Open the extracted folder, which contains the script files:
Moodle-EntraID-Script.ps1
Json/permissions.json
Json/EntraIDOptionalClaims.json
Assets/moodle-logo.jpg
-
Open PowerShell 7
-
Navigate to the directory containing the script
-
Run the script:
./Moodle-EntraID-Script.ps1
-
Follow the prompts:
- Enter a name for your Microsoft Entra ID application
- Enter your Moodle server URL (must start with https://)
- Choose whether to grant admin consent
-
The script will output your Application (Client) ID and Client Secret. Save these credentials securely as they will be needed for Moodle configuration.
- Creates a Microsoft Entra ID application registration
- Configures required API permissions
- Sets up authentication URLs
- Configures optional claims
- Adds Teams integration support
- Sets up front-channel logout URL
- Grants admin consent for required permissions
- Generates a client secret
- Sets application logo
- If you get permission errors, make sure you have administrator rights in your Microsoft Entra ID tenant
- If the script fails, you can safely run it again
- Make sure all required files are present in their correct locations
- Store the generated client secret securely
- Only run this script while connected to a trusted network
- Use the generated credentials only for your Moodle configuration
For issues with:
- The script: Please report issues to the repository
- Microsoft Entra ID: Contact Microsoft Support
- Moodle integration: Refer to the Moodle documentation
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
© Microsoft, Inc. Code for this script is licensed under the GPLv3 license.
Any Microsoft trademarks and logos included in these plugins are property of Microsoft and should not be reused, redistributed, modified, repurposed, or otherwise altered or used outside of this plugin.