forked from andrew-s-taylor/WindowsAutopilotInfo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathautopilotnuke.ps1
757 lines (638 loc) · 37.8 KB
/
autopilotnuke.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
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
<#PSScriptInfo
.VERSION 3.9
.GUID b608a45b-6cd0-405e-bfb2-aa11450821b5
.AUTHOR Alexey Semibratov - Updated by Andrew Taylor
.COMPANYNAME
.COPYRIGHT Alexey Semibratov
.TAGS
.LICENSEURI https://github.com/andrew-s-taylor/WindowsAutopilotInfo/blob/main/LICENSE
.PROJECTURI
.ICONURI
.EXTERNALMODULEDEPENDENCIES
.REQUIREDSCRIPTS
.EXTERNALSCRIPTDEPENDENCIES
.RELEASENOTES
Version 3.9: Fixed error with multi module import
Version 3.8: Timestamp fix
Version 3.7: Code Signed
Version 3.6: Added None option for assigned user
Version 3.5: Function update
Version 3.4: Fix in function name
Version 3.3: Changed method to grab devices
Version 3.2: Second fix
Version 3.1: Fix
Version 3.0: Updated to work with SDK v2
Version 2.9: Remove-MgDevice ObjectID switched to ID to match updated module
Version 2.8: Fixed speechmarks issue
Version 2.7: Changed Autopilot delete method
Version 2.6: Fixed mg-device command
Version 2.5: Typo
Version 2.4: Switched to MgGraph SDK and added support for app reg
Version 2.1: Bugfix
Version 2.0: Bugfix
Version 1.9: Bugfix
Version 1.8: Streamlined all logic with found Intune/AAD devices, changed output of found objects to a table
Version 1.7: Fixed a situation where there can be multiple Intune devices
Version 1.6: Added assigned user and tag - we will capture the old values, and will allow to change those if needed
Version 1.5: Some change in language around on-prem domain. Added wait for sync if it was less then 10 minutes ago. Fixed a bug when there is no AP devices, but we still want to delete Intune/AAD/AD devices.
Version 1.2: Added more documentation and set of required rights. Now if the device is not found in Autopilot, but exists in Intune (by serial number), it still cleans it from AD DS and AAD
Version 1.1: Invoke-AutopilotSync, when called too soon, error out
Version 1.0: Original public version.
#>
<#
.SYNOPSIS
Interactive script that helps to provision Autopilot machines. Identifies and fixes issues by removing the computer from Intune, AAD, AD and Autopilot, then adds it.
MIT LICENSE
Copyright (c) 2021 Alexey Semibratov
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
.DESCRIPTION
Runs from OOBE screen, connects to Azure AD, Intune and optionally to AD DS, finds all objects for the serial number of the machine it is running on, then deletes it from everywhere, then adds it to Autopilot again.
Asks for deletion of each object
Usage:
- The script can work from running Windows 10, but be careful removing native Azure AD joined Intune Devices - you can lock yourself out, if you do not know local administrator's password
- Intended usage - from OOBE (Out of Box Experience)
- While in OOBE, hits Shift+F10
- Powershell.exe
- Install-Script AutopilotNuke
- Accept all prompts
- & 'C:\Program Files\WindowsPowerShell\Scripts\AutopilotNuke.ps1'
- The script will:
Download and install all required modules (accept all prompts)
Show you the Serial Number of the machine
Prompt to connect you to Azure AD and Intune Graph
Ask you if you want to connect to local AD (ADDS, NT Domain) so it could delete old records from there. Enter the local FQDN (domain.com, contoso.local) of your AD Domain
If you entered local AD domain, it will ask you for the username and password, for the username, use <NetbiosName>\User format
Search in Autopilot for the serial number
Show you all objects in Intune and AAD related to that Serial Number
Ask if you want to delete in from Intune then deletes
Ask if you want to delete in from Autopilot then deletes
Loop through all AAD and AD (if it was selected) objects and ask to delete them
Ask if you want to add it to AP then adds
Minimum security rights needed:
• This script will install the required modules
• Custom role with the following permissions required in Intune:
Managed devices
Read
Delete
Update
Enrollment programs
Create device
Delete device
Read device
Sync device
Assigned to All Devices (did not try scoping it with RBAC, but should work in theory)
• Cloud device administrator role required in Azure AD
• AD DS rights similar to Intune Connector rights: https://docs.microsoft.com/en-us/mem/autopilot/windows-autopilot-hybrid#:~:text=The%20Intune%20Connector%20for%20your,the%20rights%20to%20create%20computers.
#>
[CmdletBinding()]
param(
[Parameter(Mandatory = $False)] [String] $TenantId = "",
[Parameter(Mandatory = $False)] [String] $AppId = "",
[Parameter(Mandatory = $False)] [String] $AppSecret = ""
)
Function Connect-ToGraph {
<#
.SYNOPSIS
Authenticates to the Graph API via the Microsoft.Graph.Authentication module.
.DESCRIPTION
The Connect-ToGraph cmdlet is a wrapper cmdlet that helps authenticate to the Intune Graph API using the Microsoft.Graph.Authentication module. It leverages an Azure AD app ID and app secret for authentication or user-based auth.
.PARAMETER Tenant
Specifies the tenant (e.g. contoso.onmicrosoft.com) to which to authenticate.
.PARAMETER AppId
Specifies the Azure AD app ID (GUID) for the application that will be used to authenticate.
.PARAMETER AppSecret
Specifies the Azure AD app secret corresponding to the app ID that will be used to authenticate.
.PARAMETER Scopes
Specifies the user scopes for interactive authentication.
.EXAMPLE
Connect-ToGraph -TenantId $tenantID -AppId $app -AppSecret $secret
-#>
[cmdletbinding()]
param
(
[Parameter(Mandatory = $false)] [string]$Tenant,
[Parameter(Mandatory = $false)] [string]$AppId,
[Parameter(Mandatory = $false)] [string]$AppSecret,
[Parameter(Mandatory = $false)] [string]$scopes
)
Process {
Import-Module Microsoft.Graph.Authentication
$version = (get-module microsoft.graph.authentication | Select-Object -expandproperty Version).major
if ($AppId -ne "") {
$body = @{
grant_type = "client_credentials";
client_id = $AppId;
client_secret = $AppSecret;
scope = "https://graph.microsoft.com/.default";
}
$response = Invoke-RestMethod -Method Post -Uri https://login.microsoftonline.com/$Tenant/oauth2/v2.0/token -Body $body
$accessToken = $response.access_token
$accessToken
if ($version -eq 2) {
write-host "Version 2 module detected"
$accesstokenfinal = ConvertTo-SecureString -String $accessToken -AsPlainText -Force
}
else {
write-host "Version 1 Module Detected"
Select-MgProfile -Name Beta
$accesstokenfinal = $accessToken
}
$graph = Connect-MgGraph -AccessToken $accesstokenfinal
Write-Host "Connected to Intune tenant $TenantId using app-based authentication (Azure AD authentication not supported)"
}
else {
if ($version -eq 2) {
write-host "Version 2 module detected"
}
else {
write-host "Version 1 Module Detected"
Select-MgProfile -Name Beta
}
$graph = Connect-MgGraph -scopes $scopes
Write-Host "Connected to Intune tenant $($graph.TenantId)"
}
}
}
function getdevicesandusers() {
$alldevices = getallpagination -url "https://graph.microsoft.com/beta/devicemanagement/manageddevices"
$outputarray = @()
foreach ($value in $alldevices) {
$objectdetails = [pscustomobject]@{
DeviceID = $value.id
DeviceName = $value.deviceName
OSVersion = $value.operatingSystem
PrimaryUser = $value.userPrincipalName
operatingSystem = $value.operatingSystem
AADID = $value.azureActiveDirectoryDeviceId
SerialNumber = $value.serialnumber
}
$outputarray += $objectdetails
}
return $outputarray
}
function getallpagination () {
<#
.SYNOPSIS
This function is used to grab all items from Graph API that are paginated
.DESCRIPTION
The function connects to the Graph API Interface and gets all items from the API that are paginated
.EXAMPLE
getallpagination -url "https://graph.microsoft.com/v1.0/groups"
Returns all items
.NOTES
NAME: getallpagination
#>
[cmdletbinding()]
param
(
$url
)
$response = (Invoke-MgGraphRequest -uri $url -Method Get -OutputType PSObject)
$alloutput = $response.value
$alloutputNextLink = $response."@odata.nextLink"
while ($null -ne $alloutputNextLink) {
$alloutputResponse = (Invoke-MGGraphRequest -Uri $alloutputNextLink -Method Get -outputType PSObject)
$alloutputNextLink = $alloutputResponse."@odata.nextLink"
$alloutput += $alloutputResponse.value
}
return $alloutput
}
Write-Host "Downloading and installing all required modules, please accept all prompts"
# Get NuGet
$provider = Get-PackageProvider NuGet -ErrorAction Ignore
if (-not $provider) {
Write-Host "Installing provider NuGet"
Find-PackageProvider -Name NuGet -ForceBootstrap -IncludeDependencies
}
# Get Graph Authentication module (and dependencies)
$module = Import-Module microsoft.graph.authentication -PassThru -ErrorAction Ignore
if (-not $module) {
Write-Host "Installing module microsoft.graph.authentication"
Install-Module microsoft.graph.authentication -Force -ErrorAction Ignore
}
#Import-Module microsoft.graph.authentication -Scope Global
$module = Import-Module microsoft.graph.groups -PassThru -ErrorAction Ignore
if (-not $module) {
Write-Host "Installing module MS Graph Groups"
Install-Module microsoft.graph.groups -Force -ErrorAction Ignore
}
Import-Module microsoft.graph.groups -Scope Global
$module2 = Import-Module Microsoft.Graph.Identity.DirectoryManagement -PassThru -ErrorAction Ignore
if (-not $module2) {
Write-Host "Installing module MS Graph Identity Management"
Install-Module Microsoft.Graph.Identity.DirectoryManagement -Force -ErrorAction Ignore
}
Import-Module microsoft.graph.Identity.DirectoryManagement -Scope Global
$module3 = Import-Module WindowsAutopilotIntuneCommunity -PassThru -ErrorAction Ignore
if (-not $module3) {
Write-Host "Installing module WindowsAutopilotIntuneCommunity"
Install-Module WindowsAutopilotIntuneCommunity -Force -ErrorAction Ignore
}
Import-Module WindowsAutopilotIntuneCommunity -Scope Global
$session = New-CimSession
$DomainIP = $null
$de = $null
$autopilotDevices = $null
$aadDevices = $null
$intuneDevices = $null
$localADfqdn = $null
$DomainIP = $null
$de = $null
$relatedIntuneDevice=$null
$FoundAADDevices=$null
$groupTag=""
$userPrincipalName=""
$displayName=""
$newdisplayName=""
$serial = (Get-CimInstance -CimSession $session -Class Win32_BIOS).SerialNumber
Write-Host "Will be processing device with serial number: " -NoNewline
Write-Host $serial -ForegroundColor Green
Write-Host "Connecting to Intune Graph"
if ($AppId -ne "") {
Connect-ToGraph -Tenant $TenantId -AppId $AppId -AppSecret $AppSecret
Write-Host "Connected to Intune tenant $TenantId using app-based authentication (Azure AD authentication not supported)"
}
else {
$graph = Connect-ToGraph -scopes "Group.ReadWrite.All, Device.ReadWrite.All, DeviceManagementManagedDevices.ReadWrite.All, DeviceManagementServiceConfig.ReadWrite.All, GroupMember.ReadWrite.All"
Write-Host "Connected to Intune tenant $($graph.TenantId)"
if ($AddToGroup) {
$aadId = Connect-ToGraph -scopes "Group.ReadWrite.All, Device.ReadWrite.All, DeviceManagementManagedDevices.ReadWrite.All, DeviceManagementServiceConfig.ReadWrite.All, GroupMember.ReadWrite.All"
Write-Host "Connected to Azure AD tenant $($aadId.TenantId)"
}
}
Write-Host "Loading all objects. This can take a while on large tenants"
$aadDevices = getallpagination -url "https://graph.microsoft.com/beta/devices"
$devices = getdevicesandusers
$intunedevices = $devices | Where-Object {$_.operatingSystem -eq "Windows"}
##$autopilotDevices = Get-AutopilotDevice | Get-MSGraphAllPages
$autopilotDevices = Get-AutopilotDevice
$localADfqdn = Read-Host -Prompt 'If you want to *DELETE* this computer from your local Active Directory domain and have Domain Controllers in line of sight, please enter the DNS of your AD DS domain (ie domain.local or contoso.com), otherwise, to skip AD DS deletion, hit "Enter"'
if($localADfqdn -ne "" -and $localADfqdn -ne $null)
{
$DomainIP = (Test-Connection -ComputerName $localADfqdn -Count 1 -ErrorAction SilentlyContinue).IPV4Address.IPAddressToString
}
# Let's connect to on-prem AD
if($DomainIP -ne $null)
{
Write-Host Connecting to $DomainIP
Write-Host "Please provide the username and the password (DOMAIN\UserName)"
$ADUserName = Read-Host -Prompt 'Username'
$ADPassword = Read-Host -Prompt 'Password' -AsSecureString
$ADPassword = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto([System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($ADPassword))
$de = New-Object System.DirectoryServices.DirectoryEntry("LDAP://$DomainIP", $ADUserName, $ADPassword) -ErrorAction Stop
Write-Host Connected to $de.distinguishedName
}
$currentAutopilotDevice = $autopilotDevices | Where-Object {$_.serialNumber -eq $serial}
if ($currentAutopilotDevice -ne $null)
{
# Find the objects linked to the Autopilot device
Write-Verbose $currentAutopilotDevice | Format-List -Property *
[array]$relatedIntuneDevice = $intuneDevices | Where-Object {
$_.serialNumber -eq $currentAutopilotDevice.serialNumber -or
$_.serialNumber -eq $currentAutopilotDevice.serialNumber.replace(' ','') -or
$_.id -eq $currentAutopilotDevice.managedDeviceId -or
$_.azureADDeviceId -eq $currentAutopilotDevice.azureActiveDirectoryDeviceId}
[array]$FoundAADDevices = $aadDevices | Where-Object {
$_.DeviceId -eq $currentAutopilotDevice.azureActiveDirectoryDeviceId -or
$_.DeviceId -iin $relatedIntuneDevice.azureADDeviceId -or
$_.DevicePhysicalIds -match $currentAutopilotDevice.Id
}
# Display a summary for this device and found related Intune /AAD devices
Write-Host "User:" $currentAutopilotDevice.userPrincipalName
Write-Host "Group Tag:" $currentAutopilotDevice.groupTag
$userPrincipalName = $currentAutopilotDevice.userPrincipalName
$groupTag = $currentAutopilotDevice.groupTag
Write-Host "Found Related Intune Devices:"
$relatedIntuneDevice | Format-Table -Property deviceName, id, userID, enrolledDateTime, LastSyncDateTime, operatingSystem, osVersion, deviceEnrollmentType
Write-Host "Found Related AAD Devices:"
$FoundAADDevices | Format-Table -Property DisplayName, ObjectID, DeviceID, AccountEnabled, ApproximateLastLogonTimeStamp, DeviceTrustType, DirSyncEnabled, LastDirSyncTime -AutoSize
if($relatedIntuneDevice -ne $null){
foreach($relIntuneDevice in $relatedIntuneDevice) {
$displayName=$relIntuneDevice.deviceName
if($Host.UI.PromptForChoice('Delete Intune Device', 'Do you want to *DELETE* ' + $relIntuneDevice.deviceName +' from the Intune?', @('&Yes'; '&No'), 1) -eq 0){
$deviceid = $relIntuneDevice.id
$url = "https://graph.microsoft.com/beta/deviceManagement/managedDevices/$deviceid"
$response = Invoke-MgGraphRequest -Uri $url -Method Delete -OutputType PSObject
#Remove-IntuneManagedDevice -managedDeviceId $relIntuneDevice.id -ErrorAction Continue
}
}
}
if($Host.UI.PromptForChoice('Delete Autopilot Device', 'Do you want to *DELETE* the device with serial number ' + $currentAutopilotDevice.serialNumber +' from the Autopilot?', @('&Yes'; '&No'), 1) -eq 0){
$id = $currentAutopilotDevice.id
$graphApiVersion = "beta"
$Resource = "deviceManagement/windowsAutopilotDeviceIdentities"
$uri = "https://graph.microsoft.com/$graphApiVersion/$Resource/$id"
Invoke-MGGraphRequest -Uri $uri -Method DELETE
#Remove-AutopilotDevice -id $currentAutopilotDevice.id -ErrorAction Continue
$SecondsSinceLastSync = $null
$SecondsSinceLastSync = (New-Timespan -Start (Get-AutopilotSyncInfo).lastSyncDateTime.ToUniversalTime() -End (Get-Date).ToUniversalTime()).TotalSeconds
If ($SecondsSinceLastSync -ge 610)
{
Invoke-AutopilotSync
}
else
{
Write-Host "Last sync was" $SecondsSinceLastSync "seconds ago, will sleep for" (610-$SecondsSinceLastSync) "seconds before trying to sync."
if($Host.UI.PromptForChoice('Autopilot Sync','Do you want to wait?', @('&Yes'; '&No'), 1) -eq 0){Start-Sleep -Seconds (610-$SecondsSinceLastSync) ; Invoke-AutopilotSync}
}
while (Get-AutopilotDevice | Where-Object {$_.serialNumber -eq $serial} -ne $null){
Start-Sleep -Seconds 5
}
Write-Host "Deleted"
}
}
if($relatedIntuneDevice -eq $null -and $FoundAADDevices -eq $null ){
# this serial number was not found in Autopilot Devices, but we still want to check intune devices with this serial number and search AAD and AD DS for that one
[array]$relatedIntuneDevice = $intuneDevices | Where-Object {$_.serialNumber -eq $serial -or $_.serialNumber -eq $serial.replace(' ','')}
[array]$FoundAADDevices = $aadDevices | Where-Object { $_.DeviceId -eq $relatedIntuneDevice.azureADDeviceId }
Write-Host "Found Related Intune Devices:"
$relatedIntuneDevice | Format-Table -Property deviceName, id, userID, enrolledDateTime, LastSyncDateTime, operatingSystem, osVersion, deviceEnrollmentType
Write-Host "Found Related AAD Devices:"
$FoundAADDevices | Format-Table -Property DisplayName, ObjectID, DeviceID, AccountEnabled, ApproximateLastLogonTimeStamp, DeviceTrustType, DirSyncEnabled, LastDirSyncTime -AutoSize
if($relatedIntuneDevice -ne $null){
foreach($relIntuneDevice in $relatedIntuneDevice) {
$displayName=$relIntuneDevice.deviceName
if($Host.UI.PromptForChoice('Delete Intune Device', 'Do you want to *DELETE* ' + $relIntuneDevice.deviceName +' from the Intune?', @('&Yes'; '&No'), 1) -eq 0){
$deviceid = $relIntuneDevice.id
$url = "https://graph.microsoft.com/beta/deviceManagement/managedDevices/$deviceid"
$response = Invoke-MgGraphRequest -Uri $url -Method Delete -OutputType PSObject
#Remove-IntuneManagedDevice -managedDeviceId $relIntuneDevice.id -ErrorAction Stop
}
}
}
}
foreach($aadDevice in $FoundAADDevices){
if($de -ne $null){
$escapedguid = "\" + ((([GUID]$aadDevice.deviceID).ToByteArray() |ForEach-Object {"{0:x}" -f $_}) -join '\')
$searcher = New-Object System.DirectoryServices.DirectorySearcher($de,"(&(objectCategory=Computer)(ObjectGUID=$escapedguid))")
$obj = $searcher.FindOne()
if ($obj -ne $null){
$objdel = $obj.GetDirectoryEntry()
if($Host.UI.PromptForChoice('Delete Active Directory Device', 'Do you want to *DELETE* the device with the name ' + $objdel.Name +' from AD DS?', @('&Yes'; '&No'), 1) -eq 0){
$objdel.DeleteTree()
}
}
}
if($Host.UI.PromptForChoice('Delete Azure Active Directory Device', 'Do you want to *DELETE* the device with the name ' + $aadDevice.DisplayName +' from Azure AD?', @('&Yes'; '&No'), 1) -eq 0){
Remove-mgdevice -DeviceId $aadDevice.Id -ErrorAction SilentlyContinue
}
}
# Get the hash (if available)
$devDetail = (Get-CimInstance -CimSession $session -Namespace root/cimv2/mdm/dmmap -Class MDM_DevDetail_Ext01 -Filter "InstanceID='Ext' AND ParentID='./DevDetail'")
if ($devDetail)
{
$hash = $devDetail.DeviceHardwareData
if($Host.UI.PromptForChoice('Add Autopilot Device', 'Do you want to *ADD* the device with serial number ' + $serial +' to Autopilot?', @('&Yes'; '&No'), 1) -eq 0){
$newuserPrincipalName = Read-Host -Prompt "Change assigned user [$userPrincipalName] (type a new value or hit enter to keep the old one. Enter None to not set a user)"
if (![string]::IsNullOrWhiteSpace($newuserPrincipalName)){ $userPrincipalName = $newuserPrincipalName }
$newgroupTag = Read-Host -Prompt "Change group tag [$groupTag] (type a new value or hit enter to keep the old one)"
if (![string]::IsNullOrWhiteSpace($newgroupTag)){ $groupTag = $newgroupTag }
##If "None has been selected, don't add assigneduser"
if ($userPrincipalName -eq "None") {
Add-AutopilotImportedDevice -serialNumber $serial -hardwareIdentifier $hash -groupTag $groupTag
}
else {
Add-AutopilotImportedDevice -serialNumber $serial -hardwareIdentifier $hash -groupTag $groupTag -assignedUser $userPrincipalName
}
$SecondsSinceLastSync = $null
$SecondsSinceLastSync = (New-Timespan -Start (Get-AutopilotSyncInfo).lastSyncDateTime.ToUniversalTime() -End (Get-Date).ToUniversalTime()).TotalSeconds
If ($SecondsSinceLastSync -ge 610)
{
Invoke-AutopilotSync
}
else
{
Write-Host "Last sync was" $SecondsSinceLastSync "seconds ago, will sleep for" (610-$SecondsSinceLastSync) "seconds before trying to sync."
if($Host.UI.PromptForChoice('Autopilot Sync','Do you want to wait?', @('&Yes'; '&No'), 0) -eq 0){Start-Sleep -Seconds (610-$SecondsSinceLastSync); Invoke-AutopilotSync}
}
}
}
if($Host.UI.PromptForChoice('Computer name','Do you want to configure a unique name for a device? This name will be ignored in Hybrid Azure AD joined deployments. Device name still comes from the domain join profile for Hybrid Azure AD devices. This will only work if you have not deleted the device from AP recently.', @('&Yes'; '&No'), 1) -eq 0){
$newdisplayName = Read-Host -Prompt "[$displayName] (type a new value or hit enter to keep the old one)"
if (![string]::IsNullOrWhiteSpace($displayName) -or ![string]::IsNullOrWhiteSpace($newdisplayName)){
if (![string]::IsNullOrWhiteSpace($newdisplayName) ){ $displayName = $newdisplayName }
$autopilotDevices = Get-AutopilotDevice
[array]$currentAutopilotDevices = $autopilotDevices | Where-Object {$_.serialNumber -eq $serial}
foreach($currentAutopilotDevice in $currentAutopilotDevices){
Set-AutopilotDevice -id $currentAutopilotDevice.id -displayName $displayName
}
}
}
# SIG # Begin signature block
# MIIoGQYJKoZIhvcNAQcCoIIoCjCCKAYCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCAUyceYFJ6/w0h2
# Ca0kDbGECibXcDmfVDNF8NP+XIzM06CCIRwwggWNMIIEdaADAgECAhAOmxiO+dAt
# 5+/bUOIIQBhaMA0GCSqGSIb3DQEBDAUAMGUxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xJDAiBgNV
# BAMTG0RpZ2lDZXJ0IEFzc3VyZWQgSUQgUm9vdCBDQTAeFw0yMjA4MDEwMDAwMDBa
# Fw0zMTExMDkyMzU5NTlaMGIxCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2Vy
# dCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xITAfBg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