Use this PowerShell script to stop and remove the SnowMongoDB Windows service from a Snow License Manager installation.
This script is typically used when the MongoDB service is corrupted or misconfigured and must be removed before recreating the service. See PowerShell script to rebuild the Snow MongoDB Windows service for instructions on rebuilding.
How it works
-
Defines service name
The variable$serviceNameis set to"SnowMongoDB", which is the name of the service to be deleted. -
Checks if service exists
The script usesGet-Servicewith-ErrorAction SilentlyContinueto check if the service is present without throwing an error if it does not exist. -
Stops the service (if found)
If the service exists, it is stopped usingStop-Service -Forceto ensure it terminates even if it is running. -
Deletes the service
The script callssc.exe deleteto remove the service entry from the Windows Service Control Manager. -
Outputs messages
Informative messages are displayed to indicate progress:- Service stopping
- Service deletion
- Confirmation or notification if the service does not exist
Key commands
Get-Service -Name <service>: Checks for the service.Stop-Service -Name <service> -Force: Stops the service.sc.exe delete <service>: Deletes the service from the system.
Before you begin
- Ensure you run the script with administrative privileges, as stopping and deleting services requires elevated rights.
- Double-check the service name before running the script to avoid removing the wrong service.
# PowerShell script to delete the SnowMongoDB service
$serviceName = "SnowMongoDB"
# Check if the service exists
$service = Get-Service -Name $serviceName -ErrorAction SilentlyContinue
if ($service) {
Write-Host "Stopping service $serviceName..."
Stop-Service -Name $serviceName -Force
Write-Host "Deleting service $serviceName..."
sc.exe delete $serviceName
Write-Host "Service $serviceName has been deleted."
} else {
Write-Host "Service $serviceName does not exist."
}- If the service exists, the script stops and deletes the SnowMongoDB service.
- If the service does not exist, the script reports that no action is required.
Related Articles
PowerShell script to rebuild the Snow MongoDB Windows service 8Number of Views PowerShell script to rebuild the Snow Update Service 27Number of Views MongoDB service fails to start after upgrading to Snow License Manager 9.39 200Number of Views FlexNet agent (ndtrack) may trigger a security software warning due to PowerShell script execution containing unusual char… 74Number of Views Powershell Script to extract DLL and EXE version numbers from the Snow directory 75Number 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. | |
Case id: 00001065
Activity: Status change: 2 hours ago