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, either a base64-encoded PDF or the text of a PDF starting with %PDF-. Other text is UTF-8 encoded and only accepted when the agreement is created.
FileName Write String The name of the agreement file for the language set in Language. Changing it publishes FileData as the new file of that language.
Language Write String The language of the agreement file, such as en-US.
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                          = "JVBERi0xLjQKMSAwIG9iago8PC9UeXBlL0NhdGFsb2cvUGFnZXMgMiAwIFI+PgplbmRvYmoKMiAwIG9iago8PC9UeXBlL1BhZ2VzL0tpZHNbMyAwIFJdL0NvdW50IDE+PgplbmRvYmoKMyAwIG9iago8PC9UeXBlL1BhZ2UvUGFyZW50IDIgMCBSL01lZGlhQm94WzAgMCA2MTIgNzkyXS9SZXNvdXJjZXM8PC9Gb250PDwvRjEgNCAwIFI+Pj4+L0NvbnRlbnRzIDUgMCBSPj4KZW5kb2JqCjQgMCBvYmoKPDwvVHlwZS9Gb250L1N1YnR5cGUvVHlwZTEvQmFzZUZvbnQvSGVsdmV0aWNhPj4KZW5kb2JqCjUgMCBvYmoKPDwvTGVuZ3RoIDUxPj4Kc3RyZWFtCkJUIC9GMSAxOCBUZiA3MiA3MjAgVGQgKENvbXBhbnkgVGVybXMgb2YgVXNlKSBUaiBFVAplbmRzdHJlYW0KZW5kb2JqCnhyZWYKMCA2CjAwMDAwMDAwMDAgNjU1MzUgZiAKMDAwMDAwMDAwOSAwMDAwMCBuIAowMDAwMDAwMDU0IDAwMDAwIG4gCjAwMDAwMDAxMDUgMDAwMDAgbiAKMDAwMDAwMDIxNyAwMDAwMCBuIAowMDAwMDAwMjgwIDAwMDAwIG4gCnRyYWlsZXI8PC9TaXplIDYvUm9vdCAxIDAgUj4+CnN0YXJ0eHJlZgozNzkKJSVFT0YK"
            FileName                          = "CompanyTermsOfUse.pdf"
            Language                          = "en-US"
            TermsExpiration                   = MSFT_TermsExpiration{
                Frequency     = "P365D"
                StartDateTime = "2030-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 = $false # Updated Property
            IsPerDeviceAcceptanceRequired     = $false
            UserReacceptRequiredFrequency     = "P90D"
            FileData                          = "JVBERi0xLjQKMSAwIG9iago8PC9UeXBlL0NhdGFsb2cvUGFnZXMgMiAwIFI+PgplbmRvYmoKMiAwIG9iago8PC9UeXBlL1BhZ2VzL0tpZHNbMyAwIFJdL0NvdW50IDE+PgplbmRvYmoKMyAwIG9iago8PC9UeXBlL1BhZ2UvUGFyZW50IDIgMCBSL01lZGlhQm94WzAgMCA2MTIgNzkyXS9SZXNvdXJjZXM8PC9Gb250PDwvRjEgNCAwIFI+Pj4+L0NvbnRlbnRzIDUgMCBSPj4KZW5kb2JqCjQgMCBvYmoKPDwvVHlwZS9Gb250L1N1YnR5cGUvVHlwZTEvQmFzZUZvbnQvSGVsdmV0aWNhPj4KZW5kb2JqCjUgMCBvYmoKPDwvTGVuZ3RoIDUxPj4Kc3RyZWFtCkJUIC9GMSAxOCBUZiA3MiA3MjAgVGQgKENvbXBhbnkgVGVybXMgb2YgVXNlKSBUaiBFVAplbmRzdHJlYW0KZW5kb2JqCnhyZWYKMCA2CjAwMDAwMDAwMDAgNjU1MzUgZiAKMDAwMDAwMDAwOSAwMDAwMCBuIAowMDAwMDAwMDU0IDAwMDAwIG4gCjAwMDAwMDAxMDUgMDAwMDAgbiAKMDAwMDAwMDIxNyAwMDAwMCBuIAowMDAwMDAwMjgwIDAwMDAwIG4gCnRyYWlsZXI8PC9TaXplIDYvUm9vdCAxIDAgUj4+CnN0YXJ0eHJlZgozNzkKJSVFT0YK"
            FileName                          = "CompanyTermsOfUse-v2.pdf" # Updated Property
            Language                          = "en-US"
            TermsExpiration                   = MSFT_TermsExpiration{
                Frequency     = "P365D"
                StartDateTime = "2030-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
        }
    }
}