Skip to content

AADAgreement

Parameters

Parameter Attribute DataType Description Allowed Values
DisplayName Key String The display name of the agreement.
Id Write String The unique identifier of the agreement.
IsViewingBeforeAcceptanceRequired Write Boolean Whether the user is required to view the agreement document before accepting.
IsPerDeviceAcceptanceRequired Write Boolean Whether the agreement is per device or per user.
UserReacceptRequiredFrequency Write String Duration after which the user must re-accept the terms of use. Must be in ISO 8601 duration format.
FileData Write String The content of the agreement file.
FileName Write String The name of the agreement file.
Language Write String The language of the agreement file.
TermsExpiration Write MSFT_TermsExpiration Expiration schedule and frequency of the agreement for all users.
Ensure Write String Specify if the agreement should exist or not. Present, Absent
Credential Write PSCredential Credentials of the workload's Admin
ApplicationId Write String Id of the Azure Active Directory application to authenticate with.
TenantId Write String Id of the Azure Active Directory tenant used for authentication.
ApplicationSecret Write PSCredential Secret of the Azure Active Directory application to authenticate with.
CertificateThumbprint Write String Thumbprint of the Azure Active Directory application's authentication certificate to use for authentication.
CertificatePassword Write PSCredential Username can be made up to anything but password will be used for CertificatePassword
CertificatePath Write String Path to certificate used in service principal usually a PFX file.
ManagedIdentity Write Boolean Managed ID being used for authentication.
AccessTokens Write String[] Access token used for authentication.

Embedded Instances

MSFT_TermsExpiration

Parameters

Parameter Attribute DataType Description Allowed Values
Frequency Write String The frequency at which the agreement expires for all users after the first expiration set in StartDateTime. Must be in ISO 8601 duration format.
StartDateTime Write String The date and time on which the agreement first expires for all users.

Description

This resource configures Azure AD Terms of Use Agreements in Entra ID.

Permissions

Graph

To authenticate with the Graph API, this resource requires the following permissions:

Delegated permissions

  • Read
  • Agreement.Read.All

  • Update

  • Agreement.ReadWrite.All

Application permissions

  • Read
  • Agreement.Read.All

  • Update

  • Agreement.ReadWrite.All

Examples

Example 1

This example creates a new Azure AD Terms of Use Agreement.

Configuration Example
{
    param
    (
        [Parameter()]
        [System.String]
        $ApplicationId,

        [Parameter()]
        [System.String]
        $TenantId,

        [Parameter()]
        [System.String]
        $CertificateThumbprint
    )

    Import-DscResource -ModuleName Microsoft365DSC

    Node localhost
    {
        AADAgreement 'AADAgreement-Example'
        {
            DisplayName                       = "Company Terms of Use"
            IsViewingBeforeAcceptanceRequired = $true
            IsPerDeviceAcceptanceRequired     = $false
            UserReacceptRequiredFrequency     = "P90D"
            FileData                          = "<h1>Company Terms of Use</h1><p>These are the terms and conditions for using our company resources...</p>"
            FileName                          = "CompanyToU.html"
            Language                          = "en-US"
            TermsExpiration                   = MSFT_TermsExpiration{
                Frequency     = "P365D"
                StartDateTime = "2026-01-01T00:00:00.0000000Z"
            }
            Ensure                            = "Present"
            ApplicationId                     = $ApplicationId
            TenantId                          = $TenantId
            CertificateThumbprint             = $CertificateThumbprint
        }
    }
}

Example 2

This example creates a Terms of Use Agreement that requires re-acceptance every 30 days on each device.

Configuration Example
{
    param
    (
        [Parameter()]
        [System.String]
        $ApplicationId,

        [Parameter()]
        [System.String]
        $TenantId,

        [Parameter()]
        [System.String]
        $CertificateThumbprint
    )

    Import-DscResource -ModuleName Microsoft365DSC

    Node localhost
    {
        AADAgreement 'AADAgreement-Example'
        {
            DisplayName                       = "Company Terms of Use"
            IsViewingBeforeAcceptanceRequired = $true
            IsPerDeviceAcceptanceRequired     = $true
            UserReacceptRequiredFrequency     = "P30D"
            FileData                          = "TERMS OF USE FOR DEVICE ACCESS\n\nBy accepting these terms, you agree to comply with all company policies..."
            FileName                          = "device_terms.txt"
            Language                          = "en-US"
            TermsExpiration                   = MSFT_TermsExpiration{
                Frequency     = "P365D"
                StartDateTime = "2026-01-01T00:00:00.0000000Z"
            }
            Ensure                            = "Present"
            ApplicationId                     = $ApplicationId
            TenantId                          = $TenantId
            CertificateThumbprint             = $CertificateThumbprint
        }
    }
}

Example 3

This example removes an existing Azure AD Terms of Use Agreement.

Configuration Example
{
    param
    (
        [Parameter()]
        [System.String]
        $ApplicationId,

        [Parameter()]
        [System.String]
        $TenantId,

        [Parameter()]
        [System.String]
        $CertificateThumbprint
    )

    Import-DscResource -ModuleName Microsoft365DSC

    Node localhost
    {
        AADAgreement 'AADAgreement-Example'
        {
            DisplayName           = "Company Terms of Use"
            Ensure                = "Absent"
            ApplicationId         = $ApplicationId
            TenantId              = $TenantId
            CertificateThumbprint = $CertificateThumbprint
        }
    }
}