Uploading a folder to server

I need to install a software on a server. For that I need to upload a whole folder to the target server and run one file. But I always get an error “file not found” (1619 exit code from msiexec). This is my action script:

if {x64 of operating system}
prefetch sha1 sha1:sha1 size:38317623 http://besroot.suffix.com:52311/Uploads/sha1/AMD64.tmp sha256:sha256
extract sha1
else
prefetch sha1 sha1:sha1 size:23027913 http://besroot.suffix.com:52311/Uploads/sha1/2012R232bit.tmp sha256:sha256
extract sha1
endif

action parameter query “Management_server” with description "State management server:"
waithidden cmd /c rd “%programfiles%\Microsoft Monitoring Agent” /s /q
wait cmd /c {system folder}\msiexec.exe /i __Download\MOMAgent.msi /qn USE_SETTINGS_FROM_AD=0 USE_MANUALLY_SPECIFIED_SETTINGS=1 MANAGEMENT_GROUP=ABB_OMI_01 MANAGEMENT_SERVER_DNS={parameter “Management_server”} MANAGEMENT_SERVER_AD_NAME={parameter “Management_server”} ACTIONS_USE_COMPUTER_ACCOUNT=1 AcceptEndUserLicenseAgreement=1
if {x64 of operating system}
wait cmd /c __Download\KB4016125-AMD64-Agent.msp
else
wait cmd /c __Download\KB4016125-i386-Agent.msp
endif

I generated the prefetch and extract commands using the Windows software distribution wizard.
I tried to run the file using this relevance, but then the action (particularly that command) got stuck in Running state for ever.
waithidden cmd /c {system folder}\msiexec.exe /i {(pathname of client folder of current site) & “__Download\MOMAgent.msi”} /qn …

did you check if the file exists?
Can you check if there is any log file which says what went wrong with the msi.
Try running it manually once to see if you get the same error.

Manually it’s fine. How do I find out if the files were uploaded correctly? BigFix always deletes all files from the __Download folder after the action finishes. Can I prevent that somehow?

I normally move them to a dedicated folder and delete it when required.

But how do you move them? How do I use the move command for all the files?

you can move them before you extract.

So for example like this?
waithidden cmd /c rd “C:\SCOM\Agent” /s /q
folder create C:\SCOM\Agent

if {x64 of operating system}
prefetch sha1 sha1:sha1 size:38317623 http://besroot.suffix.com:52311/Uploads/sha1/AMD64.tmp sha256:sha256
move sha1 C:\SCOM\Agent\sha1
extract C:\SCOM\Agent\sha1
else
prefetch sha1 sha1:sha1 size:23027913 http://besroot.suffix.com:52311/Uploads/sha1/2012R232bit.tmp sha256:sha256
move sha1 C:\SCOM\Agent\sha1
extract C:\SCOM\Agent\sha1
endif

yes. try to run it and check if it works.

For some reason, after the temporary file was moved to the destination folder, the action stopped. There isn’t a single mention about the extract command in the log. Exit code 0 was reported. Second time I tried, same happened, only exit code 3 was reported.

Hi Tobytja,

we also faced 1619 error during the java JDK deployment and we found that its issue with user rights on remote servers.when we tried installation with administrator user privileges its worked for us.

Thanks,
Arjit

check the client log, you will see where bigfix is actually looking for the file (the full path).
if for example you used a custom site, the MSI will be downloaded to that site’s download folder (for example,C:\Program Files (x86)\BigFix Enterprise\BES Client\__BESData\CustomSite_Workstations\__Download) and not the default “actionsite” download folder.

in the client log, look for something like:
Command started - wait "C:\WINDOWS\system32\msiexec.exe" /i "C:\Program Files (x86)\BigFix Enterprise\BES Client\__BESData\CustomSite_Workstations\__Download\SomeMSI.msi" /qn ACCEPTEULA=YES and note where the MSI should be.

In the actionscript you posted, I do not see a prefetch for the MOMAgent. I only see the AMD64 and 2012R232bit files, depending on bitness.

I would advise to also include the MOMAgent.msi package as a prefetch, so you have all the files you need for the actionscript to run.

It’s for whole folders, not just files. Both folders contain the momagent.msi file. But I’m not sure how downloading of whole folders works. Since neither BigFix nor Windows itself can unzip a file, I can’t pack the folders to zip file and send that zip file there.

If you only have the BigFix patch module, then you can use the software distribution wizard to package a directory. BigFix can zip up and extract the folder for you.

If you have Lifecycle module, you can use the Software distribution dashboard that makes things even easier.

However, if you wanted to, zip the directory that you need and then in the actionscript also prefetch a unzip tool (winzip, 7zip, unzip etc) to extract it.

e.g.

prefetch unzip.exe sha1:e1652b058195db3f5f754b7ab430652ae04a50b8 size:167936 http://software.bigfix.com/download/redist/unzip-5.52.exe

and then extract the compressed directory:

waithidden __Download\unzip.exe -o __Download\*your ziped file* -d "{ pathname of download folder }"

When I check the log, I see the action ends after the move command. The extract command is not even attempted to execute.

I’m afraid I can’t use any unzip tool or any other kind of software not built into windows directly. I’m working on a customer’s environment, so I can’t just upload whatever I want to the systems. We have lifecycle, but I never used a dashboard, I always thought they are only for information gathering, not for taking actions.
I used the software distribution wizard to package the folder and upload it to client server.

How do I change the user which executes the commands on the server? I thought it’s always the user System and nothing can be done about it.

1 Like

You can specifiy the user in the “override” command as shown in the following example. The password will be request when the action is taken:

download http://xxxxxx.xx.xx:52311/Temp/test.bat
continue if {exist file “__download/test.bat”}
override wait
runas=localuser
asadmin=true
user=user1
password=required
wait "__download/test.bat"
continue if {exist file “C:\test\test.txt”}
appendfile Step 1 - command succeded
delete "c:\test\results.txt"
move __appendfile “C:\test\results.txt”

Since you have Lifecycle, this can be done through the GUI in the Software Distribution Dashboard, or in the WebUi. Given what your trying to achieve, I highly recommend you take a look them. A lot of what your doing is already automated and done for you in the dashboard.

  1. Activate the Software Distribution site in your License dashboard
  2. In the Console go to Systems Lifecycle > Software Distribution > Manage Software Distribution dashboard
  3. Alternatively, you can do the same in the WebUi by heading to Apps > Software

I don’t see the dashboard there. I’m not an MO, maybe I don’t have privileges set so that it’s accessible to me :frowning: