@@ -197,8 +197,6 @@ To enable the administrative account for the first time, you must provide admini
197
197
198
198
The last step is to subscribe the application to your Log Analytics workspace. You also do this with a PowerShell script.
199
199
200
- The last step is to subscribe the application to your Log Analytics workspace. You also do this with a PowerShell script.
201
-
202
200
1. Save the following script as *office365_subscription.ps1*.
203
201
204
202
```powershell
@@ -457,15 +455,17 @@ You can remove the Office 365 management solution using the process in [Remove a
457
455
# Create Authentication Context tied to Azure AD Tenant
458
456
$authContext = New-Object "Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext" -ArgumentList $authority
459
457
# Acquire token
460
- $global:authResultARM = $authContext.AcquireToken($resourceAppIdURIARM, $clientId, $redirectUri, "Auto")
461
- $authHeader = $global:authResultARM.CreateAuthorizationHeader()
458
+ $platformParameters = New-Object "Microsoft.IdentityModel.Clients.ActiveDirectory.PlatformParameters" -ArgumentList "Auto"
459
+ $global:authResultARM = $authContext.AcquireTokenAsync($resourceAppIdURIARM, $clientId, $redirectUri, $platformParameters)
460
+ $global:authResultARM.Wait()
461
+ $authHeader = $global:authResultARM.Result.CreateAuthorizationHeader()
462
462
$authHeader
463
463
}
464
464
465
465
Function Office-UnSubscribe-Call{
466
466
467
467
#----------------------------------------------------------------------------------------------------------------------------------------------
468
- $authHeader = $global:authResultARM.CreateAuthorizationHeader()
468
+ $authHeader = $global:authResultARM.Result. CreateAuthorizationHeader()
469
469
$ResourceName = "https://manage.office.com"
470
470
$SubscriptionId = $Subscription[0].Subscription.Id
471
471
$OfficeAPIUrl = $ARMResource + 'subscriptions/' + $SubscriptionId + '/resourceGroups/' + $ResourceGroupName + '/providers/Microsoft.OperationalInsights/workspaces/' + $WorkspaceName + '/datasources/office365datasources_' + $SubscriptionId + $OfficeTennantId + '?api-version=2015-11-01-preview'
@@ -503,6 +503,8 @@ You can remove the Office 365 management solution using the process in [Remove a
503
503
.\office365_unsubscribe.ps1 -WorkspaceName MyWorkspace -ResourceGroupName MyResourceGroup -SubscriptionId '60b79d74-f4e4-4867-b631-yyyyyyyyyyyy' -OfficeTennantID 'ce4464f8-a172-4dcf-b675-xxxxxxxxxxxx'
504
504
```
505
505
506
+ You will be prompted for credentials. Provide the credentials for your Log Analytics workspace.
507
+
506
508
## Data collection
507
509
508
510
### Supported agents
0 commit comments