SPOSiteAuditSettings

Parameters

Parameter Attribute DataType Description Allowed Values
Url Key String URL of the site collection to configure.
AuditFlags Required String Audit flag for the site collection. Can be 'All' or 'None'. All, None
Credential Write PSCredential Credentials of the account to authenticate with.
ApplicationId Write String Id of the Azure Active Directory application to authenticate with.
ApplicationSecret Write String Secret of the Azure Active Directory application to authenticate with.
TenantId Write String Name of the Azure Active Directory tenant used for authentication. Format contoso.onmicrosoft.com
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.
CertificateThumbprint Write String Thumbprint of the Azure Active Directory application's authentication certificate to use for authentication.

SPOSiteAuditSettings

Description

Set Audit settings for a site.

Examples

Example 1

This example is used to test new resources and showcase the usage of new resources being worked on. It is not meant to use as a production baseline.

Configuration Example
{
    param(
        [Parameter(Mandatory = $true)]
        [PSCredential]
        $credsGlobalAdmin
    )
    Import-DscResource -ModuleName Microsoft365DSC

    node localhost
    {
        SPOSiteAuditSettings 'ConfigureSiteAuditSettings '
        {
            Url        = "https://contoso.sharepoint.com/sites/DemoSite"
            AuditFlags = "All"
            Credential = $credsGlobalAdmin
        }
    }
}