Announcement

Collapse
No announcement yet.

Procedure Execution Log

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Procedure Execution Log

    I would like to run a procedure on an endpoint. The procedure would use the subprocess command to run a CMD or Powershell command on the endpoint. I would like the output of the command to be printed in the Execution log of on the endpoint. Is this possible and how can it be done?

  • #2
    Hi minntech,

    Please try these existing scripts and let us know if it suffice your needs

    https://scripts.itarian.com/frontend...rshell-command
    https://scripts.itarian.com/frontend...n-the-endpoint

    Kind Regards,
    PremJK

    Comment


    • #3
      Originally posted by PremJkumar View Post
      Hi minntech,

      Please try these existing scripts and let us know if it suffice your needs

      https://scripts.itarian.com/frontend...rshell-command

      Kind Regards,
      PremJK
      Yes thats the one that I am using. I am changing the powershell command to:
      If ((Get-BitLockerVolume -MountPoint "C").KeyProtector -like "*") {(Get-BitLockerVolume -MountPoint "C").KeyProtector}

      When I run this in powershell on a PC I get an ouput of the data, but when I run it from Itarian procedure it doesnt record anything in the execution log.

      Comment


      • #4
        So I got this working, again it came down to finding the correct combination of quotes around the entire command and specific options within the command. I still dont understand python logic when it comes to quotes. Any references on this to make this a bit easier?

        This is what ended up finally working for me:
        ps_command=r'''Import-Module Bitlocker; If ((Get-BitLockerVolume -MountPoint 'C').KeyProtector -like '*') {(Get-BitLockerVolume -MountPoint 'C').KeyProtector}'''

        Comment

        Working...
        X