Last active
May 6, 2024 09:33
-
-
Save MrWyss-MSFT/500b2270b0b23b2fdc9ddc78092c355d to your computer and use it in GitHub Desktop.
Saves Intune Registry Path as Favourites in Regedit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Function Get-EnrollmentID { | |
| $baseKeyPath = 'HKLM:\SOFTWARE\Microsoft\Enrollments' | |
| $searchValueName = 'ProviderID' | |
| $searchValueData = 'MS DM Server' | |
| # Get all subkeys under the base key | |
| $subkeys = Get-ChildItem -Path $baseKeyPath -Recurse | Where-Object { $_.PSIsContainer } | |
| # Iterate through each subkey | |
| foreach ($subkey in $subkeys) { | |
| # Check if the subkey has the specified value name and data | |
| $value = Get-ItemProperty -Path $subkey.PSPath -Name $searchValueName -ErrorAction SilentlyContinue | |
| if ($null -ne $value -and $value.$searchValueName -eq $searchValueData) { | |
| Return $subkey.PSChildName | |
| } | |
| } | |
| } | |
| $EnrollmentID = Get-EnrollmentID | |
| $Keys = @( | |
| @{ Name = 'π Policy Manager'; | |
| Value = "Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PolicyManager\current\device"; | |
| Help = "Intune Polcies Location" | |
| } | |
| @{ Name = 'βοΈ ESP Settings'; | |
| Value = "Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Enrollments\$EnrollmentID\FirstSync"; | |
| Help = "ESP Settings Location" | |
| } | |
| @{ Name = 'βοΈ Autopilot Settings'; | |
| Value = "Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Provisioning\AutopilotSettings"; | |
| Help = "Autopilot Settings Location" | |
| } | |
| @{ Name = 'π©Ί Autopilot Policy Cache'; | |
| Value = "Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Provisioning\AutopilotPolicyCache"; | |
| Help = "Autopilot Policy Cache Location" | |
| } | |
| @{ Name = 'β ESP Tracking Info'; | |
| Value = "Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Autopilot\EnrollmentStatusTracking\ESPTrackingInfo\Diagnostics"; | |
| Help = "ESP Tracking Info Location" | |
| } | |
| @{ Name = 'πͺ IME Win32Apps'; | |
| Value = "Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\IntuneManagementExtension\Win32Apps"; | |
| Help = "IntuneManagementExtension Win32Apps Location" | |
| } | |
| @{ Name = 'π©Ί AutoPilot Diagnostic Settings'; | |
| Value = "Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Provisioning\Diagnostics\AutoPilot"; | |
| Help = "AutoPilot Diagnostic Settings Location" | |
| } | |
| @{ Name = 'π RebootRequiredURIs'; | |
| Value = "Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Provisioning\SyncML\RebootRequiredURIs"; | |
| Help = "CSPs that require a reboot" | |
| } | |
| @{ Name = 'π MDMWins (Hybrid Join only)'; | |
| Value = "Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MDMWins"; | |
| Help = "If MDMWinsOverGP is enabled, it shows which GPOs are being overridden by MDM" | |
| } | |
| ) | |
| Write-host "`nSetting up the Registry Favorites, find them in the Registry Editor under Favorites`n" -ForegroundColor Green | |
| New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit" -Name Favorites -Force | out-null | |
| foreach ($Key in $Keys) { | |
| Write-host "Save Favorite $($Key.Name) with value $($Key.Value)" | |
| New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit\Favorites" -Name $key.Name -Value $key.Value -PropertyType String -Force | Out-Null | |
| } | |
| Write-host "`nTip: Open multiple instances of the Registry Editor with regedit -m" -ForegroundColor Yellow |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment