flydean

Untitled

Dec 15th, 2025
7,278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PowerShell 0.86 KB | Cybersecurity | 0 0
  1. # Define registry paths
  2. $regPath1 = "HKLM:\SOFTWARE\Microsoft\Provisioning\Diagnostics\AutoPilot"
  3. $regPath2 = "HKLM:\SOFTWARE\Microsoft\Provisioning\AutopilotPolicyCache"
  4.  
  5. # Check first path
  6. if (Test-Path $regPath1) {
  7.     $values1 = Get-ItemProperty -Path $regPath1
  8.     Write-Output "From Diagnostics\AutoPilot:"
  9.     Write-Output "Tenant ID: $($values1.CloudAssignedTenantID)"
  10.     Write-Output "Tenant Domain: $($values1.CloudAssignedTenantDomain)"
  11. } else {
  12.     Write-Output "Registry path not found: $regPath1"
  13. }
  14.  
  15. # Check second path
  16. if (Test-Path $regPath2) {
  17.     $values2 = Get-ItemProperty -Path $regPath2
  18.     Write-Output "From AutopilotPolicyCache:"
  19.     Write-Output "Tenant ID: $($values2.CloudAssignedTenantID)"
  20.     Write-Output "Tenant Domain: $($values2.CloudAssignedTenantDomain)"
  21. } else {
  22.     Write-Output "Registry path not found: $regPath2"
  23. }
  24.  
Tags: intune
Advertisement