cancel
Showing results for 
Search instead for 
Did you mean: 
Active Contributor

Re: One2Many Script Repository

For one-liners, I get around set execution policy on PowerShell scripts by using the command:

powershell "put command here"

 

Watch out for commands that use double quotes though.

 

Example:

powershell "(Get-WmiObject -Class Win32_Product | Where-Object { $_.Name -eq 'Some Name Here' }).Uninstall()"

 

What One2Many really needs is the ability to chain tasks sequentially. I know you can just send a script with complex logic but if you already have the individual pieces as tasks, it would be nice to be able to just chain those together.

Highlighted
New Contributor

Re: One2Many Script Repository

did the effort to have a "new and easier to use script repository via groups" stall again?

Active Contributor

Re: One2Many Script Repository

Hi everyone,

 

   I am kinda wondering if someone has successfully transfered files using a script instead of the file transfer/manager in LMI. If anyone is willing to share a working script, that would be awesome. Thank you. 

 

P.S. I've posted on the other thread as well. 

Active Contributor

Re: One2Many Script Repository

Scripts do not allow the ability to transfer files.

 

You'd need to issue commands to something in order to do the copy.

 

Examples of methods:

Initiating a VPN connection then transferring from a fileshare.

 

Initiating an FTP download (Something like this: FTP through PowerShell )

 

Using an already available file transfer utility like SCP.

 

You can use the custom package option (One2Many Task). It will download all files you upload to the task. If you use a PowerShell script, you can refer to the random directory LMI puts the files in through the variable $PSScriptRoot as the script will be in the same directory.

 

#Rudimentary example

#Uninstall old products since they cause new installations to abort
(Get-WmiObject -Class Win32_Product | Where-Object { $_.Name -match 'Awesome Program'}).Uninstall()

#Start Install
Start-Process -Wait msiexec -ArgumentList "/i $PSScriptRoot\AwesomeProgram.msi TRANSFORMS=$PSScriptRoot\AwesomeProgramTransform.mst"

#Install dependent program
Start-Process -Wait msiexec -ArgumentList "/i $PSScriptRoot\DependentProgram.msi"

#Install second dependent program
Start-Process -Wait msiexec -ArgumentList "/i $PSScriptRoot\AnotherDependentAwesomeProgram.msi"

#License the program
Copy-Item -Path $PSScriptRoot\AwesomeLicense.lic -Destination "C:\Program Files (x86)\AwesomeProgram\LicenseFile.lic" -Force
Active Contributor

Re: One2Many Script Repository

Hey CarlCapone, if you set up a "custom" One2Many, upload the files, then use the example syntax below, you can transfer multiple files using a simple DOS format: 

 

copy file1.txt "C:\folderpath"&&copy file2.txt "C:\folderpath&&copy file3.txt ................

 

Essentially you'll need to separate each command by the double ampersand, which tells DOS that a new command is coming. I've been using this methodology for complex One2Many pushes for about 6 years and it takes some trial and error, but it usually works!

Active Contributor

Re: One2Many Script Repository

Hey there,

 

  Thanks for the replies. Sorry it's been some time since I've checked back on this. Anyway, @j_helland is this possible on the Rescue LogMeIn centralized script setting? So far, that's the only option I see where I can upload files and/or custom scripts? Not entirely sure if it's the same with the One2Many feature.

 

 As for purpose of the script, I am trying to have the files residing on one server and have our technicians transfer those files to their clients so that we don't have to download each of those files from our file server using the client's computer. More like a drag and drop feature that we have used before from a different platform. Thank you.

New Contributor

Re: One2Many Script Repository

Is there a way that I can execute a vbs script with the administrator credentials?  I am trying to update a folder by deleting the existing files and extracting a zip with the new set of files.  this works great if I am logged in with the administrator account.  However, when I try to execute the script with the standard user account logged in, I get a message that I need permissions to delete files.  

 

The high level is that I delete existing files in a public\desktoip\links folder structure, then unzip a new folder structure in it's place.  I have the administrator credentials applied when I set up the credentials.  any advice would be appreciated.

Thanks!

Active Contributor

Re: One2Many Script Repository

You certainly can! The syntax for that would be:

 

cscript filename.vbs

 

Just put that into your command with the actual filename. Do you have a vbs script that works?  

Active Contributor

I need a script example/real time use

I've tried to understand these scripts, and have difficulty, and given the sparse support, I'm hoping anyone can assist in a simple request.

 

All I'd like is a basic template to install (update) and existing application.

 

Real easy, but I'm kind of stumped.

 

Sooner is better, as it's security related (I need to push the latest updated program Ccleaner.exe) that was discovered to have a vulnerability.

 

So, all PC's are x64, how do I do this, simple, easy, push to all end users?

 

(actual script, where the file resides to piush, and step by step)

 

This will be hwlpful for other tasks also in the future, much appreciate it.

Active Contributor

Re: I need a script example/real time use

Just a bit of advice here...........don't ever count on getting a real time solution from a message board.

 

Additionally, you could have solved this quickly yourself by going to https://www.piriform.com/docs/ccleaner/advanced-usage/command-line-parameters

 

You'll find a DOS command to run a Ccleaner update on that page. No executable needed.

 

You'll feel a lot more confident if you find these solutions yourself in the future. Google is your best friend when you don't have others in your department to rely on.

 

Lj