Kaseya Community

Files not Distributing from script

  • We have run into a little problem with a couple of scripts we are trying to use.
    What it is doing is that we have schedule a script to write two files to the server before running it at a point in time.
    But half the servers will not receive the files.
    The files can be Distribute with the “Distribute File” section but that’s defeats using a scripts.
    Does anyone have any ideas why it would be doing this?
    Here the script below.

    [PHP]
    IF True
    THEN
    Write File
    Parameter 1 : c:\temp\UserQuery.cmd
    Parameter 2 : VSASharedFiles\3-Maintenance\UserQuery.cmd
    OS Type : 0
    Write File
    Parameter 1 : c:\temp\UserQuery.ps1
    Parameter 2 : VSASharedFiles\3-Maintenance\UserQuery.ps1
    OS Type : 0
    Execute Shell Command
    Parameter 1 : at 12:03 c:\temp\userquery.cmd
    Parameter 2 : 0
    OS Type : 0
    ELSE[/PHP]

    Legacy Forum Name: Files not Distributing from script,
    Legacy Posted By Username: Jargon
  • You forgot the \

    Change the file path to c:\tempUserQuery.cmd and c:\tempUserQuery.ps1

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: XeviouS
  • XeviouS
    You forgot the \

    Change the file path to c:\tempUserQuery.cmd and c:\tempUserQuery.ps1


    Thats odd because in the script its got c:\temp\UserQuery.ps1

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: Jargon
  • Ok the reason that the \ were removed from your forum post is because you have used the PHP code tags ....not the plain old # code tags ;-)

    So what else might it be?

    Does the c:\temp folder exist on all machines you are running it on?
    Perhaps use %TEMP%\UserQuery.cmd instead?

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: XeviouS
  • All the machine have c:\temp folder in them.
    I just tried %temp% instead of c:\temp still no luck.

    It doesn't explain the fact that some of the machines will get the files and the others will not.

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: Jargon
  • Is it customers/site specific ?

    i.e all the comptuers at location X dont work...and those at location Y do work ?

    What is unique about those that dont work...perhaps OS?

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: XeviouS
  • Jargon
    All the machine have c:\temp folder in them.
    I just tried %temp% instead of c:\temp still no luck.

    It doesn't explain the fact that some of the machines will get the files and the others will not.


    May want to check the creds, and make sure they pass the "test", even though the agent is on the target machine.

    Agent Tab
    -Configure Agents
    --Set Credential

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: Techdawg
  • This script is only been send to one server per client.
    The OS that are not going through are SBS 2003 SP2. I don’t see that as a problem as 5 of the other client have the same OS.

    All the machines have passed the credential check.
    If the credential were not correct that would stop the “Distribute File” from sending files to the server?

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: Jargon
  • Jargon
    This script is only been send to one server per client.
    The OS that are not going through are SBS 2003 SP2. I don’t see that as a problem as 5 of the other client have the same OS.


    On the right side of the script, "Perform Step # On:"
    What is selected? "All Operating Systems" or something else?

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: Techdawg
  • Techdawg
    On the right side of the script, "Perform Step # On:"
    What is selected? "All Operating Systems" or something else?


    "All Operating Systems" is select, I have just change it to what OS I'm trying to run it on to see if that makes a difference.
    Still no luck.

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: Jargon
  • Jargon
    "All Operating Systems" is select, I have just change it to what OS I'm trying to run it on to see if that makes a difference.
    Still no luck.


    Hey Jargon, can you post the exact code and use the [CODE][\CODE] tags...

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: Techdawg
  • Here it is


    IF True
    THEN
    Write File
    Parameter 1 : c:\temp\UserQuery.cmd
    Parameter 2 : VSASharedFiles\3-Maintenance\UserQuery.cmd
    OS Type : 0
    Write File
    Parameter 1 : c:\temp\UserQuery.ps1
    Parameter 2 : VSASharedFiles\3-Maintenance\UserQuery.ps1
    OS Type : 0
    Execute Shell Command
    Parameter 1 : at 12:03 c:\temp\userquery.cmd
    Parameter 2 : 0
    OS Type : 0
    ELSE


    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: Jargon
  • Hmm is it possible that Antivirus is preventing those files as they are .cmd?

    Do all servers run the same AV? Does it work if you deploy .txt files ?

    I cant see anything wrong with the script....so it has to be something to do with the end computer setup.

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: XeviouS
  • All server except one is running AVG installed from kaseya.
    The strange thing is that went the script was rewriten and tried it out on one a clients new sbs 2008 box the script worked.
    So I went and rerun the script on all the client that where not working, and they worked.Confused
    Now I need to figure out why the other script will not work fully.

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: Jargon
  • Interesting....perhaps there were hidden characters in the script or it had a minor corruption when uploading to the server.

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: XeviouS