Skip to content

O365ExternalConnection

Parameters

Parameter Attribute DataType Description Allowed Values
Name Key String The name of the external connector.
Id Write String The unique identifier of the external connector.
Description Write String The description of the external connector.
AuthorizedAppIds Write String[] A collection of application IDs for registered Microsoft Entra apps that are allowed to manage the externalConnection and to index content in the externalConnection.
ActivitySettings Write MSFT_MicrosoftGraphActivitySettings Collects configurable settings related to activities involving connector content.
ContentCategory Write String Specifies the domain category of the content associated with the external connection. This property helps Microsoft Graph optimize relevance, ranking, and semantic understanding by signaling the nature of the ingested content. For example, setting this value correctly ensures better query interpretation and improves Copilot experiences. The possible values are: uncategorized, knowledgeBase, wikis, fileRepository, qna, crm, dashboard, people, media, email, messaging, meetingTranscripts, taskManagement, learningManagement. Optional. The default value is uncategorized. uncategorized, knowledgeBase, wikis, fileRepository, qna, crm, dashboard, people, media, email, messaging, meetingTranscripts, taskManagement, learningManagement
Ensure Write String Present ensures the instance exists, absent ensures it is removed. Absent, Present
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.
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_MicrosoftGraphActivitySettings

Parameters

Parameter Attribute DataType Description Allowed Values
UrlToItemResolvers Write MSFT_MicrosoftGraphUrlToItemResolverBase[] Specifies configurations to identify an externalItem based on a shared URL.

MSFT_MicrosoftGraphUrlToItemResolverBase

Parameters

Parameter Attribute DataType Description Allowed Values
ItemId Write String Pattern that specifies how to form the ID of the external item that the URL represents. The named groups from the regular expression in urlPattern within the urlMatchInfo can be referenced by inserting the group name inside curly brackets.
Priority Write SInt32 The priority which defines the sequence in which the urlToItemResolverBase instances are evaluated.
UrlMatchInfo Write MSFT_MicrosoftGraphUrlMatchInfo Configurations to match and resolve URL.

MSFT_MicrosoftGraphUrlMatchInfo

Parameters

Parameter Attribute DataType Description Allowed Values
BaseUrls Write String[] A list of the URL prefixes that must match URLs to be processed by this URL-to-item-resolver.
UrlPattern Write String A regular expression that will be matched towards the URL that is processed by this URL-to-item-resolver. The ECMAScript specification for regular expressions (ECMA-262) is used for the evaluation. The named groups defined by the regular expression will be used later to extract values from the URL.

Description

Configures external connectors in Microsoft 365.

Permissions

Graph

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

Delegated permissions

  • Read
  • None

  • Update

  • None

Application permissions

  • Read
  • Application.Read.All, ExternalConnection.Read.All

  • Update

  • Application.Read.All, ExternalConnection.ReadWrite.All

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()]
        [System.String]
        $ApplicationId,

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

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

    Import-DscResource -ModuleName Microsoft365DSC

    Node localhost
    {
        O365ExternalConnection "O365ExternalConnection-Example"
        {
            ActivitySettings      = MSFT_MicrosoftGraphActivitySettings{
                UrlToItemResolvers = @(
                    MSFT_MicrosoftGraphUrlToItemResolverBase{
                        ItemId       = "{employeeId}"
                        Priority     = 1
                        UrlMatchInfo = MSFT_MicrosoftGraphUrlMatchInfo{
                            BaseUrls   = @("https://hr.contoso.com")
                            UrlPattern = "/employees/(?<employeeId>[0-9]+)"
                        }
                    }
                )
            };
            AuthorizedAppIds      = @("Contoso HR Connector");
            ContentCategory       = "knowledgeBase";
            Description           = "Indexes employee handbooks and policies from the Contoso HR system";
            Ensure                = "Present";
            Id                    = "contosohr";
            Name                  = "Contoso HR";
            ApplicationId         = $ApplicationId;
            TenantId              = $TenantId;
            CertificateThumbprint = $CertificateThumbprint;
        }
    }
}

Example 2

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()]
        [System.String]
        $ApplicationId,

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

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

    Import-DscResource -ModuleName Microsoft365DSC

    Node localhost
    {
        O365ExternalConnection "O365ExternalConnection-Example"
        {
            ActivitySettings      = MSFT_MicrosoftGraphActivitySettings{
                UrlToItemResolvers = @(
                    MSFT_MicrosoftGraphUrlToItemResolverBase{
                        ItemId       = "{employeeId}"
                        Priority     = 1
                        UrlMatchInfo = MSFT_MicrosoftGraphUrlMatchInfo{
                            BaseUrls   = @("https://hr.contoso.com")
                            UrlPattern = "/employees/(?<employeeId>[0-9]+)"
                        }
                    }
                )
            };
            AuthorizedAppIds      = @("Contoso HR Connector", "Contoso Knowledge Indexer"); # Updated Property
            ContentCategory       = "knowledgeBase";
            Description           = "Indexes employee handbooks and policies from the Contoso HR system";
            Ensure                = "Present";
            Id                    = "contosohr";
            Name                  = "Contoso HR";
            ApplicationId         = $ApplicationId;
            TenantId              = $TenantId;
            CertificateThumbprint = $CertificateThumbprint;
        }
    }
}

Example 3

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()]
        [System.String]
        $ApplicationId,

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

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

    Import-DscResource -ModuleName Microsoft365DSC

    Node localhost
    {
        O365ExternalConnection "O365ExternalConnection-Example"
        {
            Ensure                = "Absent";
            Name                  = "Contoso HR";
            ApplicationId         = $ApplicationId;
            TenantId              = $TenantId;
            CertificateThumbprint = $CertificateThumbprint;
        }
    }
}