cancel
Showing results for 
Search instead for 
Did you mean: 
KevinA
Retired GoTo Contributor

One2Many Script Repository

Welcome to the LogMeIn Central Script Repository!

 

What is it? A library of scripts to help you execute automated tasks and manage LogMeIn Pro² computers without having to access them manually.
 
How does it work? Simply browse the .txt files below, save as a .BAT file and head to your LogMeIn Central console. Then, navigate to the One2Many tab, and select "Run a batch file or executable." From there, simply upload the batch file and you're ready to go.
 
How can you help? We encourage you to share your own scripts and/or help review the scripts of others-- just "Kudo" your favorites or reply with your comments. 
 
Use of these scripts is at your own risk so please test them on a small number of systems before deploying at scale. The scripts are provided “as is” without any warranty of any kind and LogMeIn disclaims any and all liability regarding any use of the scripts.  Please see the following Terms and Conditions for more information.
 
 
Script Repository
 

Microsoft Updates

 

Windows Update Javascript- The following script will perform comprehensive Windows Updates (Windows and Microsoft updates) on remote computers.  This java script must be run as a Custom Task within One2Many with cscript being the entry point, Command to execute to update and install in the Custom Task is:

cscript.exe "%LMI_PACKAGEROOT%\wu.js" /sa /i

 

 

/sa will  find updates that are flagged to be automatically selected by Windows Update.  This is critical to avoid installing all available updates for the computer as this may include over ten 500Mb language support files on Vista and Win7. /i is the command argument that instructs the script to download and install the updates found.  Additional arguments are outlined within the source code of the JavaScript. 

 

Both the script and the command to execute can be customized to suite your environment’s needs.

 


Security
 
Disable Firewall- disable the Microsoft Windows Firewall for the appropriate version of Windows. 
Enable Firewall-  enable the Microsoft Windows Firewall for the appropriate version of Windows. 
Install AVI Convert-  install the LogMeIn Rescue AVI Converter which converts LogMeIn Rescue .rcec
 recordings to .avi, for the appropriate version of Windows.
Update AVG Virus Definitions: Updates your AVG (versions 8 and/or 9) virus definition files 
 
 
Maintenance
 
Purge DLL Cachedelete and restore the cache folder associated with Microsoft System File Checker for the 
  appropriate version of Windows.
Reboot- reboot the remote device(s) with a end user notification for the appropriate version of Windows.
Shut downshutdown the remote device(s) immediately for the appropriate version of Windows.
Reset System Restore-  reset (disable/enable) Microsoft System Restore for the appropriate version of 
  windows.
Turn Off System Restore- disable Microsoft System Restore for the appropriate version of windows.
Turn On System Restore- enable Microsoft System Restore for the appropriate version of windows.
Defrag- Defragments C volume
Spool Cleaner- Cleans print spooler (submitted by iDevelop)
LogMeIn UpdateUpdates host software with the latest version of LogMeIn. 

 

 

Use of these scripts is at your own risk so please test them on a small number of systems before deploying at scale. The scripts are provided “as is” without any warranty of any kind and LogMeIn disclaims any and all liability regarding any use of the scripts.  Please see the following Terms and Conditions for more information.
 
(edited and updated 8/21/19 by GlennD)
Tags (1)
132 REPLIES 132
joelasaro
Active Contributor

I haven't done this before, but that is an interesting idea.  Scripting this looks like it would be pretty easy.  I would recommend taking a look at this page (scrolll down) for some example of what you can do with the local security policy via commandline using the "net accounts" command.

 

http://www.thewindowsclub.com/customizing-the-password-policy-in-windows-7

 

I think this would just be running the following command directly via One2Many or making a batch file to do it:

net accounts /maxpwage:90

MannyMan
New Contributor

Hi everyone,

 

I need to change the license keys of AVG business antivirus for all my users (about 120). We don't have a local or virtual domain and all are users are local admins. The best we have is LogMeIn :).

 

I'd like to create a script to update the licenses for our users. I'm not very script savvy so any information definitely helps. 

 

THANKS

atilley
New Contributor

Hi all, I've been using the following script to update the Logmein client via One2Many.

 

@echo off
cd %TEMP%
if %PROCESSOR_ARCHITECTURE% equ AMD64 goto amd64
echo cd "%ProgramFiles%\logmein\x86\update" > lmiupdate.cmd
goto x86done
:amd64
echo cd "%ProgramFiles(x86)%\logmein\x64\update" > lmiupdate.cmd
:x86done
echo raupdate.exe /s >> lmiupdate.cmd
echo exit >> lmiupdate.cmd
start lmiupdate.cmd

 

This was updating in Logmein client using a version prior to 5208 up to version 5208. Now version 5220 is available, but the script is not updating clients using 5208 to 5220. However, client's using a version before 5208 are being updated to 5220 using the script above. All that being said, any ideas why this might be occuring? Any input would be GREATLY appreciated!

atilley
New Contributor

Also, I believe credit for this script is due to joelasaro, from this very thread :).
joelasaro
Active Contributor

Thanks, but to be fair I just reposted what I had scrapped from other places like spiceworks and this random LMI page: /html/assets/UpdateLogMeIn.txt

 

Now to your question, this process of updating from the command line (what the batch file is doing) has always been a bit inconsistent for me.  It definitely doesn't seem to work as consistently as doing the update form the GUI of the LMI client.  That said, I just ran the script (I haven't run it in a while as I haven't had a real need) and it is definitely updating at least some LMI endpoints to the latest 5220.  I think you may have to just be patient with it.  I vaguely recall a support ticket I opened once about this where I was told something to the effect that LMI pushes the latest updates out incrementally and not to all instances at once. 

 

Hope that helps.  Sure which LMI would just build what I feel is very basic functionality for an RMM tool into the package and we could skip this stuff.

atilley
New Contributor

Thanks, I appreciate your input! This is kind of what I expected, I've noticed something like this in the past when updating the Logmein client. 

OlwsFactory
New Contributor

Remote Command Type Task to unnistall.

cd c:\program files\logmein\x86

logmein uninstall

shutdown -r

DTConsulting
New Contributor

Here is something I put together to update MSE or Defender and then run a full scan and use SendEmail to email a log file. Most of the echo commands are for seeing the progress in the LMI logs. C:\Clevespace was the working directory where I keep the batch files and the SendEmail exe. I created a batch file and then called it using the 'Run a batch file or executable'. I also check for its existence before running the batch this way: IF EXIST C:\Clevespace\NameOfBatchFile.cmd C:\Clevespace\NameOfBatchFile.cmd

 

//Contents of Batch

@ECHO OFF
ECHO(
ECHO Running Anti-Virus scans. Do not close this window. 
ECHO Thank you, Clevespace 
ECHO(

ECHO(
ECHO Scanning process started for %COMPUTERNAME%

ECHO(
ECHO IF MSE not installed jump to end
IF EXIST "%programfiles%\Microsoft Security Client\mpcmdrun.exe" ECHO MSE detected!
IF EXIST "%programfiles%\Microsoft Security Client\mpcmdrun.exe" GOTO MSEscan
IF EXIST "%programfiles%\Windows Defender\mpcmdrun.exe" ECHO Defender detected!
IF EXIST "%programfiles%\Windows Defender\mpcmdrun.exe" GOTO DefenderScan
GOTO NotInstalled

:MSEscan
ECHO(
ECHO Run MSE Update and Scan
ECHO( 
ECHO Updating MSE Signatures 
"%programfiles%\Microsoft Security Client\mpcmdrun.exe" -SignatureUpdate 
ECHO( 
ECHO Running MSE Full Scan: 
"%programfiles%\Microsoft Security Client\mpcmdrun.exe" -scan -scantype 2 
ECHO(
ECHO Copy MSE log file if it exists 
IF EXIST "C:\Users\AdminUSERNAMEHERE\AppData\Local\Temp\MPcmdRun.log" COPY "C:\Users\ADMINUSERNAMEHERE\AppData\Local\Temp\MPcmdRun.log" C:\Clevespace /y 
GOTO MSEemail

:DefenderScan
ECHO(
ECHO Run Defender Update and Scan
ECHO( 
ECHO Updating Defender Signatures 
"%programfiles%\Windows Defender\mpcmdrun.exe" -SignatureUpdate 
ECHO( 
ECHO Running Defender Full Scan
"%programfiles%\Windows Defender\mpcmdrun.exe" -scan -scantype 2 
ECHO( 
ECHO Copy Defender log file if it exists 
IF EXIST "C:\Users\ADMINUSERNAMEHERE\AppData\Local\Temp\MPcmdRun.log" COPY "C:\Users\ADMINUSERNAMEHERE\AppData\Local\Temp\MPcmdRun.log" C:\Clevespace /y 
GOTO Defenderemail

:MSEemail
ECHO(
ECHO Email MSE log file if exists
IF EXIST C:\Clevespace\MPcmdRun.log (
TYPE C:\Clevespace\MPcmdRun.log > C:\Clevespace\MPcmdRun.txt
C:\Clevespace\sendemail -f FromEmail@Example.com -t SendToEmail@example.com -u MSE Scan results for: %COMPUTERNAME% -xu SMTPemail@example.com -xp PassWord -l C:\Clevespace\Email.log -o tls=yes -s smtp.EXAMPLE.com:587 -o message-file=C:\Clevespace\MPcmdRun.txt -a C:\Clevespace\MPcmdRun.log -q
ECHO(
ECHO MSE Log file sent on %DATE% at %TIME% from computer %COMPUTERNAME%
) ELSE (
C:\Clevespace\sendemail -f FromEmail@example.com -t SendToEmail@Example.com -u MSE Scan results for: %COMPUTERNAME% -xu SMTPemail@example.com -xp PassWord -l C:\Clevespace\Email.log -o tls=yes -s smtp.Example.com:587 -m MSE was run, but there is no log file. -q
ECHO(
ECHO MSE email with no log sent on %DATE% at %TIME% from computer %COMPUTERNAME%
)
ECHO(
ECHO End of scanning process
EXIT

:Defenderemail
ECHO(
ECHO Email Defender log file if exists
IF EXIST C:\Clevespace\MPcmdRun.log (
TYPE C:\Clevespace\MPcmdRun.log > C:\Clevespace\MPcmdRun.txt
C:\Clevespace\sendemail -f FromEmail@example.com -t SendToEmail@Example.com -u Defender Scan results for: %COMPUTERNAME% -xu SMTPemail@Example.com -xp PassWord -l C:\Clevespace\Email.log -o tls=yes -s smtp.Example.com:587 -o message-file=C:\Clevespace\MPcmdRun.txt -a C:\Clevespace\MPcmdRun.log -q
ECHO(
ECHO Defender Log file sent on %DATE% at %TIME% from computer %COMPUTERNAME%
) ELSE (
C:\Clevespace\sendemail -f FromEmail@Example.com -t SendToEmail@Example.com -u Defender Scan results for: %COMPUTERNAME% -xu SMTPemail@Example.com -xp PassWord -l C:\Clevespace\Email.log -o tls=yes -s smtp.Example.com:587 -m Defender was run, but there is no log file. -q
ECHO(
ECHO Defender email with no log sent on %DATE% at %TIME% from computer %COMPUTERNAME%
)
ECHO(
ECHO End of scanning process
EXIT

:NotInstalled
ECHO(
ECHO MSE or Defender are NOT Installed
C:\Clevespace\sendemail -f FromEmail@Example.com -t SendToEmail@Example.com -u MSE OR DEFENDER NOT INSTALLED  ON: %COMPUTERNAME% -xu SMTPemail@Example.com -xp PassWord -l C:\Clevespace\Email.log -o tls=yes -s smtp.Example.com:587 -m MS Security Essentials or Defender are not installed!!! -q
ECHO(
ECHO MSE Or Defender Not Installed and an email was sent on %DATE% at %TIME% from computer %COMPUTERNAME%
ECHO(
ECHO End of scanning process

//End of batch file

DTConsulting
New Contributor

For those times when you want to make sure there is a Restore Point created before making changes to a PC.

First I created a VBS file with the code below. Then I run it using the 'Execute a remote command' like this: 

IF EXIST C:\Clevespace\NameOfFile.vbs CSCRIPT C:\Clevespace\NameOfFile.vbs

Here is the code for the VBS file:

If WScript.Arguments.Count = 0 Then
	Set objShell = CreateObject("Shell.Application")
	objShell.ShellExecute "wscript.exe", Chr(34) & WScript.ScriptFullName & Chr(34) & " Run", , "runas", 1
Else
	GetObject("winmgmts:\\.\root\default:Systemrestore").CreateRestorePoint "Clevespace manually created this restore point before installing Windows Updates", 0, 100
End If

 

woodlark
Active Contributor

Wow this looks like it worked.. after scratching my head for 3 hours I came accross your post. I'll verify in about 20 minutes..

 

Thank you.

James.