Maester - PowerShell Commands
Overview
This page lists all the commands available in the Maester PowerShell module.
The Maester PowerShell module is a collection of commands that help you write Pester tests to validate your Microsoft 365 tenant configuration. You can view the Graph API calls for these commands in the Maester GitHub repository's src folder. You can also select the Edit this page link found in the command's documentation to view the source code for the command.
See the writing Maester tests guide for more information on how to write your own tests using these commands.
Maester Commands
- Maester Commands Overview
- Add-MtMaesterAppFederatedCredentialAdds a federated credential to a Maester application for GitHub Actions authentication.
- Add-MtTestResultDetailAdd detailed information about a test so that it can be displayed in the test results report.
- Clear-MtADCacheResets the local cache of Active Directory data.
- Clear-MtDnsCacheResets the local cache of DNS lookups.
- Clear-MtExoCacheResets the local cache of Exchange Online queries.
- Clear-MtGraphCacheResets the local cache of Graph API calls.
- Compare-MtJsonObjectCompares two PowerShell objects (typically JSON objects) and returns a list of differences.
- Compare-MtTestResultCompares Maester test result JSON files
- Connect-MaesterHelper method to connect to Microsoft Graph using Connect-MgGraph with the required permission scopes as well as other services such as Azure, Exchange Online, and GitHub.
- Connect-MtGitHubEstablishes a GitHub Enterprise Cloud organization REST API session for Maester.
- Convert-MtResultsToFlatObjectConvert Maester test results to a flattened object that can be exported to CSV or Excel.
- Convert-MtTestConverts custom Pester-format Maester tests to the native format (Test.<ID>.ps1 and Test.<ID>.md).
- ConvertFrom-MailAuthenticationRecordDkimReturns structured RFC compliant object from DKIM record
- ConvertFrom-MailAuthenticationRecordDmarcReturns structured RFC compliant object for a DMARC record
- ConvertFrom-MailAuthenticationRecordMxA simple wrapper for Resolve-DnsName
- ConvertFrom-MailAuthenticationRecordSpfReturns a structured RFC compliant object for the supplied SPF record
- Disconnect-MaesterDisconnects the services connected through Connect-Maester.
- Disconnect-MtGitHubClears the current GitHub REST session in Maester.
- Get-MailAuthenticationRecordObtains and converts the mail authentication records of a domain
- Get-MtADDaclsCollects Active Directory ACLs (Access Control Lists).
- Get-MtADDomainStateCollects Active Directory domain state information.
- Get-MtADGpoStateCollects Active Directory Group Policy state information.
- Get-MtAdminPortalUrlGet the URL for the specific Microsoft admin portal based on the environment.
- Get-MtAuthenticationMethodPolicyConfigGet details of authentication methods
- Get-MtAzureManagementGroupReturns all Azure Management Groups in the tenant
- Get-MtConditionalAccessPolicyReturns all the Conditional Access policies in the tenant.
- Get-MtExoRetrieves cached response or requests from cmdlet
- Get-MtExoThreatPolicyMalwareRetrieves cached and extended (priority, enabled) of 'Get-MtExo -Request MalwareFilterPolicy'
- Get-MtGraphScopeReturns the list of Graph scopes required to run Maester.
- Get-MtGroupMemberReturns all the members of the specific group ID.
- Get-MtHtmlReportGenerates a formatted html report using the MaesterResults object created by ConvertTo-MtMaesterResult
- Get-MtLicenseInformationGet license information for a Microsoft 365 product.
- Get-MtMaesterAppRetrieves Maester applications from Azure AD/Entra ID.
- Get-MtRegistrableDomainGet the registrable domain for a given domain name.
- Get-MtRoleReturns all the role definitions in the tenant.
- Get-MtRoleMemberReturns all the members of a role.
- Get-MtSafeMarkdownEscapes text to be safe to use in markdown.
- Get-MtSessionGets the current Maester session information which includes the current Graph base uri and other details.
- Get-MtSettingReturns a setting from GlobalSettings in the Maester config.
- Get-MtSpoRetrieves SharePoint Online tenant settings via PnP with session caching.
- Get-MtTenantContextReturns the facts about the connected tenant that decide which Maester tests apply.
- Get-MtTestLists Maester native tests and their metadata without connecting to a tenant.
- Get-MtTestInventoryDiscover Pester test inventory and associated tags.
- Get-MtUserGet a list of users from the tenant
- Get-MtUserAuthenticationMethodGet the authentication methods for the specified user
- Get-MtUserAuthenticationMethodInfoByTypeReturns DisplayName and IsMfa metadata about a specific user authentication method type
- Import-MtMaesterResultImports Maester test result JSON files from disk into PowerShell objects.
- Install-MaesterTestsPrepares a folder for your own Maester tests and configuration.
- Invoke-MaesterThis is the main Maester command that runs the tests and generates a report of the results.
- Invoke-MtAzureRequestInvoke a REST API request to the Azure Management API.
- Invoke-MtAzureResourceGraphRequestInvoke a query request to the Azure Resource Graph.
- Invoke-MtGraphRequestEnhanced version of Invoke-MgGraphRequest that supports paging, batching and caching.
- Invoke-MtGraphSecurityQueryExecute KQL query in Microsoft 365 Defender Advanced Hunting by using Graph API Security endpoint to get results programmatically.
- Invoke-MtTestRuns one or more Maester native tests through the engine and returns their result rows.
- Merge-MtMaesterResultMerges multiple MaesterResults objects into a single multi-tenant result for combined HTML reporting.
- New-MtMaesterAppCreates a new Maester application in Entra ID with required permissions.
- New-MtTestCreates a new Maester native test: Test.<ID>.ps1 and Test.<ID>.md.
- Resolve-SPFRecordReturns a list of all IP addresses from an SPF record.
- Send-MtMailSend an email with the summary of the Maester test results
- Send-MtTeamsMessageSend an adaptive card in a teams channel with the summary of the Maester test results
- Test-MtConditionalAccessWhatIfTests Conditional Access evaluation with What If for a given scenario.
- Test-MtConnectionChecks if the current session is connected to the specified service.
- Update-MaesterTestsRemoves copies of the built-in Maester tests from a folder.
- Update-MtMaesterAppUpdates an existing Maester application with the latest required permissions.