Archives for: "April 2014"

Summer started...

April 28th, 2014

Summer started a week ago...

LED-lights mounted

April 28th, 2014

Bought a pair of led lamps about a month ago, hoping for an easy job mounting them, but no. Turned out that there was a lot of rust on the roof, so that needed to be repaired. Now that is done, and I have mounted the rear lights.

They turn night into day

My latest book - Astrid Sverresdotter Dypvik "Det var DDR"

April 22nd, 2014

3. oktober 1990 vart DDR lagt ned og Tyskland samla. Det var slutten for statssosialisme, Berlinmuren og Stasi, men også for eit samfunn utan arbeidsløyse. Denne boka byr på forteljingar om det som er att etter DDR i dag....

Read more at Samlaget

How to get uptime for a Windows service

April 1st, 2014

Needed to know the uptime of a service on a Windows 2012 server to verify that the suggested solution for restarting all Splunk Universial Forwarders did work, see answers.splunk.com/../how-can-i-restart-all-my-forwarders.

Solution found here /blogs.technet.com/.../how-can-i-get-the-uptime-of-a-service, did make some minor adjustments to the vbscript as shown below.

Code

strComputer = "."
 
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
 
Set colServices = objWMIService.ExecQuery _
    ("Select * From Win32_Service WHERE displayname = 'SplunkForwarder'")
For Each objService in colServices
 
    intProcessID = objService.ProcessID
 
    Set colProcesses = objWMIService.ExecQuery _
        ("Select * From Win32_Process Where ProcessID = " & intProcessID)
 
    For Each objProcess in colProcesses
        Wscript.Echo objService.Name + "/" + objProcess.Name + " " + objProcess.CreationDate
    Next
Next

Running it from the Powershell prompt like this PS D:\Temp> cscript.exe .\uptime.vbs