Skip to content

Commit

Permalink
Merge pull request #1 from mlhickey/local
Browse files Browse the repository at this point in the history
Fixes #2361 - Incorrect propertyname
  • Loading branch information
mlhickey authored Oct 2, 2022
2 parents f6b495c + 6517eca commit dea57b8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
3 changes: 1 addition & 2 deletions Modules/Microsoft365DSC/Modules/M365DSCReverse.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,7 @@ function Start-M365DSCConfigurationExtract
elseif ($AuthMethods -contains 'ManagedIdentity')
{
$ConnectionMode = New-M365DSCConnection -Workload 'MicrosoftGraph' -InboundParameters @{'ManagedIdentity' = $true; 'TenantId' = $TenantId }
$TenantId = $Global:MSCloudLoginConnectionProfile.MicrosoftGraph.TenantId
$organization = $TenantId
$organization = Get-M365DSCTenantDomain -TenantId $TenantId -ManagedIdentity
}

$AzureAutomation = $false
Expand Down
20 changes: 13 additions & 7 deletions Modules/Microsoft365DSC/Modules/M365DSCUtil.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -1363,34 +1363,40 @@ Internal
#>
function Get-M365DSCTenantDomain
{
[CmdletBinding(DefaultParameterSetName = 'AppId')]
param(
[Parameter(Mandatory = $true)]
[Parameter(ParameterSetName = 'AppId', Mandatory = $true)]
[System.String]
$ApplicationId,

[Parameter(Mandatory = $true)]
[System.String]
$TenantId,

[Parameter()]
[Parameter(ParameterSetName = 'AppId')]
[System.String]
$ApplicationSecret,

[Parameter()]
[Parameter(ParameterSetName = 'AppId')]
[System.String]
$CertificateThumbprint,

[Parameter()]
[Parameter(ParameterSetName = 'AppId')]
[System.String]
$CertificatePath
$CertificatePath,

[Parameter(ParameterSetName = 'MID')]
[Switch]
$ManagedIdentity

)

if ($null -eq $CertificatePath)
if ([System.String]::IsNullOrEmpty($CertificatePath))
{
$ConnectionMode = New-M365DSCConnection -Workload 'MicrosoftGraph' `
-InboundParameters $PSBoundParameters
$tenantDetails = Get-MgOrganization
$defaultDomain = $tenantDetails.VerifiedDomains | Where-Object -FilterScript { $_.Initial }
$defaultDomain = $tenantDetails.VerifiedDomains | Where-Object -FilterScript { $_.IsInitial }
return $defaultDomain.Name
}
if ($TenantId.Contains('onmicrosoft'))
Expand Down

0 comments on commit dea57b8

Please sign in to comment.