PMService Class |
Namespace: PM90SettingsAPI
public class PMService
The PMService type exposes the following members.
Name | Description | |
---|---|---|
GetAllServices |
Gets a collection of all active services
| |
GetServers |
Gets a collection of all active services that are running on a Server, or are the Primary Install
| |
GetWorkstations |
Gets a collection of all active services that are running on workstations
| |
LookupService |
Looks up a service by name. Passing a null or empty string will return the Primary Installation service
|
Name | Description | |
---|---|---|
Condition |
The current set of server condition flags
| |
DatabaseID |
Database unique id for this server or workstation
| |
IsLicensed |
true if there is no license issue with this server\workstation
| |
IsPrimaryServer |
returns true if this is the Primary install which includes web portal\reporting
| |
IsServer |
Returns true if the service is installed on a server
| |
IsWorkstation |
Returns true if the service is installed on a workstation
| |
LastServiceStartUTC |
Time stamp for last service start
| |
Name |
Name of server or workstation
| |
Version |
Last known service version.
Remarks This string is updated each time the service starts and is able to write to the database. |
//Get the primary server PMService primaryServer = PMService.LookupService(null); if (primaryServer != null) { Console.WriteLine("{0,20}{1,25}","Primary Server:",primaryServer.Name); Console.WriteLine("{0,20}{1,25}","Version:",primaryServer.Version); Console.WriteLine("{0,20}{1,25}", "Uptime:", DateTime.UtcNow - primaryServer.LastServiceStartUTC); Console.WriteLine("{0,20}{1,25}", "Condtion:", primaryServer.Condition); Console.WriteLine("{0,20}{1,25}", "Primary Install:", primaryServer.IsPrimaryServer); Console.WriteLine("{0,20}{1,25}", "Workstation:", primaryServer.IsWorkstation); Console.WriteLine("{0,20}{1,25}", "Licensed:", primaryServer.IsLicensed); } //Get a service by name PMService serverByName = PMService.LookupService("SERVER42"); //Gets all services IEnumerable<PMService> allServices = PMService.GetAllServices(); //Gets all servers IEnumerable<PMService> servers = PMService.GetServers(); //Gets all workstations IEnumerable<PMService> workstations = PMService.GetWorkstations();