13 Replies Latest reply on Nov 16, 2015 8:45 AM by Gary White

    Powershell command run via object dictionary help

    Gary White

      I have placed a .ps1 file in:

      //localhost/BLD_PRD_PTCH/storage/extended_objects/admins2.ps1

       

      now in the extended object when I browse the server I try to run however it hangs.

       

      The permission on the file are 755 rwx r x r x so they are fine

       

      the contents of the ps1 file:

      net localgroup administrators | where {$_ -AND $_ -notmatch "command completed successfully"} | select -skip 4    OR

       

      invoke-command { net localgroup administrators | where {$_ -AND $_ -notmatch "command completed successfully"} | select -skip 4 }

       

      both work ran locally on a win box

       

      when run this generates a clean list of accounts with no other lines.

       

      what I need to know is, after I create a new config object in the dictionary view, what parameters to use to run the file that is now in the NAS storage location:

       

      cmd /c powershell "//localhost/BLD_PRD_PTCH/storage/extended_objects/admins2.p

       

      I have tried the above however it just hangs and I have to crash the console.