Steps to uninstall Workflow Manager from Servers using PowerShell
commands.
cls
Write-Host "Clean uninstallation binaries. There are the recommended steps on the proper order to remove Workflow Manager, Workflow Manger Client, Service Bus and Windows Fabric" -ForegroundColor Yellow
# Step 1: Remove WFHost and SB Host
# Step 2: Checking whether control panel WFM and Service Bus Binariles are available or not.
# Step 3: Check Registry Keys available or not
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Service Bus] and file explorer paths
exist or not C:\Program Files
# Step 4: Uninstall workflow Manger 1.0, Workflow Manger
Client 1.0, Service Bus 1.0, Service bus 1.1, and Windows Fabric from the control
panel
# Step 5: Delete Registry Key
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Service Bus and Service Bus Gateway]
# Step 6: Delete Folders under C:\Program Files, C:\Program
Files (x86), C:\ProgramData == Service Bus, Workflow Manager, and Windows Fabric.
# Step 7: Restart the computer
# Step 1 : Remove WFHost and SB Host
Remove-WFHost -Verbose;
Remove-SBHost -Verbose;
# Step 2: Checking control panel WFM and Service Bus Binariles
available.
Write-Host "Checking
control panel Binaries " -ForegroundColor
White
$Programs = @("Workflow Manger 1.0","Workflow manager client 1.0","Service Bus 1.1","Service Bus 1.0","Windows Fabric","10915_WorkflowMgr_Install_Bundle")
Foreach($Program
in $Programs)
{
$app=Get-WmiObject -Class Win32_Product
| Where-Object
{
$_.Name -match "$Program"
}
Write-Host "Control panel" $app
-ForegroundColor White
$app.Uninstall()
}
# Step 3: Check Registry Keys available or not
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Service Bus] and whether file explorer paths
exists or not C:\Program Files
$Path1 = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Workflow
Manager"
$Path2 = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Workflow
Manger Client"
$Path3 = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
Fabric"
$Path4 = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Service
Bus"
$Path5 = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Service
Bus GateWay"
$Path6 = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Service
Bus Message Broker"
$Path7 = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Service
Bus Resource Provider"
$Path8 = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Service
Bus VSS"
$Path9 = "C:\Program Files\Workflow Manger"
$Path10 = "C:\Program Files\Windows Fabric"
$Path11 = "C:\Program Files\Service Bus"
$Path12 = "C:\Program Files (x86)\Workflow Manger"
$Path13 = "C:\Program Files (x86)\Windows Fabric"
$Path14 = "C:\Program Files (x86)\Service Bus"
$Path15 = "C:\ProgramData\Microsoft\Workflow Manager"
$Path16 = "C:\ProgramData\Microsoft\Windows Fabric"
$Path17 = "C:\ProgramData\Microsoft\Service Bus"
$Path18 = "C:\ProgramData\Workflow Manager"
$Path19 = "C:\ProgramData\Windows Fabric"
$Path20 = "C:\ProgramData\Service Bus"
$Path21 = "C:\ProgramData\Microsoft\SF"
# Validating All Paths exist are not
$AllPathCheck =@($Path1,$Path2,$Path3,$Path4,$Path5,$Path6,$Path7,$Path8,$Path9,$Path10,$Path11,$Path12,$Path13,$Path14,$Path15,$Path16,$Path17,$Path18,$Path19,$Path20,$Path21)
foreach($item
in $AllPathCheck)
{
if((Test-Path -Path $item) -eq $true)
{
Write-Host
"Registry Key exists" $item -ForegroundColor
Green
}
else
{
Write-Host
"===================================="
-ForegroundColor White
Write-Host
"Registry Key path not Exists" $item -ForegroundColor
Red
}
}
# Step 4: Uninstall workflow Manger 1.0, Workflow Manager
Client 1.0, Service Bus 1.0, Service bus 1.1, and Windows Fabric from the control
panel
Write-Host "Uninstall/Deleting Controlpanel Binaries" -ForegroundColor White
Foreach($Program
in $Programs)
{
$app=Get-WmiObject -Class Win32_Product
| Where-Object
{
$_.Name -match "$Program"
}
Write-Host "Deleting from control panel" $app -ForegroundColor
White
$app.Uninstall()
}
# Step 5: Delete Registry Key [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Service Bus and Service Bus Gateway]
Remove-Item "Workflow
Manager"
Remove-Item "Workflow
Manager Client"
Remove-Item "Windows
Fabric"
Remove-Item "Service
Bus"
Remove-Item "Service
Bus Gateway"
Remove-Item "Service
Bus Message Broker"
Remove-Item "Service
Bus Resource Provider"
Remove-Item "Service Bus VSS"
# Step 6: Delete Folders under C:\Program Files, C:\Program
Files (x86), C:\ProgramData == Service Bus, Workflow Manger, and Windows Fabric.
# Delete Folders under C:\Program Files
Set-Location -Path "C:\Program Files (x86)"
Remove-Item "Workflow
Manager" -Force -ErrorAction SilentlyContinue
Remove-Item "Windows
Fabric" -Force -ErrorAction SilentlyContinue
Remove-Item "Service
Bus" -Force -ErrorAction SilentlyContinue
Set-Location -Path "C:\Program Files (x86)"
Remove-Item "Workflow
Manager" -Force -ErrorAction SilentlyContinue
Remove-Item "Windows
Fabric" -Force -ErrorAction SilentlyContinue
Remove-Item "Service
Bus" -Force -ErrorAction SilentlyContinue
Set-Location -Path "C:\ProgramData\Microsoft"
Remove-Item "Workflow
Manager" -Force -ErrorAction SilentlyContinue
Remove-Item "Windows
Fabric" -Force -ErrorAction SilentlyContinue
Remove-Item "Service
Bus" -Force -ErrorAction SilentlyContinue
Set-Location -Path "C:\ProgramData"
Remove-Item "Workflow
Manager" -Force -ErrorAction SilentlyContinue
Remove-Item "Windows
Fabric" -Force -ErrorAction SilentlyContinue
Remove-Item "Service
Bus" -Force -ErrorAction SilentlyContinue
Set-Location -Path "C:\ProgramData\Microsoft"
Remove-Item "SF"
-Force -ErrorAction
SilentlyContinue
# Step 7: Restart the computer
Pause
Restart-Computer -Force
Write-Host
Start-Sleep 3
0 Comments