Am trying to develop a report where it shows duration uptime including one column for the LAN and a second column for the wireless adapter.
Can someone help to get the correct information in the relevance?
In powershell, I can do something like this which gives me the correct information. I would like to do the same thing using the bigfix analysis reporting tool.
Here is a BigFix relevance query for the first phase of your powershell snippet.
q: (string value of property "name" of it, string value of property "TimeOfLastReset" of it) of select objects "name, TimeOfLastReset from Win32_networkadapter where (NetEnabled='true' and (Name like '%25Intel%25' or Name like '%25Realtek%25'))" of wmi
A: Intel(R) I211 Gigabit Network Connection, 20190520143402.610800-240
I am trying to decode that last reset time into an actual “time” object in BigFix.
I’m sure this can be done more efficiently, but how about something like (requires better error handling):
(item 0 of it, now - (((first 2 of following text of position 6 of it & " " & month ((first 2 of following text of position 4 of it) as integer) as string & " " & first 4 of it & " " & first 2 of following text of position 8 of it & ":" & first 2 of following text of position 10 of it & ":" & first 2 of following text of position 12 of it) as local time)) of item 1 of it) of (string value of property "Name" of it, string value of property "TimeOfLastReset" of it | "n/a") of select objects "* from Win32_networkadapter where (NetEnabled='true' and (Name like '%25Intel%25' or Name like '%25Realtek%25'))" of wmi
Interesting, you went for the pure string synthesis. I went for objects, but I think yours is cleaner:
q: (string value of property "name" of it, (now - ((first 4 of it as integer as year & concatenation of characters (4;5) of it as integer as month & concatenation of characters (6;7) of it as integer as day_of_month) & ((concatenation of characters (8;9) of it & ":" & concatenation of characters (10;11) of it & ":" & concatenation of characters (12;13) of it )as time_of_day & local time zone)) of string value of property "TimeOfLastReset" of it)) of select objects "name, TimeOfLastReset from Win32_networkadapter where (NetEnabled='true' and (Name like '%25Intel%25' or Name like '%25Realtek%25'))" of wmi
Is there anyway to just display the timeoflastreset, and not show the network adapter name? or, how could I split the relevance so one column has the timeoflastreset and another column has the network adapter name?
( now - (((first 2 of following text of position 6 of it & " " & month ((first 2 of following text of position 4 of it) as integer) as string & " " & first 4 of it & " " & first 2 of following text of position 8 of it & ":" & first 2 of following text of position 10 of it & ":" & first 2 of following text of position 12 of it) as local time)) of item 1 of it) of (string value of property "Name" of it, string value of property "TimeOfLastReset" of it | "n/a") of select objects "* from Win32_networkadapter where (NetEnabled='true' and (Name like '%25Intel%25' or Name like '%25Realtek%25'))" of wmi