Skip to content
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

iOS App not downloading after device is enrolled to Company portal #8

Closed
dballardmaung opened this issue Oct 15, 2018 · 5 comments
Closed

Comments

@dballardmaung
Copy link

The powershell script that I developed will add iOS Apps that I want and assigned security group using either required or Available for enrolled device.

I performed a test iPhone enrollment and noticed that the iOS App that is configured as required didn't download. I also notice that the Logo for iOS Apps were missing.

For verification, I removed one of the iOS Apps and manually re-add with same configuration (required). The required App started to download and installed.

I am using below code to add iOS Outlook app and assigned security group as required.
`#Outlook App (required)
$msOutlookApp = New-DeviceAppManagement_MobileApps -iosStoreApp -displayName 'Microsoft Outlook' -publisher 'Microsoft Corporation' -bundleId 'com.microsoft.Office.Outlook' -appStoreUrl ' https://itunes.apple.com/us/app/microsoft-outlook/id951937596?mt=8&uo=4' -applicableDeviceType (New-IosDeviceTypeObject -iPad $true -iPhoneAndIPod $true) -minimumSupportedOperatingSystem (New-IosMinimumOperatingSystemObject -v8_0 $true)

$mAppId = $msOutlookApp | ForEach-Object {
$_.id
}
Invoke-DeviceAppManagement_MobileApps_Assign -mobileAppId $mAppId -mobileAppAssignments $grpReqIds`

I believe that the issue may tie into how Intune register with App store on the backend that my script didn't do.

Any advice is appreciated.

Thanks

Danny

@rohitramu
Copy link
Contributor

I think you will need to include the icon's data as a byte array in the New-DeviceAppManagement_MobileApps call. I'll test this out and get back to you with a more concrete answer.

@rohitramu
Copy link
Contributor

rohitramu commented Oct 22, 2018

In terms of the missing icon, please see my answer in issue #7. Here is the code for adding the icon from issue #7, for reference:

# Get the icon and its file type
$iconResponse = Invoke-WebRequest $application.Icon  # URL to the icon file (must be a jpg or png)
$iconBytes = $iconResponse.Content # you may also get this from a file on disk if you wish
$iconExt = ([System.IO.Path]::GetExtension("$application.Icon")).replace(".","")
$iconType = "image/$iconExt"

# Create a "minimumOperatingSystem" object
$androidVersion = (New-AndroidMinimumOperatingSystemObject -v4_0 $true)

# Create the app with the icon
New-DeviceAppManagement_MobileApps `
    -androidStoreApp `
    -displayName $application.Name `
    -appStoreUrl $application.URL `
    -description $application.Description `
    -minimumSupportedOperatingSystem $androidVersion `
    -publisher $application.Publisher `
    -largeIcon (New-MimeContentObject -type $iconType -value $iconBytes)

Regarding the issue of the app not being installed on the iOS device, could you please provide the code that you used to create the $grpReqIds object?

@dballardmaung
Copy link
Author

@rohitramu

I will try out your suggestion tonight.

Below is the code for iOS Outlook App creation, and Assignment.
i.e. I am identifying iOS Outlook App as a required app and assigned security group to 'Required'.

$groups = Get-Groups

$grpReqIds = $groups | ForEach-Object {
If ($.DisplayName -like 'Intune')
{
$grpPlacerId2 = $
.id
#Valid values: 'available', 'required', 'uninstall', 'availableWithoutEnrollment'
New-MobileAppAssignmentObject -intent 'required' -target (New-DeviceAndAppManagementAssignmentTargetObject -groupAssignmentTarget -groupId $grpPlacerId2)
}
}`

`Write-Host "Creating iOS MS Outlook App" -ForegroundColor Green
#Outlook App (required)
$msOutlookApp = New-DeviceAppManagement_MobileApps -iosStoreApp -displayName 'Microsoft Outlook' -publisher 'Microsoft Corporation' -bundleId 'com.microsoft.Office.Outlook' -appStoreUrl ' https://itunes.apple.com/us/app/microsoft-outlook/id951937596?mt=8&uo=4' -applicableDeviceType (New-IosDeviceTypeObject -iPad $true -iPhoneAndIPod $true) -minimumSupportedOperatingSystem (New-IosMinimumOperatingSystemObject -v8_0 $true)

$mAppId = $msOutlookApp | ForEach-Object {
$_.id
}
Invoke-DeviceAppManagement_MobileApps_Assign -mobileAppId $mAppId -mobileAppAssignments $grpReqIds`

@dballardmaung
Copy link
Author

I am able to get create largeIcon for iOS Outlook app. Using your example. I will enroll an iOS mobile device tomorrow and find out if Outlook app automatically download and install or not. I will let you know if it works or not.

`$groups = Get-Groups
$grpReqIds = $groups | ForEach-Object {
If ($.DisplayName -like 'Intune')
{
$grpPlacerId2 = $
.id
#Valid values: 'available', 'required', 'uninstall', 'availableWithoutEnrollment'
New-MobileAppAssignmentObject -intent 'required' -target (New-DeviceAndAppManagementAssignmentTargetObject -groupAssignmentTarget -groupId $grpPlacerId2)
}
}
Write-Host "Creating iOS MS Outlook App" -ForegroundColor Green
#MS Outlook Icon
$iconResponse = Invoke-WebRequest -Uri 'https://is4-ssl.mzstatic.com/image/thumb/Purple128/v4/d3/ec/20/d3ec2070-edba-5558-e248-7e21cf2c9b43/AppIcon-outlook.prod-1x_U007emarketing-0-0-GLES2_U002c0-512MB-sRGB-0-0-0-85-220-0-0-0-5.png/246x0w.jpg''
$iconBytes = $iconResponse.Content
$iconType = "image/$iconExt"

#Outlook App (required)
$msOutlookApp = New-DeviceAppManagement_MobileApps -iosStoreApp -displayName 'Microsoft Outlook' -publisher 'Microsoft Corporation' -bundleId 'com.microsoft.Office.Outlook' -appStoreUrl ' https://itunes.apple.com/us/app/microsoft-outlook/id951937596?mt=8&uo=4' -applicableDeviceType (New-IosDeviceTypeObject -iPad $true -iPhoneAndIPod $true) -minimumSupportedOperatingSystem (New-IosMinimumOperatingSystemObject -v8_0 $true) -largeIcon (New-MimeContentObject -type $iconType -value $iconBytes) -Description 'Microsoft Outlook App'

$mAppId = $msOutlookApp | ForEach-Object {
$_.id
}
Invoke-DeviceAppManagement_MobileApps_Assign -mobileAppId $mAppId -mobileAppAssignments $grpReqIds
`

@rohitramu
Copy link
Contributor

I will close this issue since it has been inactive for a while. Please reopen this if you were not able to get this working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants