"Command" is essentially handed to cmd.exe as an argument. And it is subject to all the environment that the account running the nimbus watcher service is.
Power Shell comes with all kinds of issues related to security and so typically winds up being unusable as a command like this.
You can try to verify if you open a cmd prompt with the "run as" option and specify the account running UIM - it won't be the exact same but closer than using your interactive login.
Then paste in your command. You'll see the issues.
Alternatively set the logmon log level to 5 and watch that log for errors.
And with regards to your question, why not have the powershell command do all the date math for you and return a days since result or maybe do the comparison in powershell and return a YES/NO
Original Message:
Sent: 11-12-2020 06:18 AM
From: Akash Saini
Subject: Logmon profile for system reboot time
Hi Folks,
We tried to created profile for below mentioned details through Command Mode:--
Profile Mode :-- Command
Command run--(get-date) - (gcim Win32_OperatingSystem).LastBootUpTime | select Days, Hours, Minutes, Seconds
And output :-
Days Hours Minutes Seconds
---- ----- ------- -------
16 2 48 28
Please help me alarm should be generated when the days value cross the 40 .
Thanks in advanced
Akash Saini