-
Notifications
You must be signed in to change notification settings - Fork 520
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Intune role assignment and cloud login variable
- Loading branch information
Fabien Tschanz
committed
Nov 27, 2024
1 parent
e991dd3
commit 3354573
Showing
15 changed files
with
104 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -423,15 +423,15 @@ function Set-TargetResource | |
{ | ||
$value = $presentationValue.clone() | ||
$value = Rename-M365DSCCimInstanceParameter -Properties $value -KeyMapping $keyToRename | ||
$value.add('[email protected]', $Global:MSCloudLoginAssistant.MicrosoftGraph.ResourceUrl + "beta/deviceManagement/groupPolicyDefinitions('$($definitionValue.Definition.Id)')/presentations('$($presentationValue.presentationDefinitionId)')") | ||
$value.add('[email protected]', $Global:MSCloudLoginConnectionProfile.MicrosoftGraph.ResourceUrl + "beta/deviceManagement/groupPolicyDefinitions('$($definitionValue.Definition.Id)')/presentations('$($presentationValue.presentationDefinitionId)')") | ||
$value.remove('PresentationDefinitionId') | ||
$value.remove('PresentationDefinitionLabel') | ||
$value.remove('id') | ||
$complexPresentationValues += $value | ||
} | ||
} | ||
$complexDefinitionValue = @{ | ||
'[email protected]' = $Global:MSCloudLoginAssistant.MicrosoftGraph.ResourceUrl + "beta/deviceManagement/groupPolicyDefinitions('$($definitionValue.Definition.Id)')" | ||
'[email protected]' = $Global:MSCloudLoginConnectionProfile.MicrosoftGraph.ResourceUrl + "beta/deviceManagement/groupPolicyDefinitions('$($definitionValue.Definition.Id)')" | ||
enabled = $definitionValue.Enabled | ||
presentationValues = $complexPresentationValues | ||
} | ||
|
@@ -519,15 +519,15 @@ function Set-TargetResource | |
{ | ||
$value = $presentationValue.clone() | ||
$value = Rename-M365DSCCimInstanceParameter -Properties $value -KeyMapping $keyToRename | ||
$value.add('[email protected]', "$($Global:MSCloudLoginAssistant.MicrosoftGraph.ResourceUrl)beta/deviceManagement/groupPolicyDefinitions('$($definitionValue.Definition.Id)')/presentations('$($presentationValue.presentationDefinitionId)')") | ||
$value.add('[email protected]', "$($Global:MSCloudLoginConnectionProfile.MicrosoftGraph.ResourceUrl)beta/deviceManagement/groupPolicyDefinitions('$($definitionValue.Definition.Id)')/presentations('$($presentationValue.presentationDefinitionId)')") | ||
$value.remove('PresentationDefinitionId') | ||
$value.remove('PresentationDefinitionLabel') | ||
$value.remove('id') | ||
$complexPresentationValues += $value | ||
} | ||
} | ||
$complexDefinitionValue = @{ | ||
'[email protected]' = $Global:MSCloudLoginAssistant.MicrosoftGraph.ResourceUrl + "beta/deviceManagement/groupPolicyDefinitions('$($definitionValue.Definition.Id)')" | ||
'[email protected]' = $Global:MSCloudLoginConnectionProfile.MicrosoftGraph.ResourceUrl + "beta/deviceManagement/groupPolicyDefinitions('$($definitionValue.Definition.Id)')" | ||
enabled = $definitionValue.Enabled | ||
presentationValues = $complexPresentationValues | ||
} | ||
|
@@ -553,7 +553,7 @@ function Set-TargetResource | |
$currentPresentationValue = $currentDefinitionValue.PresentationValues | Where-Object { $_.PresentationDefinitionId -eq $presentationValue.presentationDefinitionId } | ||
$value = $presentationValue.clone() | ||
$value = Rename-M365DSCCimInstanceParameter -Properties $value -KeyMapping $keyToRename | ||
$value.add('[email protected]', "$($Global:MSCloudLoginAssistant.MicrosoftGraph.ResourceUrl)beta/deviceManagement/groupPolicyDefinitions('$($definitionValue.Definition.Id)')/presentations('$($presentationValue.presentationDefinitionId)')") | ||
$value.add('[email protected]', "$($Global:MSCloudLoginConnectionProfile.MicrosoftGraph.ResourceUrl)beta/deviceManagement/groupPolicyDefinitions('$($definitionValue.Definition.Id)')/presentations('$($presentationValue.presentationDefinitionId)')") | ||
$value.remove('PresentationDefinitionId') | ||
$value.remove('PresentationDefinitionLabel') | ||
$value.remove('id') | ||
|
@@ -563,7 +563,7 @@ function Set-TargetResource | |
} | ||
$complexDefinitionValue = @{ | ||
id = $currentDefinitionValue.Id | ||
'[email protected]' = $Global:MSCloudLoginAssistant.MicrosoftGraph.ResourceUrl + "beta/deviceManagement/groupPolicyDefinitions('$($definitionValue.Definition.Id)')" | ||
'[email protected]' = $Global:MSCloudLoginConnectionProfile.MicrosoftGraph.ResourceUrl + "beta/deviceManagement/groupPolicyDefinitions('$($definitionValue.Definition.Id)')" | ||
enabled = $definitionValue.Enabled | ||
presentationValues = $complexPresentationValues | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -521,7 +521,7 @@ function Set-TargetResource | |
} | ||
|
||
#region resource generator code | ||
$CreateParameters.Add("[email protected]", "$($Global:MSCloudLoginAssistant.MicrosoftGraph.ResourceUrl)beta/deviceManagement/deviceConfigurations('$RootCertificateId')") | ||
$CreateParameters.Add("[email protected]", "$($Global:MSCloudLoginConnectionProfile.MicrosoftGraph.ResourceUrl)beta/deviceManagement/deviceConfigurations('$RootCertificateId')") | ||
$CreateParameters.Add("@odata.type", "#microsoft.graph.windows81SCEPCertificateProfile") | ||
$policy = New-MgBetaDeviceManagementDeviceConfiguration -BodyParameter $CreateParameters | ||
$assignmentsHash = ConvertTo-IntunePolicyAssignment -IncludeDeviceFilter:$true -Assignments $Assignments | ||
|
@@ -1033,7 +1033,7 @@ function Update-DeviceConfigurationPolicyRootCertificateId | |
|
||
$Uri = $Global:MSCloudLoginConnectionProfile.MicrosoftGraph.ResourceUrl + "beta/deviceManagement/deviceConfigurations('$DeviceConfigurationPolicyId')/microsoft.graph.windows81SCEPCertificateProfile/rootCertificate/`$ref" | ||
$ref = @{ | ||
'@odata.id' = $Global:MSCloudLoginAssistant.MicrosoftGraph.ResourceUrl + "beta/deviceManagement/deviceConfigurations('$RootCertificateId')" | ||
'@odata.id' = $Global:MSCloudLoginConnectionProfile.MicrosoftGraph.ResourceUrl + "beta/deviceManagement/deviceConfigurations('$RootCertificateId')" | ||
} | ||
|
||
Invoke-MgGraphRequest -Method PUT -Uri $Uri -Body ($ref|ConvertTo-Json) -ErrorAction Stop | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -563,7 +563,7 @@ function Set-TargetResource | |
-CertificateId $RootCertificatesForServerValidationIds[$i] ` | ||
-CertificateDisplayName $RootCertificatesForServerValidationDisplayNames[$i] ` | ||
-OdataTypes @('#microsoft.graph.windows81TrustedRootCertificate') | ||
$rootCertificatesForServerValidation += "$($Global:MSCloudLoginAssistant.MicrosoftGraph.ResourceUrl)beta/deviceManagement/deviceConfigurations('$checkedCertId')" | ||
$rootCertificatesForServerValidation += "$($Global:MSCloudLoginConnectionProfile.MicrosoftGraph.ResourceUrl)beta/deviceManagement/deviceConfigurations('$checkedCertId')" | ||
} | ||
$CreateParameters.Add('[email protected]', $rootCertificatesForServerValidation) | ||
} | ||
|
@@ -578,7 +578,7 @@ function Set-TargetResource | |
'#microsoft.graph.windows81TrustedRootCertificate', ` | ||
'#microsoft.graph.windows10PkcsCertificateProfile' ` | ||
) | ||
$ref = "$($Global:MSCloudLoginAssistant.MicrosoftGraph.ResourceUrl)beta/deviceManagement/deviceConfigurations('$checkedCertId')" | ||
$ref = "$($Global:MSCloudLoginConnectionProfile.MicrosoftGraph.ResourceUrl)beta/deviceManagement/deviceConfigurations('$checkedCertId')" | ||
$CreateParameters.Add('[email protected]', $ref) | ||
} | ||
|
||
|
@@ -592,7 +592,7 @@ function Set-TargetResource | |
'#microsoft.graph.windows81TrustedRootCertificate', ` | ||
'#microsoft.graph.windows10PkcsCertificateProfile' ` | ||
) | ||
$ref = "$($Global:MSCloudLoginAssistant.MicrosoftGraph.ResourceUrl)beta/deviceManagement/deviceConfigurations('$checkedCertId')" | ||
$ref = "$($Global:MSCloudLoginConnectionProfile.MicrosoftGraph.ResourceUrl)beta/deviceManagement/deviceConfigurations('$checkedCertId')" | ||
$CreateParameters.Add('[email protected]', $ref) | ||
} | ||
|
||
|
@@ -602,7 +602,7 @@ function Set-TargetResource | |
-CertificateId $RootCertificateForClientValidationId ` | ||
-CertificateDisplayName $RootCertificateForClientValidationDisplayName ` | ||
-OdataTypes @('#microsoft.graph.windows81TrustedRootCertificate') | ||
$ref = "$($Global:MSCloudLoginAssistant.MicrosoftGraph.ResourceUrl)beta/deviceManagement/deviceConfigurations('$checkedCertId')" | ||
$ref = "$($Global:MSCloudLoginConnectionProfile.MicrosoftGraph.ResourceUrl)beta/deviceManagement/deviceConfigurations('$checkedCertId')" | ||
$CreateParameters.Add('[email protected]', $ref) | ||
} | ||
|
||
|
@@ -612,7 +612,7 @@ function Set-TargetResource | |
-CertificateId $SecondaryRootCertificateForClientValidationId ` | ||
-CertificateDisplayName $SecondaryRootCertificateForClientValidationDisplayName ` | ||
-OdataTypes @('#microsoft.graph.windows81TrustedRootCertificate') | ||
$ref = "$($Global:MSCloudLoginAssistant.MicrosoftGraph.ResourceUrl)beta/deviceManagement/deviceConfigurations('$checkedCertId')" | ||
$ref = "$($Global:MSCloudLoginConnectionProfile.MicrosoftGraph.ResourceUrl)beta/deviceManagement/deviceConfigurations('$checkedCertId')" | ||
$CreateParameters.Add('[email protected]', $ref) | ||
} | ||
|
||
|
@@ -1241,7 +1241,7 @@ function Update-DeviceConfigurationPolicyCertificateId | |
foreach ($certificateId in $CertificateIds) | ||
{ | ||
$ref = @{ | ||
'@odata.id' = "$($Global:MSCloudLoginAssistant.MicrosoftGraph.ResourceUrl)beta/deviceManagement/deviceConfigurations('$certificateId')" | ||
'@odata.id' = "$($Global:MSCloudLoginConnectionProfile.MicrosoftGraph.ResourceUrl)beta/deviceManagement/deviceConfigurations('$certificateId')" | ||
} | ||
|
||
Invoke-MgGraphRequest -Method $method -Uri $Uri -Body ($ref | ConvertTo-Json) -ErrorAction Stop 4>$null | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.