Kaseya Community

script help

This question is not answered

I am trying to run these commands in an agent procedure 

#activate windows
slmgr -ipk my serial number
slmgr -ato


#add wireless network
netsh wlan add profile filename="\\superman\service_software\ask-byod.xml" user=all

But the procedure just sits there in the queue. If I run these from command line they work perfectly.

Any suggestions on crafting this into a kaseya script using executeshellcommand ?

All Replies
  • Hi  

    Can the procedure be attached to the thread or can we see the parameters for each step in screenshots?

    It may be best to attach it to the thread so we can try and run it ourselves and review the results

    Best,

    Nicolas

  • ampsta

    I've seen things that don't seem to run when called directly from a procedure, but run from the command line. One thing that's worked for me when this happens is to put the commands into a BAT file. I copy the BAT file to the target and then invoke it, passing any args necessary.

    This also provides a standard utility - the bat file is written and tested once, and any customer-specific parameters are passed to it by the procedure. I even have one BAT file that I use to invoke about a dozen utility scripts in a consistent manner.

    Glenn

  • I agree with Nicolas.  You should screenshot/share your logic.  I have personally created procedures using slmgr for various types of procedures with success using the executeshellcommand within the AP module.