You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ExistingO365=New-graphGetRequest-Uri 'https://graph.microsoft.com/beta/deviceAppManagement/mobileApps'-tenantid $tenant|Where-Object { $_.displayname-eq'Microsoft 365 Apps for Windows 10 and later' }
20
+
$ExistingO365=New-GraphGetRequest-Uri 'https://graph.microsoft.com/beta/deviceAppManagement/mobileApps'-tenantid $Tenant|Where-Object { $_.displayName-eq'Microsoft 365 Apps for Windows 10 and later' }
19
21
if (!$ExistingO365) {
20
22
# Check if custom XML is provided
21
-
if ($request.body.useCustomXml-and$request.body.customXml) {
23
+
if ($Request.Body.useCustomXml-and$Request.Body.customXml) {
22
24
# Use custom XML configuration
23
25
$ObjBody= [pscustomobject]@{
24
26
'@odata.type'='#microsoft.graph.officeSuiteApp'
25
27
'displayName'='Microsoft 365 Apps for Windows 10 and later'
26
28
'description'='Microsoft 365 Apps for Windows 10 and later'
New-graphPostRequest-Uri "https://graph.microsoft.com/beta/deviceAppManagement/mobileApps/$($OfficeAppID.id)/assign"-tenantid $tenant-Body $AssignO365-type POST
95
-
Write-LogMessage-headers $Request.Headers-API $APIName-tenant $($tenant) -message "Assigned Office to $AssignTo"-Sev 'Info'
98
+
New-GraphPOSTRequest-Uri "https://graph.microsoft.com/beta/deviceAppManagement/mobileApps/$($OfficeAppID.id)/assign"-tenantid $Tenant-Body $AssignO365-type POST
99
+
Write-LogMessage-headers $Headers-API $APIName-tenant $($Tenant) -message "Assigned Office to $AssignTo"-Sev 'Info'
96
100
}
97
101
"Successfully added Office App for $($Tenant)"
98
102
} catch {
99
-
"Failed to add Office App for $($Tenant): $($_.Exception.Message)"
0 commit comments