I'd like some feedback on creating iOS Enrollment Profiles in Intune with PowerShell. I've successfully automated most of my Intune/iOS deployment processes. I've had no issues creating Filters or Device Configuration profiles and I can easily assign Enrollment Profiles via PS script. When I attempt to create iOS Enrollment Profiles however, I run into an issue. The creation process completes successfully. The resulting profile is identical to a manually created Enrollment Profile in every way, with the exception of the displayName and id.
The issue occurs when a device assigned to the script-created Enrollment Profile attempts to onboard. At the Remote Management screen, the error "The configuration for your iPad could not be downloaded from [Organization Name]. Invalid Profile" occurs. At this point the device is essentially bricked until it can be connected to Apple Configurator and reset at a base level.
While I am happy to provide my code, the more specific question I have is if this is intended to function. I've been unable to find others who have attempted this. We are growing at an astronomical rate, and each new site requires a unique enrollment profile/device naming convention. Having this functionality would be of great value.