Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
intune-remove-silverlight [2019/09/10 16:56] jsanders created |
intune-remove-silverlight [2020/02/17 21:04] (current) jsanders [Intune: Uninstalling an Old Management Engine] |
||
---|---|---|---|
Line 1: | Line 1: | ||
===== Intune: Uninstalling an Old Management Engine ===== | ===== Intune: Uninstalling an Old Management Engine ===== | ||
- | This article focuses on removing the Silverlight-linked Intune Management Engine from an endpoint machine. | + | This article focuses on removing the Silverlight-linked [[intune|Intune]] Management Engine from an endpoint machine running [[start#windows|Windows 10]]. |
==== How-To ==== | ==== How-To ==== | ||
Before any scripts can be run, you will first need to identify the Intune service's GUID.\\ | Before any scripts can be run, you will first need to identify the Intune service's GUID.\\ | ||
Line 9: | Line 9: | ||
\\ | \\ | ||
3. Next, open an elevated command prompt window and //cd// to: | 3. Next, open an elevated command prompt window and //cd// to: | ||
- | C:\Program Files\Microsoft\OnlineManagement\Common | + | C:\Program Files\Microsoft\OnlineManagement\Common |
\\ | \\ | ||
4. Run the following executable, along with its parameters, in the command prompt window: | 4. Run the following executable, along with its parameters, in the command prompt window: | ||
- | ProvisioningUtil.exe /UninstallClient /ServiceId {GUID} /TaskName “tempTask” /SubEventId 16 | + | ProvisioningUtil.exe /UninstallClient /ServiceId {GUID} /TaskName “tempTask” /SubEventId 16 |
- | **Note**: Substitute {GUID} with the Intune Service GUID obtained in Step 2.\\ | + | **Note**: Substitute {GUID} with the Intune service's GUID obtained in Step 2.\\ |
- | ==== Self-Contained Script Package ==== | + | ==== Automatic Uninstall Script ==== |
- | The above steps have been compiled into a self-contained script package, which can be downloaded [[https://jsanders.me/wiki/lib/exe/fetch.php?media=files:uninstall-intune.zip|here]]. Extract all files from the zip file into a single location, then run the batch script as administrator. | + | Paste the below script into an elevated PowerShell console to automatically retrieve the Intune service GUID and substitute it into the uninstall script. This will completely uninstall the management agent upon successful run.\\ |
+ | function Get-ServiceId { | ||
+ | #Set the registry path containing the service ID | ||
+ | $RegistryPath = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\OnlineManagement" | ||
+ | try { | ||
+ | #Get all the names of the items in the registry location | ||
+ | $RegistryItems = (Get-ChildItem -Path Registry::$RegistryPath -ErrorAction Stop).Name | ||
+ | #Loop through all the results | ||
+ | foreach ($RegistryItem in $RegistryItems) { | ||
+ | #Find the result that starts with the registry location followed by the first sign of a GUID | ||
+ | if ($RegistryItem.StartsWith("$RegistryPath\{")) { | ||
+ | #Replace the registry location with nothing to get the GUID | ||
+ | $ServiceId = $RegistryItem.Replace("$RegistryPath\","") | ||
+ | break | ||
+ | } | ||
+ | } | ||
+ | return $ServiceId | ||
+ | } | ||
+ | catch { | ||
+ | Write-Output "The Microsoft Intune client is not installed" | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function Start-Uninstall { | ||
+ | param ( | ||
+ | [parameter(Mandatory=$true)]$ServiceId | ||
+ | ) | ||
+ | try { | ||
+ | #Set the ProvisioningUtil location and parameters | ||
+ | $ProvisioningUtilPath = "C:\Program Files\Microsoft\OnlineManagement\Common" | ||
+ | $ProvisioningUtilExecutable = "ProvisioningUtil.exe" | ||
+ | $ProvisioningUtilArguments = "/UninstallClient /ServiceId $ServiceId /TaskName 'tempTask' /SubEventId 16" | ||
+ | #Trigger the uninstall of the Microsoft Intune client | ||
+ | Start-Process -FilePath "$($ProvisioningUtilPath)\$($ProvisioningUtilExecutable)" -ArgumentList $ProvisioningUtilArguments -Wait -PassThru | ||
+ | } | ||
+ | catch { | ||
+ | Write-Output "Failed to trigger the uninstall of the Microsoft Intune client" | ||
+ | } | ||
+ | } | ||
+ | echo "Running" | ||
+ | Start-Uninstall (Get-ServiceId) | ||
+ | ==== Self-Contained Automatic Uninstall Script Package ==== | ||
+ | The above steps have been compiled into a self-contained script package, which can be downloaded [[https://jsanders.me/wiki/lib/exe/fetch.php?media=files:uninstall-intune.zip|here]]. Extract all files from the zip file into a single location, then run the .bat file as administrator. | ||
===== References ===== | ===== References ===== | ||
- [[https://www.petervanderwoude.nl/post/uninstall-the-microsoft-intune-client/| Uninstall the Microsoft Intune Client]]\\ | - [[https://www.petervanderwoude.nl/post/uninstall-the-microsoft-intune-client/| Uninstall the Microsoft Intune Client]]\\ | ||
- [[https://gallery.technet.microsoft.com/Uninstall-the-Intune-b42111d1|TechNet - Uninstall the Microsoft Intune client via PowerShell]] | - [[https://gallery.technet.microsoft.com/Uninstall-the-Intune-b42111d1|TechNet - Uninstall the Microsoft Intune client via PowerShell]] |