diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementConnectedOrganization/MSFT_AADEntitlementManagementConnectedOrganization.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementConnectedOrganization/MSFT_AADEntitlementManagementConnectedOrganization.psm1 index 637425e5d9..9ed76e18c4 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementConnectedOrganization/MSFT_AADEntitlementManagementConnectedOrganization.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementConnectedOrganization/MSFT_AADEntitlementManagementConnectedOrganization.psm1 @@ -147,7 +147,7 @@ function Get-TargetResource if (-not [String]::IsNullOrEmpty($source.AdditionalProperties.tenantId)) { - $formattedSource.Add('ExternalTenantId', $source.AdditionalProperties.tenantId) + $formattedSource.Add('tenantId', $source.AdditionalProperties.tenantId) } if (-not [String]::IsNullOrEmpty($source.AdditionalProperties.cloudInstance)) @@ -313,7 +313,7 @@ function Set-TargetResource $CreateParameters.$key = Convert-M365DSCDRGComplexTypeToHashtable -ComplexObject $CreateParameters.$key } } - $TenantId = $CreateParameters.IdentitySources.ExternalTenantId + $TenantId = $CreateParameters.IdentitySources.tenantId $url = $Global:MSCloudLoginConnectionProfile.MicrosoftGraph.ResourceUrl + "beta/tenantRelationships/microsoft.graph.findTenantInformationByTenantId(tenantId='$tenantid')" $DomainName = (Invoke-MgGraphRequest -Method 'GET' -Uri $url).defaultDomainName $newConnectedOrganization = New-MgBetaEntitlementManagementConnectedOrganization -Description $CreateParameters.Description -DisplayName $CreateParameters.DisplayName -State $CreateParameters.State -DomainName $DomainName diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementConnectedOrganization/MSFT_AADEntitlementManagementConnectedOrganization.schema.mof b/Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementConnectedOrganization/MSFT_AADEntitlementManagementConnectedOrganization.schema.mof index a3fab5865e..61e2c57697 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementConnectedOrganization/MSFT_AADEntitlementManagementConnectedOrganization.schema.mof +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementConnectedOrganization/MSFT_AADEntitlementManagementConnectedOrganization.schema.mof @@ -4,7 +4,7 @@ class MSFT_AADEntitlementManagementConnectedOrganizationIdentitySource { [Write, Description("Type of the identity source."), ValueMap{"#microsoft.graph.azureActiveDirectoryTenant","#microsoft.graph.crossCloudAzureActiveDirectoryTenant","#microsoft.graph.domainIdentitySource","#microsoft.graph.externalDomainFederation"}, Values{"#microsoft.graph.azureActiveDirectoryTenant","#microsoft.graph.crossCloudAzureActiveDirectoryTenant","#microsoft.graph.domainIdentitySource","#microsoft.graph.externalDomainFederation"}] String odataType; [Write, Description("The name of the Azure Active Directory tenant.")] String DisplayName; - [Write, Description("The ID of the Azure Active Directory tenant.")] String ExternalTenantId; + [Write, Description("The ID of the Azure Active Directory tenant.")] String tenantId; [Write, Description("The ID of the cloud where the tenant is located, one of microsoftonline.com, microsoftonline.us or partner.microsoftonline.cn.")] String CloudInstance; [Write, Description("The domain name.")] String DomainName; [Write, Description("The issuerURI of the incoming federation.")] String IssuerUri; diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADEntitlementManagementConnectedOrganization.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADEntitlementManagementConnectedOrganization.Tests.ps1 index 7ead2f0a36..0be74e7374 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADEntitlementManagementConnectedOrganization.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADEntitlementManagementConnectedOrganization.Tests.ps1 @@ -72,7 +72,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Id = 'ConnectedOrganization_Id' IdentitySources = @( (New-CimInstance -ClassName MSFT_AADEntitlementManagementConnectedOrganizationIdentitySource -Property @{ - ExternalTenantId = 'IdentitySource_TenantId' + tenantId = 'IdentitySource_TenantId' odataType = '#microsoft.graph.azureActiveDirectoryTenant' displayName = 'IdentitySource_DisplayName' } -ClientOnly) @@ -130,7 +130,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Id = 'ConnectedOrganization_Id' IdentitySources = @( (New-CimInstance -ClassName MSFT_AADEntitlementManagementConnectedOrganizationIdentitySource -Property @{ - ExternalTenantId = 'IdentitySource_TenantId' + tenantId = 'IdentitySource_TenantId' odataType = '#microsoft.graph.azureActiveDirectoryTenant' displayName = 'IdentitySource_DisplayName' } -ClientOnly) @@ -197,7 +197,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Id = '12345678-1234-1234-1234-123456789012' IdentitySources = @( (New-CimInstance -ClassName MSFT_AADEntitlementManagementConnectedOrganizationIdentitySource -Property @{ - ExternalTenantId = 'IdentitySource_TenantId' + tenantId = 'IdentitySource_TenantId' odataType = '#microsoft.graph.azureActiveDirectoryTenant' displayName = 'IdentitySource_DisplayName' } -ClientOnly) @@ -254,7 +254,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Id = '12345678-1234-1234-1234-123456789012' IdentitySources = @( (New-CimInstance -ClassName MSFT_AADEntitlementManagementConnectedOrganizationIdentitySource -Property @{ - ExternalTenantId = 'IdentitySource_TenantId' + tenantId = 'IdentitySource_TenantId' odataType = '#microsoft.graph.azureActiveDirectoryTenant' displayName = 'IdentitySource_DisplayName' } -ClientOnly)