Format LastBootUpTime to local Time Zone

Started by ninefofo

ninefofo

Format LastBootUpTime to local Time Zone   04 April 2015, 05:04

Hello,

Is there a way to convert/format the remote LastBootUpTime to my local TZ, or maybe hours since last?

This is the current raw WMI result : 20150403092017.125599-420

Thanks,
Brad
SoftPerfect Support forum - Andrew avatar image

Re: LastBootUpTime   04 April 2015, 17:00

No, there isn't a way to format it. You could apply a regex to the value, but it's rather for data extraction than formatting.

Alternatively you can use Retrieve computer uptime:

SoftPerfect support forum

Re: Format LastBootUpTime to local Time Zone   07 April 2015, 13:57

You can use a VBScript to do it. -WS

[technet.microsoft.com]
[blogs.technet.com]
SoftPerfect Support forum - Andrew avatar image

Re: Format LastBootUpTime to local Time Zone   07 April 2015, 16:13

I was thinking, perhaps it makes sense to add VB script support to the Network Scanner (for such cases)?

Re: Format LastBootUpTime to local Time Zone   08 April 2015, 10:29

Yes please! smile

Not sure were you were thinking of adding it but if you would put it under "Remote VBScript..." that would be great. I have a lot of VBScript's that run from the "Open Computer..." (e.g. the applications tab) and that is how I get around VBScript not on the Remote xxxxx.... pull down.

Support in both the Remote xxxxx.... and the Applications Tab would be Awesome! Sometimes I need the VBScript run against all computers and other times only on one or two.

I hate to make more work but....it would also be extremely nice to have "Remote CMD..." and "Remote PowerShell..." as well and in both places. laugh laugh

Thanks as always. -WS

Re: Format LastBootUpTime to local Time Zone   08 April 2015, 10:40

Andrew

Some samples: I have some very complex stuff I gather from NetScan.

In "Options" under "Applications" I have things like:

NAME: and List Services Started with Non-System Accounts

Command Line: c:\windows\system32\cmd.exe /t:0E /k cscript "\\storage\nas$\Common\Scripts\Display Services Started with Non-System Accounts v1.1.vbs" %0 & pause & exit

and

NAME: and Schedule Remote Reboot

Command Line: wscript.exe "\\storage\nas$\Admin\Scripts\Non OS Specific\Schedule Remote Domain Computer Reboot v4.5.vbs" %0

They just get more and more complex trying to use CMD or VBScript or PowerShell.

Thanks for considering this.
ninefofo

Re: LastBootUpTime   11 April 2015, 02:44

Andrew,

Thanks! I must have missed that. Uptime works perfectly.

Brad

Re: Format LastBootUpTime to local Time Zone   15 September 2015, 15:35

Quote

Andrew

I was thinking, perhaps it makes sense to add VB script support to the Network Scanner (for such cases)?


Andrew,

Any chance you can add this? and PowerShell? Thanks -WS
SoftPerfect Support forum - Andrew avatar image

Re: Format LastBootUpTime to local Time Zone   15 September 2015, 17:15

VB Script perhaps not. It's not available for embedding into 64-bit programs - that's how Microsoft did it.

PowerShell perhaps yes, though the problem is most PS output is designed to be printed in the console as a table, which is not suitable for putting a (generally small) text value in the Network Scanner output. A way around may be asking PS to return the result in XML and then select some of the data in the XML response.

Re: Format LastBootUpTime to local Time Zone   16 September 2015, 14:19

Thanks for looking into it that is above and beyond. -WS

Sometimes you can get the answer faster if you try the forum search and/or have a look at the software user manual to see if your question has already been answered.

Our forum rules are simple:

  • Be polite.
  • Do not spam.
  • If possible, check your spelling and grammar.

Author:

Subject

A brief and informative title for your message, approximately 4–8 words:

     

Spam prevention: please enter the following code in the input field below.

 **               **  ********  ********        ** 
 **    **         **  **        **              ** 
 **    **         **  **        **              ** 
 **    **         **  ******    ******          ** 
 *********  **    **  **        **        **    ** 
       **   **    **  **        **        **    ** 
       **    ******   ********  ********   ******  

Message: