Need to report on Windows Services, both startup type (either disabled, manual, or Automatic) and Service status (running or stopped) ?
Need to report on Windows Services, both startup type (either disabled, manual, or Automatic) and Service status (running or stopped) ?
Can't find a way in KACE SMA v10.2.234 to do this with Wizard, is it possible with SQL?
Answers (2)
Here's my cir for getting print spooler status. You should be able to drop the -name spooler and have it get all services you will need to add an additional property to get the service names though
ShellCommandTextReturn(cmd /c powershell.exe "get-service -name 'Spooler'|Select-Object -Property Status,StartType|format-List |Out-String |ForEach-Object {$_.Trim()}")
I haven't tested it but in theory it should look like this.
ShellCommandTextReturn(cmd /c powershell.exe "get-service|Select-Object -Property Name,Status,StartType|format-List |Out-String |ForEach-Object {$_.Trim()}")
You need to do a few additional tasks here to collect these informations:
1. a Custom Inventory Rule to have an overview over both. An easy overview would bring the following:
ShellCommandTextReturn(cmd /q /c powershell -command (Get-Service |Where-Object {$_.Status -eq "Running"}) )The first line only shows the services as a table with the status, the name and the displayname.
The second line is an example for only running services.
You obviosuly can do other rules to get only the running etc or multiple CIR for the different states
2. test the CIR
3. now you can report them
Please be aware that I did not test he commands as CIR but like that they should work
Please also be aware that the SMA 10.2 goes end of life in a few days so you URGENTLY should update to the latest version (11.1 as of today)