logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Will H  
#1 Posted : Tuesday, June 6, 2017 7:41:41 PM(UTC)
Will H


Rank: Administration

Joined: 11/23/2016(UTC)
Posts: 1
United States

Thanks: 5 times
Was thanked: 1 time(s) in 1 post(s)
There are a few posts here about using the command pane to do interesting things, but I didn't see anything that covered this use scenario:

If you have a bunch of Windows access agents and you'd like to silently pull a file down to and then install it, you can use the command pane with a combination of commands to get this done. If you use the checkbox to multi-select a bunch of agents, you can run this on many/all agents simultaneously.

This example downloads a file from Dropbox, puts it in C:\temp, and then runs a silent MSIEXEC install with logging to the C:\temp directory. The pathnames and URLs would be changed for whatever your purposes are.

If your remote endpoint has POWERSHELL 3, populate the command pane like this:

Quote:
#!ps
#maxlength=50000
#timeout=300000
Invoke-WebRequest -Uri https://www.dropbox.com/link/ClientSetup.msi?dl=1 -OutFile C:\temp\ClientSetup.msi
#!cmd
msiexec /i C:\temp\ClientSetup.msi /qn /l*v C:\temp\installfail.log


If your remote endpoint has POWERSHELL 2, populate the command pane like this:

Quote:
#!ps
#maxlength=50000
#timeout=300000
(new-object System.Net.WebClient).DownloadFile('https://www.dropbox.com/link/ClientSetup.msi?dl=1','C:\temp\ClientSetup.msi')
#!cmd
msiexec /i C:\temp\ClientSetup.msi /qn /l*v C:\temp\installfail.log



If you run into a 1603 error on install, it means the software is probably already installed, or that the SYSTEM account doesn't have Full Access to the install location.

JAN 2018 EDIT: Since the posting of this, it seems the command pane has changed a bit and can't swap between PS and CMD on the fly.

The new process would involve splitting this in half, as seen here (with the PowerShell 3 example):

Quote:
#!ps
#maxlength=50000
#timeout=300000
Invoke-WebRequest -Uri https://www.dropbox.com/link/ClientSetup.msi?dl=1 -OutFile C:\temp\ClientSetup.msi


After that runs, switch from PS to CMD and run the installer silently.

Quote:
#!cmd
#maxlength=50000
#timeout=300000
msiexec /i C:\temp\ClientSetup.msi /qn /l*v C:\temp\installfail.log


Also, keep in mind that when linking to a file on Dropbox, changing the final part of the URL from dl=0 to dl=1 will skip the landing page and give a direct link to the file (which is necessary for this to work).

Edited by user Tuesday, January 2, 2018 10:35:53 PM(UTC)  | Reason: Clarifications

thanks 1 user thanked Will H for this useful post.
Michael L on 6/6/2017(UTC)
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.