-
Notifications
You must be signed in to change notification settings - Fork 503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial module. Adds support for iOS trusted root certs #5467
base: Dev
Are you sure you want to change the base?
Initial module. Adds support for iOS trusted root certs #5467
Conversation
Will be adding Android equivalent module soon |
.../DSCResources/MSFT_IntuneTrustedRootCertificateIOS/MSFT_IntuneTrustedRootCertificateIOS.psm1
Outdated
Show resolved
Hide resolved
.../DSCResources/MSFT_IntuneTrustedRootCertificateIOS/MSFT_IntuneTrustedRootCertificateIOS.psm1
Show resolved
Hide resolved
...les/Microsoft365DSC/Examples/Resources/IntuneTrustedRootCertificateIOS/Example/localhost.mof
Outdated
Show resolved
Hide resolved
.../DSCResources/MSFT_IntuneTrustedRootCertificateIOS/MSFT_IntuneTrustedRootCertificateIOS.psm1
Outdated
Show resolved
Hide resolved
.../DSCResources/MSFT_IntuneTrustedRootCertificateIOS/MSFT_IntuneTrustedRootCertificateIOS.psm1
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you save the schema file in UTF16? Could you please try with UTF8 instead? Otherwise it shows up in GH as binary file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not on purpose, but yes it was UTF16, have resaved all files as UTF8 in both PRs
OK let me test this on my dev tenant to check if there's any issues and I'll get back to you |
.../DSCResources/MSFT_IntuneTrustedRootCertificateIOS/MSFT_IntuneTrustedRootCertificateIOS.psm1
Outdated
Show resolved
Hide resolved
$nullResult.Ensure = 'Absent' | ||
try | ||
{ | ||
if (-not [string]::IsNullOrWhiteSpace($id)){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still not quite right, the bracket { must be right below if aligned to the closing bracket }
{ | ||
Update-DeviceConfigurationPolicyAssignment -DeviceConfigurationPolicyId $policy.id ` | ||
-Targets $assignmentsHash ` | ||
-Repository 'deviceAppManagement/mobileAppConfigurations' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't correct, I had to figure out why the assignments were not working, this is because the correct repository to use here is 'deviceManagement/deviceConfigurations'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I thought they were, I'll look into it.
$assignmentsHash = ConvertTo-IntunePolicyAssignment -IncludeDeviceFilter:$true -Assignments $Assignments | ||
Update-DeviceConfigurationPolicyAssignment -DeviceConfigurationPolicyId $currentInstance.id ` | ||
-Targets $assignmentsHash ` | ||
-Repository 'deviceAppManagement/mobileAppConfigurations' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above, correct repository is 'deviceManagement/deviceConfigurations'
@dannyKBjj Please check my latest comments and make sure you also correct them in your other PR |
Write-Verbose -Message "No Intune Trusted Root Certificate Policy for iOS with Id {$id} was found" | ||
return $nullResult | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a line here with the below, otherwise if the blueprint contains a bogus Id or from a different tenant the verbose messages will pick up the Id from the blueprint which will be incorrect.
$Id = $getValue.Id
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I don't think I understand.. I want it to pick up the bogus ID from the blueprint don't I? That code would only execute if $getValue.Id was null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look at the actual placement of where I'm asking to place it, yes you first want to search the policy by its Id which if it's bogus/from another tenant you then search by Display Name, if you then find it this policy will actually have its own Id which is different from what it's in the blueprint so if you place $Id = $getValue.Id on line 113 the next verbose message will show the actual Id of this policy instead of what's in the blueprint which is wrong
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah ok. Thanks.
$Id = $getValue.Id added on line 113 to make sure verbose message displays correct ID. Now searching correct repository deviceManagement/deviceConfigurations for assignments.
Pull Request (PR) description
This Pull Request (PR) fixes the following issues
None
Task list
Entry should say what was changed and how that affects users (if applicable), and
reference the issue being resolved (if applicable).