forked from Gerenios/AADInternals
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ActiveSync.ps1
682 lines (605 loc) · 27.3 KB
/
ActiveSync.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
# Performs EAS autodiscover
# Aug 30th 2022: Updated protocols, credits to celsogbezerra
function Get-EASAutoDiscover
{
<#
.SYNOPSIS
Performs autodiscover for the given user and protocol
.DESCRIPTION
Performs autodiscover for the given user using AutoDiscover V2. Returns the url of the requested protocol, defaults to ActiveSync
.Example
Get-AADIntEASAutoDiscover -Email user@company.com
Protocol Url
-------- ---
ActiveSync https://outlook.office365.com/Microsoft-Server-ActiveSync
.Example
Get-AADIntEASAutoDiscover -Email user@company.com -Protocol All
Protocol Url
-------- ---
Rest https://outlook.office.com/api
ActiveSync https://outlook.office365.com/Microsoft-Server-ActiveSync
Ews https://outlook.office365.com/EWS/Exchange.asmx
Substrate https://substrate.office.com
Substratesearchservice https://outlook.office365.com/search
AutodiscoverV1 https://outlook.office365.com/autodiscover/autodiscover.xml
substratesearchservice https://outlook.office365.com/search
substratenotificationservice https://substrate.office.com/insights
outlookmeetingscheduler https://outlook.office.com/scheduling/api
outlookpay https://outlook.office.com/opay
#>
Param(
[Parameter(Mandatory=$True)]
[String]$Email,
[ValidateSet('All','Actions','ActiveSync','AutodiscoverV1','CompliancePolicyService','Connectors','ConnectorsProcessors','ConnectorsWebhook','Ews','NotesClient','OutlookCloudSettingsService','OutlookLocationsService','OutlookMeetingScheduler','OutlookPay','OutlookTailoredExperiences','OwaPoweredExperience','OwaPoweredExperienceV2','Rest','SpeechAndLanguagePersonalization','Speedway','Substrate','SubstrateNotificationService','SubstrateSearchService','SubstrateSignalService','ToDo','Weve')]
[String]$Protocol="All"
)
Process
{
if($Protocol -eq "All")
{
$Protocols = @('Actions','ActiveSync','AutodiscoverV1','CompliancePolicyService','Connectors','ConnectorsProcessors','ConnectorsWebhook','Ews','NotesClient','OutlookCloudSettingsService','OutlookLocationsService','OutlookMeetingScheduler','OutlookPay','OutlookTailoredExperiences','OwaPoweredExperience','OwaPoweredExperienceV2','Rest','SpeechAndLanguagePersonalization','Speedway','Substrate','SubstrateNotificationService','SubstrateSearchService','SubstrateSignalService','ToDo','Weve')
$Response = @()
foreach($p in $Protocols)
{
$url = "https://outlook.office365.com/Autodiscover/Autodiscover.json?Email=$Email&Protocol=$p"
$response+=Invoke-RestMethod -UseBasicParsing -Uri $url -Method Get
}
}
else
{
$url = "https://outlook.office365.com/Autodiscover/Autodiscover.json?Email=$Email&Protocol=$Protocol"
$response=Invoke-RestMethod -UseBasicParsing -Uri $url -Method Get
}
$response
}
}
<#
.SYNOPSIS
Performs autodiscover for the given user
.DESCRIPTION
Performs autodiscover for the given user. Returns the url of ActiveSync service
.Example
Get-AADIntEASAutoDiscoverV1 -Credentials $Cred
https://outlook.office365.com/Microsoft-Server-ActiveSync
#>
function Get-EASAutoDiscoverV1
{
Param(
[Parameter(Mandatory=$False)]
[System.Management.Automation.PSCredential]$Credentials,
[Parameter(Mandatory=$False)]
[String]$AccessToken
)
Process
{
$auth = Create-AuthorizationHeader -Credentials $Credentials -AccessToken $AccessToken -Resource "https://outlook.office365.com" -ClientId "d3590ed6-52b3-4102-aeff-aad2292ab01c"
$headers = @{
"Authorization" = $auth
"Content-Type" = "text/xml"
}
$user=Get-UserNameFromAuthHeader -Auth $auth
$domain=$user.Split("@")[1]
# Default host for Office 365
$hostname = "autodiscover-s.outlook.com"
$url = "https://$hostname/Autodiscover/Autodiscover.xml"
$body=@"
<Autodiscover xmlns="http://schemas.microsoft.com/exchange/autodiscover/mobilesync/requestschema/2006">
<Request>
<EMailAddress>$user</EMailAddress>
<AcceptableResponseSchema>http://schemas.microsoft.com/exchange/autodiscover/mobilesync/responseschema/2006</AcceptableResponseSchema>
</Request>
</Autodiscover>
"@
$response=Invoke-RestMethod -UseBasicParsing -Uri $url -Method Post -Headers $headers -Body $body -TimeoutSec 60
$response.Autodiscover.Response.Action.Settings.Server.Url
}
}
function Get-EASOptions
{
Param(
[Parameter(Mandatory=$False)]
[System.Management.Automation.PSCredential]$Credentials,
[Parameter(Mandatory=$False)]
[String]$AccessToken
)
Process
{
$headers = @{
"Authorization" = Create-AuthorizationHeader -Credentials $Credentials -AccessToken $AccessToken -Resource "https://outlook.office365.com" -ClientId "d3590ed6-52b3-4102-aeff-aad2292ab01c"
}
$response=Invoke-WebRequest -UseBasicParsing -Uri "https://outlook.office365.com/Microsoft-Server-ActiveSync" -Method Options -Headers $headers -TimeoutSec 10
$response.headers
}
}
# Get folders to sync
function Get-EASFolderSync
{
<#
.SYNOPSIS
Gets user's ActiveSync options
.DESCRIPTION
Gets user's ActiveSync options. Shows for instance Front and Backend server names.
The first two characters indicates the city: HE=Helsinki, VI=Vienna, DB=Dublin, AM=Amsterdam, etc.
.Example
Get-AADIntEASOptions -Credentials $Cred
Key Value
--- -----
Allow OPTIONS,POST
request-id 61e62c8d-f689-4d08-b0d7-4ffa1e42e1ea
X-CalculatedBETarget HE1PR0802MB2202.eurprd08.prod.outlook.com
X-BackEndHttpStatus 200
X-RUM-Validated 1
MS-Server-ActiveSync 15.20
MS-ASProtocolVersions 2.0,2.1,2.5,12.0,12.1,14.0,14.1,16.0,16.1
MS-ASProtocolCommands Sync,SendMail,SmartForward,SmartReply,GetAttachment,GetHierarchy,CreateCollection,DeleteCollection,MoveCollectio...
Public OPTIONS,POST
X-MS-BackOffDuration L/-469
X-DiagInfo HE1PR0802MB2202
X-BEServer HE1PR0802MB2202
X-FEServer HE1PR1001CA0019
Content-Length 0
Cache-Control private
Content-Type application/vnd.ms-sync.wbxml
Date Wed, 03 Apr 2019 17:40:18 GMT
Server Microsoft-IIS/10.0
X-AspNet-Version 4.0.30319
X-Powered-By ASP.NET
#>
Param(
[Parameter(Mandatory=$False)]
[System.Management.Automation.PSCredential]$Credentials,
[Parameter(Mandatory=$False)]
[String]$AccessToken,
[Parameter(Mandatory=$True)]
[String]$DeviceId,
[Parameter(Mandatory=$False)]
[String]$DeviceType="Android"
)
Process
{
[xml]$request=@"
<FolderSync xmlns="FolderHierarchy">
<SyncKey>0</SyncKey>
</FolderSync>
"@
$response = Call-EAS -Request $request -Command FolderSync -Authorization (Create-AuthorizationHeader -Credentials $Credentials -AccessToken $AccessToken -Resource "https://outlook.office365.com" -ClientId "d3590ed6-52b3-4102-aeff-aad2292ab01c") -DeviceId $DeviceId -DeviceType $DeviceType
return $response
}
}
function Send-EASMessage
{
<#
.SYNOPSIS
Sends mail message using ActiveSync
.DESCRIPTION
Sends mail using ActiveSync using the account of given credentials.
Supports both Basic and Modern Authentication.
Message MUST be html (or plaintext) and SHOULD be Base64 encoded (if not, it's automatically converted).
.Example
PS C:\>$Cred=Get-Credential
PS C:\>Send-AADIntEASMessage -Credentials $Cred -DeviceId androidc481040056 -DeviceType Android -Recipient someone@company.com -Subject "An email" -Message "This is a message!"
.Example
PS C:\>$At=Get-AADIntAccessTokenForEXO
PS C:\>Send-AADIntEASMessage -AccessToken $At -DeviceId androidc481040056 -DeviceType Android -Recipient someone@company.com -Subject "An email" -Message "This is a message!"
#>
Param(
[Parameter(Mandatory=$False)]
[System.Management.Automation.PSCredential]$Credentials,
[Parameter(Mandatory=$False)]
[String]$AccessToken,
[Parameter(Mandatory=$True)]
[String]$Recipient,
[Parameter(Mandatory=$True)]
[String]$Subject,
[Parameter(Mandatory=$True)]
[String]$Message,
[Parameter(Mandatory=$True)]
[String]$DeviceId,
[Parameter(Mandatory=$False)]
[String]$DeviceType="Android",
[Parameter(Mandatory=$False)]
[String]$DeviceOS
)
Process
{
$messageId = (New-Guid).ToString()
[xml]$request=@"
<SendMail xmlns="ComposeMail"><ClientId>$messageId</ClientId><SaveInSentItems></SaveInSentItems><MIME><![CDATA[Date: Wed, 03 Apr 2019 08:51:41 +0300
Subject: $Subject
Message-ID: <$messageId>
From: rudolf@santaclaus.org
To: $recipient
Importance: Normal
X-Priority: 3
X-MSMail-Priority: Normal
MIME-Version: 1.0
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: base64
$(Get-MessageAsBase64 -Message $Message)
]]></MIME></SendMail>
"@
$response = Call-EAS -Request $request -Command SendMail -Authorization (Create-AuthorizationHeader -Credentials $Credentials -AccessToken $AccessToken -Resource "https://outlook.office365.com" -ClientId "d3590ed6-52b3-4102-aeff-aad2292ab01c") -DeviceId $DeviceId -DeviceType $DeviceType -DeviceOS $DeviceOS
return $response
}
}
<#
.SYNOPSIS
Sets users device settings using ActiveSync
.DESCRIPTION
Sets users device settings using ActiveSync. You can change device's Model, IMEI, FriendlyName, OS, OSLanguage, PhoneNumber, MobileOperator, and User-Agent.
All empty properties are cleared from the device settings. I.e., if IMEI is not given, it will be cleared.
.Example
PS C:\>$Cred=Get-Credential
PS C:\>Set-AADIntEASSettings -Credentials $Cred -DeviceId androidc481040056 -DeviceType Android -Model "Samsung S10" -PhoneNumber "+1234567890"
#>
function Set-EASSettings
{
Param(
[Parameter(Mandatory=$False)]
[System.Management.Automation.PSCredential]$Credentials,
[Parameter(Mandatory=$False)]
[String]$AccessToken,
[Parameter(Mandatory=$True)]
[String]$DeviceId,
[Parameter(Mandatory=$False)]
[String]$DeviceType="Android",
[Parameter(Mandatory=$False)]
[String]$Model,
[Parameter(Mandatory=$False)]
[String]$IMEI,
[Parameter(Mandatory=$False)]
[String]$FriendlyName,
[Parameter(Mandatory=$False)]
[String]$OS,
[Parameter(Mandatory=$False)]
[String]$OSLanguage,
[Parameter(Mandatory=$False)]
[String]$PhoneNumber,
[Parameter(Mandatory=$False)]
[String]$MobileOperator,
[Parameter(Mandatory=$False)]
[String]$UserAgent
)
Process
{
[xml]$request=@"
<Settings xmlns="Settings">
<DeviceInformation>
<Set>
<Model>$Model</Model>
<IMEI>$IMEI</IMEI>
<FriendlyName>$FriendlyName</FriendlyName>
<OS>$OS</OS>
<OSLanguage>$OSLanguage</OSLanguage>
<PhoneNumber>$PhoneNumber</PhoneNumber>
<MobileOperator>$MobileOperator</MobileOperator>
<UserAgent>$UserAgent</UserAgent>
</Set>
</DeviceInformation>
</Settings>
"@
$response = Call-EAS -Request $request -Command Settings -Authorization (Create-AuthorizationHeader -Credentials $Credentials -AccessToken $AccessToken -Resource "https://outlook.office365.com" -ClientId "d3590ed6-52b3-4102-aeff-aad2292ab01c") -DeviceId $DeviceId -DeviceType $DeviceType -UserAgent $UserAgent
return $response.OuterXml
}
}
<#
.SYNOPSIS
Adds a new ActiveSync device to user
.DESCRIPTION
Adds a new ActiveSync device to the user, and accepts security policies. All device information settings are required (Model, IMEI, FriendlyName, OS, OSLanguage, PhoneNumber, MobileOperator, and User-Agent).
Returns a policy key that could be used in subsequent ActiveSync calls
.Example
PS C:\>$Cred=Get-Credential
PS C:\>Add-AADIntEASDevice -Credentials $Cred -DeviceId androidc481040056 -DeviceType Android -Model "Samsung S10" -PhoneNumber "+1234567890" -IMEI "1234" -FriendlyName "My Phone" -OS "Android" -OSLanguage "EN" -MobileOperator "BT" -UserAgent "Android/8.0"
3382976401
#>
function Add-EASDevice
{
Param(
[Parameter(Mandatory=$False)]
[System.Management.Automation.PSCredential]$Credentials,
[Parameter(Mandatory=$False)]
[String]$AccessToken,
[Parameter(Mandatory=$True)]
[String]$DeviceId,
[Parameter(Mandatory=$False)]
[String]$DeviceType="Android",
[Parameter(Mandatory=$False)]
[String]$Model,
[Parameter(Mandatory=$False)]
[String]$IMEI,
[Parameter(Mandatory=$False)]
[String]$FriendlyName,
[Parameter(Mandatory=$False)]
[String]$OS,
[Parameter(Mandatory=$False)]
[String]$OSLanguage,
[Parameter(Mandatory=$False)]
[String]$PhoneNumber,
[Parameter(Mandatory=$False)]
[String]$MobileOperator,
[Parameter(Mandatory=$False)]
[String]$UserAgent
)
Process
{
[xml]$request=@"
<Provision xmlns="Provision" >
<DeviceInformation xmlns="Settings">
<Set>
<Model>$Model</Model>
<IMEI>$IMEI</IMEI>
<FriendlyName>$FriendlyName</FriendlyName>
<OS>$OS</OS>
<OSLanguage>$OSLanguage</OSLanguage>
<PhoneNumber>$PhoneNumber</PhoneNumber>
<MobileOperator>$MobileOperator</MobileOperator>
<UserAgent>$UserAgent</UserAgent>
</Set>
</DeviceInformation>
<Policies>
<Policy>
<PolicyType>MS-EAS-Provisioning-WBXML</PolicyType>
</Policy>
</Policies>
</Provision>
"@
# The first request (must be done twice for some reason)
$response = Call-EAS -Request $request -Command Provision -Authorization (Create-AuthorizationHeader -Credentials $Credentials -AccessToken $AccessToken -Resource "https://outlook.office365.com" -ClientId "d3590ed6-52b3-4102-aeff-aad2292ab01c") -DeviceId $DeviceId -DeviceType $DeviceType -UserAgent $UserAgent -PolicyKey 0
$response = Call-EAS -Request $request -Command Provision -Authorization (Create-AuthorizationHeader -Credentials $Credentials -AccessToken $AccessToken -Resource "https://outlook.office365.com" -ClientId "d3590ed6-52b3-4102-aeff-aad2292ab01c") -DeviceId $DeviceId -DeviceType $DeviceType -UserAgent $UserAgent -PolicyKey 0
# Save the temporary policy key
$policyKey = $response.Provision.Policies.Policy.PolicyKey
# Create a request to acknowledge the policy
[xml]$request=@"
<Provision xmlns="Provision" >
<Policies>
<Policy>
<PolicyType>MS-EAS-Provisioning-WBXML</PolicyType>
<PolicyKey>$policyKey</PolicyKey>
<Status>1</Status>
</Policy>
</Policies>
</Provision>
"@
# The second request
$response = Call-EAS -Request $request -Command Provision -Authorization (Create-AuthorizationHeader -Credentials $Credentials -AccessToken $AccessToken -Resource "https://outlook.office365.com" -ClientId "d3590ed6-52b3-4102-aeff-aad2292ab01c") -DeviceId $DeviceId -DeviceType $DeviceType -UserAgent $UserAgent -PolicyKey $policyKey
# Save the final policy key
$policyKey = $response.Provision.Policies.Policy.PolicyKey
$policyKey
}
}
# Jan 2nd 2020
function Get-MobileOutlookSettings
{
Param(
[Parameter(Mandatory=$False)]
[System.Management.Automation.PSCredential]$Credentials,
[Parameter(Mandatory=$False)]
[String]$AccessToken
)
Process
{
$headers = @{
"Authorization" = Create-AuthorizationHeader -Credentials $Credentials -AccessToken $AccessToken -Resource "https://outlook.office365.com" -ClientId "d3590ed6-52b3-4102-aeff-aad2292ab01c"
"Accept"="application/json"
}
$response=Invoke-RestMethod -UseBasicParsing -Uri "https://outlook.office365.com/outlookservice/ishxscapable" -Headers $headers
# Return
$response
}
}
# Gets the settings for Exchange Active Sync (Outlook mobile)
function Get-EASSettings
{
Param(
[Parameter(Mandatory=$False)]
[System.Management.Automation.PSCredential]$Credentials,
[Parameter(Mandatory=$False)]
[String]$AccessToken
)
Process
{
$headers = @{
"Authorization" = Create-AuthorizationHeader -Credentials $Credentials -AccessToken $AccessToken -Resource "https://outlook.office365.com" -ClientId "d3590ed6-52b3-4102-aeff-aad2292ab01c"
"Accept"="application/json"
}
$response=Invoke-RestMethod -UseBasicParsing -Uri "https://outlook.office365.com/outlookservice/ishxscapable" -Headers $headers
# Return
$response
}
}
# Gets the sync status for Exchange Active Sync (Outlook mobile)
function Get-EASSyncStatus
{
Param(
[Parameter(Mandatory=$False)]
[System.Management.Automation.PSCredential]$Credentials,
[Parameter(Mandatory=$False)]
[String]$AccessToken,
[Parameter(Mandatory=$True)]
[String]$AnchorMailBox,
[Parameter(Mandatory=$True)]
[byte[]]$OutlookFrame
)
Process
{
$headers = @{
"Authorization" = Create-AuthorizationHeader -Credentials $Credentials -AccessToken $AccessToken -Resource "https://outlook.office365.com" -ClientId "d3590ed6-52b3-4102-aeff-aad2292ab01c"
"Accept"="application/http.wbxml"
"X-AnchorMailbox" = $AnchorMailBox
"Content-Type" = "application/http.wbxml"
"X-OSApi-Protocol" = "HttpSockets:1.1"
#"X-CommandId" = "6" # 6
"User-Agent" = "Outlook-Android/2.0"
"connect" = "GET"
}
$response=Invoke-WebRequest -UseBasicParsing "https://outlook.office365.com/outlookservice/servicechannel.hxs" -Headers $headers -Body $OutlookFrame -Method Post -TimeOutSec 300
$responseBytes = [byte[]]$response.Content
[xml]$responseXml = O365WBXML2XML -wbxml $responseBytes
# Return
$responseXml.InnerXml
}
}
function Get-EASMails
{
Param(
[Parameter(Mandatory=$False)]
[System.Management.Automation.PSCredential]$Credentials,
[Parameter(Mandatory=$False)]
[String]$AccessToken,
[Parameter(Mandatory=$True)]
[guid]$DeviceId,
[Parameter(Mandatory=$False)]
[String]$DeviceType="Android",
[Parameter(Mandatory=$False)]
[String]$OSVersion="5.0.2",
[Parameter(Mandatory=$False)]
[String]$ClientVersion="4.0.90 (379) prod",
[Parameter(Mandatory=$False)]
[String]$OutlookVersion="16.0.12317.33832",
[Parameter(Mandatory=$False)]
[String]$OutlookTitle="Outlook for iOS and Android"
)
Process
{
$settings = Get-EASSettings -Credentials $Credentials -AccessToken $AccessToken
$anchorMailBox = $settings.AnchorMailBox
$request=@"
<frames>
<frame>
<block>
<_FF_05 xmlns="_FF">
<_FF_07 xmlns="_FF">
<EXT_2>01</EXT_2>
</_FF_07>
<_FF_06 xmlns="_FF">
<EXT_2>01</EXT_2>
</_FF_06>
<_FF_08 xmlns="_FF">sync</_FF_08>
<_FF_09 xmlns="_FF">$((New-Guid).ToString())</_FF_09>
<_FF_0D xmlns="_FF">
<EXT_2>04</EXT_2>
</_FF_0D>
<_FF_0E xmlns="_FF">
<EXT_2>0B</EXT_2>
</_FF_0E>
<_FF_0F xmlns="_FF">
<EXT_2>1C03</EXT_2>
</_FF_0F>
<_FF_19 xmlns="_FF">$($DeviceId.ToString())</_FF_19>
<_FF_16 xmlns="_FF"/>
<_FF_2B xmlns="_FF">$ClientVersion</_FF_2B>
<_FF_18 xmlns="_FF">$OutlookVersion</_FF_18>
<_FF_1A xmlns="_FF">$OSVersion</_FF_1A>
<_FF_1B xmlns="_FF">$DeviceType</_FF_1B>
<_FF_1F xmlns="_FF"/>
<_FF_2A xmlns="_FF"/>
<_FF_20 xmlns="_FF">
<_FF_21 xmlns="_FF">
<_FF_22 xmlns="_FF">
<EXT_2>01</EXT_2>
</_FF_22>
<_FF_23 xmlns="_FF">$((New-Guid).ToString())</_FF_23>
</_FF_21>
<_FF_21 xmlns="_FF">
<_FF_22 xmlns="_FF">
<EXT_2>02</EXT_2>
</_FF_22>
<_FF_23 xmlns="_FF">true</_FF_23>
</_FF_21>
<_FF_21 xmlns="_FF">
<_FF_22 xmlns="_FF">
<EXT_2>03</EXT_2>
</_FF_22>
<_FF_23 xmlns="_FF">0</_FF_23>
</_FF_21>
<_FF_21 xmlns="_FF">
<_FF_22 xmlns="_FF">
<EXT_2>04</EXT_2>
</_FF_22>
<_FF_23 xmlns="_FF">true</_FF_23>
</_FF_21>
<_FF_21 xmlns="_FF">
<_FF_22 xmlns="_FF">
<EXT_2>06</EXT_2>
</_FF_22>
<_FF_23 xmlns="_FF">true</_FF_23>
</_FF_21>
<_FF_21 xmlns="_FF">
<_FF_22 xmlns="_FF">
<EXT_2>08</EXT_2>
</_FF_22>
<_FF_23 xmlns="_FF">true</_FF_23>
</_FF_21>
<_FF_21 xmlns="_FF">
<_FF_22 xmlns="_FF">
<EXT_2>0B</EXT_2>
</_FF_22>
<_FF_23 xmlns="_FF">true</_FF_23>
</_FF_21>
<_FF_21 xmlns="_FF">
<_FF_22 xmlns="_FF">
<EXT_2>09</EXT_2>
</_FF_22>
<_FF_23 xmlns="_FF">true</_FF_23>
</_FF_21>
<_FF_21 xmlns="_FF">
<_FF_22 xmlns="_FF">
<EXT_2>0E</EXT_2>
</_FF_22>
<_FF_23 xmlns="_FF">true</_FF_23>
</_FF_21>
<_FF_21 xmlns="_FF">
<_FF_22 xmlns="_FF">
<EXT_2>07</EXT_2>
</_FF_22>
<_FF_23 xmlns="_FF">2</_FF_23>
</_FF_21>
<_FF_21 xmlns="_FF">
<_FF_22 xmlns="_FF">
<EXT_2>0A</EXT_2>
</_FF_22>
<_FF_23 xmlns="_FF">true</_FF_23>
</_FF_21>
<_FF_21 xmlns="_FF">
<_FF_22 xmlns="_FF">
<EXT_2>0F</EXT_2>
</_FF_22>
<_FF_23 xmlns="_FF">true</_FF_23>
</_FF_21>
</_FF_20>
<_FF_26 xmlns="_FF">
<EXT_2>02</EXT_2>
</_FF_26>
<_FF_25 xmlns="_FF">
<EXT_2>00</EXT_2>
</_FF_25>
</_FF_05>
</block>
<block>
<_E0_3B xmlns="_E0">
<_E0_3C xmlns="_E0">$OutlookVersion</_E0_3C>
<_E0_3D xmlns="_E0"/>
<_E1_1B xmlns="_E1"/>
<_E1_1C xmlns="_E1"/>
<_E1_1D xmlns="_E1">$OutlookTitle</_E1_1D>
<_E1_1E xmlns="_E1"/>
<_E1_1F xmlns="_E1"/>
<_E0_3E xmlns="_E0">
<EXT_2>01</EXT_2>
</_E0_3E>
<_10_11 xmlns="_10">
<EXT_2>01</EXT_2>
</_10_11>
<_1B_22 xmlns="_1B">
<EXT_2>01</EXT_2>
</_1B_22>
</_E0_3B>
</block>
</frame>
</frames>
"@
$response=Get-EASSyncStatus -Credentials $Credentials -AccessToken $AccessToken -AnchorMailBox $anchorMailBox -OutlookFrame ([byte[]](XML2O365WBXML -xml $request))
$response
}
}