Introduction
Most Sureview components run as Windows Services. This article provides some guidance on interacting with Windows services using PowerShell (this can be used regardless of whether you have access to the Windows GUI or not). For guidance on using the Windows GUI please refer to Microsoft documentation.
Guidance: Windows Services
Listing Windows Services and their status
Run the following PowerShell commands to list services and their status :
<# List all services and their status #>
Get-Service;
<# List all services whose name match a pattern #>
Get-Service -Name "SV*";
<# List a specific service #>
Get-Service -Name "SVDevices";
<# List all services whose name match a pattern with more detail including what user the service runs as ("StartName") and where the exe is located ("PathName") #>
Get-WmiObject -Class Win32_Service -Filter "name like 'SV%'" | Select Name,State,StartName,PathName;
Controlling Windows Services
Run the following PowerShell commands to control services:
<# Restart a running service (also starts a stopped one) #>
Restart-Service -Name "SVDevices";
<# Stop a running service #>
Stop-Service -Name "SVDevices";
<# Start a stopped service #>
Start-Service -Name "SVDevices";
Installing Manually
Run the following commands as an Administrator to manually install a service. You will see a message about the service being installed successfully or an error explaining why not:
cd C:\Windows\Microsoft.NET\Framework\v4.0.30319\
.\installutil "C:\ThePathToTheService\SVYourService.exe"
Uninstalling Manually
Run the following commands as an Administrator to manually uninstall a service. You will see a message about the service being uninstalled successfully or an error explaining why not:
cd C:\Windows\Microsoft.NET\Framework\v4.0.30319\
.\installutil /u "C:\ThePathToTheService\SVYourService.exe"
Comments
0 comments
Please sign in to leave a comment.