When upgrading Snow License Manager (SLM), the Snow services must be stopped. If a monitoring tool restarts the services, or if there is an issue stopping them, the upgrade can fail.
This article provides a PowerShell script that can be used to stop Snow services or stop the services and change their startup type to Disabled. After the upgrade is complete, the script can also be used to set the Snow services to Automatic and start them again.
The script includes multiple options. Uncomment the required actions at the bottom of the script before running it.
###
# Description:
# Stop / Start All Snow Services and change startup to Automatic / Disabled
# Uncomment the required actions at the bottom of the script.
#
###
# ---- ELEVATION CHECK ----
if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()
).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs
exit
}
# ---- HELPER ----
function Get-SnowServices {
Get-Service -Name "Snow*" -ErrorAction SilentlyContinue
}
# ---- STARTUP TYPE ----
function Set-ServicesToDisabled {
Write-Host "`nSetting Snow services to Disabled..." -ForegroundColor Magenta
foreach ($service in Get-SnowServices) {
try {
Set-Service -Name $service.Name -StartupType Disabled -ErrorAction Stop
Write-Host "DISABLED: $($service.DisplayName)" -ForegroundColor Green
}
catch {
Write-Host "ERROR: $($service.DisplayName) - $($_.Exception.Message)" -ForegroundColor Red
}
}
}
function Set-ServicesToAutomatic {
Write-Host "`nSetting Snow services to Automatic..." -ForegroundColor Magenta
foreach ($service in Get-SnowServices) {
try {
Set-Service -Name $service.Name -StartupType Automatic -ErrorAction Stop
Write-Host "AUTOMATIC: $($service.DisplayName)" -ForegroundColor Green
}
catch {
Write-Host "ERROR: $($service.DisplayName) - $($_.Exception.Message)" -ForegroundColor Red
}
}
}
# ---- STOP SERVICES ----
function Stop-SnowServices {
Write-Host "`nStopping Snow services..." -ForegroundColor Magenta
foreach ($service in Get-SnowServices) {
if ($service.Status -eq "Stopped") {
Write-Host "ALREADY STOPPED: $($service.DisplayName)" -ForegroundColor Yellow
continue
}
try {
Stop-Service -Name $service.Name -Force -ErrorAction Stop
# Verify actual state
Start-Sleep -Seconds 1
$svc = Get-CimInstance Win32_Service -Filter "Name='$($service.Name)'"
if ($svc.State -eq "Stopped") {
Write-Host "STOPPED: $($svc.DisplayName)" -ForegroundColor Green
}
else {
Write-Host "FAILED TO STOP: $($svc.DisplayName) (State: $($svc.State))" -ForegroundColor Red
}
}
catch {
Write-Host "ERROR: $($service.DisplayName) - $($_.Exception.Message)" -ForegroundColor Red
}
}
}
# ---- START SERVICES ----
function Start-SnowServices {
Write-Host "`nStarting Snow services..." -ForegroundColor Magenta
foreach ($service in Get-SnowServices) {
$svc = Get-CimInstance Win32_Service -Filter "Name='$($service.Name)'"
if ($svc.StartMode -eq "Disabled") {
Write-Host "SKIPPED (Disabled): $($svc.DisplayName)" -ForegroundColor Yellow
continue
}
if ($svc.State -eq "Running") {
Write-Host "ALREADY RUNNING: $($svc.DisplayName)" -ForegroundColor Yellow
continue
}
try {
Start-Service -Name $svc.Name -ErrorAction Stop
Start-Sleep -Seconds 1
$svc = Get-CimInstance Win32_Service -Filter "Name='$($service.Name)'"
if ($svc.State -eq "Running") {
Write-Host "STARTED: $($svc.DisplayName)" -ForegroundColor Green
}
else {
Write-Host "FAILED TO START: $($svc.DisplayName) (State: $($svc.State))" -ForegroundColor Red
}
}
catch {
Write-Host "ERROR: $($svc.DisplayName) - $($_.Exception.Message)" -ForegroundColor Red
}
}
}
# ---- STOP PENDING SERVICES ----
function Stop-PendingServices {
Write-Host "`nChecking for stuck services (Stop Pending)..." -ForegroundColor Magenta
$services = Get-CimInstance Win32_Service | Where-Object { $_.State -eq "Stop Pending" }
if (-not $services) {
Write-Host "No services stuck in Stop Pending state." -ForegroundColor Green
return
}
foreach ($svc in $services) {
try {
Stop-Process -Id $svc.ProcessId -Force -ErrorAction Stop
Write-Host "FORCE KILLED: $($svc.DisplayName)" -ForegroundColor Green
}
catch {
Write-Host "ERROR: $($svc.DisplayName) - $($_.Exception.Message)" -ForegroundColor Red
}
}
}
# ---- SERVICE REPORT ----
function Get-ServiceReport {
Write-Host "`nSnow Service Status Report:" -ForegroundColor Magenta
$services = Get-CimInstance Win32_Service | Where-Object { $_.Name -like "Snow*" }
if (-not $services) {
Write-Host "No Snow services found." -ForegroundColor Yellow
return
}
foreach ($svc in $services) {
$colour = switch ($svc.State) {
"Running" { "Green" }
"Stopped" { "Red" }
default { "Yellow" }
}
Write-Host "$($svc.DisplayName): $($svc.State) ($($svc.StartMode))" -ForegroundColor $colour
}
}
# ---- ACTIONS ----
# Uncomment the required actions.
# Stop-SnowServices
# Start-SnowServices
# Set-ServicesToDisabled
# Set-ServicesToAutomatic
# Stop-PendingServices #(Stopping state loop)
Get-ServiceReport
Write-Host "`nIf all services are not in the expected state, run again." -ForegroundColor YellowRelated Articles
From v11.11.1, the service-startup type for lmgrd is set to Automatic (Delayed Start) in the Windows Services Manager. 4Number of Views FlexNet Inventory Agent tracker (ndtrack) process may trigger a security software warning due to PowerShell script executi… 89Number of Views PowerShell script to monitor the log files generated and deleted in a folder 12Number of Views PowerShell script to return the name of the application process that is using a port 5Number of Views PowerShell script to rebuild the Snow Update Service 30Number of Views
Hi, I am Reva - Ask me anything.
No new updates
Thanks for the feedback!
Your feedback has been saved.Rate this response:
Add Additional feedback ( Optional )
Are you sure you want to cancel
the case creation?
Are you sure you want to cancel the case creation?
Are you sure you want to close this case
| Products | Region | Phone Numbers |
|---|---|---|
| FlexNet Operations FlexNet Embedded FlexNet Publisher FlexNet Connect FlexNet Code Insight InstallAnywhere InstallShield |
North America * |
+1 630-332-2513 (toll) +1 877-279-2853 (toll-free in North America) |
| Europe * |
+44 1925 944367 (toll) +44 800 047 8642 (toll-free in Europe) |
|
| Japan * | +81 3-4540-5335 (select option 2) | |
| Australia * |
+61 3 9895 2177 +61 1800 560 603 (toll-free in Australia) |
|
|
Usage Intelligence (formerly
Revulytics) Compliance Intelligence |
Please use the Case Portal to submit your support ticket or reach out to your Revenera contact. | |
Revenera Assistant
Case id: 00001065
Activity: Status change: 2 hours ago