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
ColWhackaMole
New Contributor

Does anyone have a script to uninstall unused programs? Also does anyone have any suggesstions on how to use One2Many to keep computers running fast without anything popping up or notifying users? Thanks all.

 

-ColWhackaMole

LouieLouI
New Contributor

Here's a handy batch file for MySQL Databases (selects, updates, etc):

 

 

rem - Note SQL Statements that generate files should have their outfile deleted first!
set sqlcommand="Your SQL Statement Here"

rem - Nav to your MySQL / MariaDB Instance, edit path to your preference:
cd d:\
cd "d:\mariadb 5.5\bin\"

rem - Pipe your SQL command into a txt file:
echo %sqlcommand% > sql.txt

rem Execute your SQL, provide username and password as arguments to the batch file:
mysql --user=%1 --password=%2 --database="database name" < sql.txt

Might be messy, but sure as heck effective!

 

Added Bonusl when setting up the task, specify the text file (if one is created by your statement) as the log file in LMI, and now you can view the resulting file in LMI.  (Feature Suggestion: email the log file along with the task summary emails!)

 

Also in hindsight, the database name could be another batch file argument!

that_ITguy714
New Contributor

I am looking for a script to run antivirus when a malware/virus infection is found. Also, would like the script to have a time feature, so I can have it run when clients are not in the office, like between 10-12pm CST.

Also can anyone point me in the direction of a how to guide on script writing? I am fresh out of college and still learning the LogMeIn system.

slewis1972
New Contributor

Hi

 

Has anyone got a spiceworks script that I can pump put via this method?

 

Thanks in advance.

Atom86
New Contributor

Code I scraped together that will:
1 dertermin OS

2 Update MSE

3 Full Scan with MSE

 

File: MSE-Update-Scan-Vista-8.bat

 

rem - MSE: Update and scan system from CMD as a background process.

@ECHO OFF
CLS
ver|find "Windows XP" > NUL
if errorlevel 1 goto 2K
ECHO Windows XP Detected.
goto END

:2K
ver|find "Windows 2000" >NUL
if errorlevel 1 goto 2k3
ECHO Windows 2000 Detected.
goto END

:2K3
ver|find "Version 5.2" >NUL
if errorlevel 1 goto WinVista
ECHO Windows 2003 Detected.

:WinVista
ver|find "Version 6.0" >NUL
if errorlevel 1 goto Win7
ECHO Windows Vista Detected.

Echo Updating Microsoft Security Essentials Signatures
"%programfiles%\Microsoft Security Client\mpcmdrun.exe" -SignatureUpdate

Echo Run Full Scan:
"%programfiles%\Microsoft Security Client\mpcmdrun.exe" -scan -scantype 2

:Win7
ver|find "Version 6.1" >NUL
if errorlevel 1 goto Win8
ECHO Windows 7 Detected.

Echo Updating Microsoft Security Essentials Signatures
"%programfiles%\Microsoft Security Client\mpcmdrun.exe" -SignatureUpdate

Echo Run Full Scan:
"%programfiles%\Microsoft Security Client\mpcmdrun.exe" -scan -scantype 2

:Win8
ver|find "Version 6.2" >NUL
if errorlevel 1 goto ERR
ECHO Windows 8 Detected.

Echo Updating Microsoft Security Essentials Signatures
"%programfiles%\Windows Defender\MpCmdRun.exe" -SignatureUpdate

Echo Run Full Scan:
"%programfiles%\Windows Defender\MpCmdRun.exe" -Scan -ScanType 2

goto END
:END
ECHO.

 

seamanjeff
New Contributor

Is there amy way to slam in a password change without the password appearing in the log?  I just had to change all my administrator passwords on short notice but now the results of the command line "net user" are in the log files.  

dwalters
New Contributor

Anyone have a script for uninstalling tightvnc?

 

Sincere thanks

bridgew
New Contributor

 

MsiExec.exe /x{D903B276-81AE-4AED-AEF9-45DACFBF16CE} /qn /norestart

 

This command had been tested to work with v2.7.10 of TightVNC but won't necessarily work with earlier versions if the GUID has been changed by the Developers of TightVNC

j_helland
Active Contributor

I've got a few goodies that I thought I'd share seeing as nobody has posted to this topic in a while. 

 

Important to note is that One2Many is MOST powerful in my opinion, when the "custom" task type is used. By using this type of task, you can copy files and run scripts in one step vs using one task to "deploy scripts" and another task to run batch files or executables.

 

Also important to note is that, using the "custom" task, there is only ONE LINE given to execute DOS commands. You CAN execute multiple DOS commands on one line by using the "&&" command to separate the commands.

 

For Example. . . this command would copy files that you've uploaded to a specified location(s) on the target computer.

 

copy filename.txt "c:\users\userABC\documents"&&copy picture.jpeg "c:\users\userABC\pictures"

 

______________________________________________________________

 

Sleep&Wake @ 6:00: Puts the computer to sleep @ 6:00pm and wakes the computer up @ 6:00am. I use this because some of my computers have usb devices attached which don't allow them to sleep.

 

Prerequisites: This script uses 2 different .xml files which I've exported from windows tasks in the task manager (windows7). I use the "custom" task, upload the xml files, then run this command in the "command to execute" field.

 

 copy wakeat6.xml "c:\vrad software\scripts"&&copy sleepat6.xml  "c:\vrad software\scripts"&&schtasks /create /tn Sleep_at_6 /xml "c:\vrad software\scripts\sleepat6.xml"&&schtasks /create /tn Wake_at_6 /xml "c:\vrad software\scripts\wakeat6.xml"

 

______________________________________________________________

 

 

Install SpiceWorks: Installs Spiceworks. I have about 500 LogMeIn clients in the cloud....so I need Spiceworks to manage my inventory. Spiceworks has an "agent" which reports intricate computer hardware and software details back to my central server. I can monitor the server and determine computer depreciation, OS upgrade status as well as trigger alerts if malicious software is installed, or if the computer is low on resources. Spiceworks is free of charge.

 

Prerequisites: You'll need to set up your own SpiceWorks server and your LMI clients will need to be able to talk to it's IP address and specific port (of your choosing). If you're on a LAN, there is a LANscan option available. After setup, you'll fill in the variables within the installer script to specify IP, Port and authentication key.

 

msiexec.exe /x "Spiceworks Agent.msi" ALLUSERS=1 /q /norestart&&msiexec.exe /i "spiceworks agent.msi" SPICEWORKS_SERVER="server/ip" SPICEWORKS_AUTH_KEY="unique_key" SPICEWORKS_PORT=port/q /noresta

 

______________________________________________________________

 

 

Check Download Speed: Checks the download speed/bandwidth on the target computer. 

 

Prerequisites: Just paste the text below into a .vbs script called speedtest.vbs, upload the script into the "custom" task type, then run the command cmd /c cscript speedtest.vbs. After you run the task, check the log file in LMI, it should show you the speed in kilobytes.

 

Script: (Paste into notepad, save as speedtest.vbs)

 

strSource= "http://networking.us.uu.net/customer_support/pal/pal_4/newf1.zip"
strDest = "c:\newf1.zip"
StartTime = Timer
set HTTP = WScript.CreateObject("Microsoft.XMLHTTP")
HTTP.open "GET", strSource, False
Set filesys = CreateObject("Scripting.FileSystemObject")
set Stream = createobject("adodb.stream")
Const adTypeBinary = 1
Const adSaveCreateNotExist = 1
Const adSaveCreateOverWrite = 2
Stream.type = adTypeBinary
Stream.open
Stream.savetofile strDest, adSaveCreateOverWrite
EndTime = Timer
set Stream = nothing
set HTTP = nothing
filesys.DeleteFile "c:\newf1.zip"

TimeIt = 957/(EndTime - StartTime)
wscript.echo FormatNumber(TimeIt, 2) & " " & "KBps"

 

______________________________________________________________

 

Message to End User: This one is simple. It's a simple pop up window that appears in front of all other windows on the end user side. I don't know why LMI doesn't just build this functionality into LMI Central........probably because they're always on vacation. Every time I ask for some new functionality I get a polite message back from them "we'll consider your idea.........". 

 

Prerequisites: There is a charactor limit in your message. Think Twitter. If you use too many characters the task will error and the end user won't see the message. This task type is the simple "remote command".

 

We have outages at which we need to alert our end (cloud) users quickly without calling all of them. This is our preferred method. Note, the message will disappear after 999 seconds. This is the longest timeout available in the DOS msg code (to my knowledge).

 

msg * /time:999  **ATTENTION**There was ~20 minute outage in which a piece of networking hardware failed. We were able to resurrect this and do not anticipate any further issues.

 

______________________________________________________________

 

 

I hope someone finds these helpful. I understand that these won't be helpful to everyone, however if you note the importance of being able to use the "custom" task type to perform multiple tasks without having to run 2,3,4 tasks individually. 

 

Please shoot me a message if this helped you out 🙂

 

Lj

StrobeTech
New Contributor

Hi Everyone,

 

Starting to use One2Many more and more for automated tasks but found that the restart command a little limited especially if you manage multiple version of Windows.

 

Here is an updated version that might be of interest: -

 

@echo off
rem =====================================================================================================
rem =	Company:	Strobe Technologies Ltd T/a Strobe IT
rem =	Author:		Robin Toy
rem =	Version:	v 1.2
rem =	Date:		25/01/2014
rem ======================================================================================================
rem =	Description:
rem = 		LogMeIn One2Many Windows Reboot Script
rem =
rem = 		This script detects the version of Windows that it is being run on and executes
rem =		the correct shutdown command to perform a restart of that computer
rem =====================================================================================================



rem --------------------------------------------------------------------------------------------------------------------
rem - General Start Script
rem ----------------------
rem Setlocal

echo Restart Script Starting
date /T
time /T
echo.

:: Get windows Version numbers
for /f "tokens=2 delims=[]" %%G in ('ver') do (set _version=%%G) 

for /f "tokens=2,3,4 delims=. " %%G in ('echo %_version%') Do (set _major=%%G& set _minor=%%H& set _build=%%I) 

echo Major version: %_major%  Minor Version: %_minor%.%_build%

if "%_major%"=="5" goto sub5
if "%_major%"=="6" goto sub6

echo Unsupported Windows OS version Detected
echo.
goto exit
rem --------------------------------------------------------------------------------------------------------------------



rem --------------------------------------------------------------------------------------------------------------------
rem - Windows Major Version 5
rem -------------------------
:sub5
::Win XP or 2003
if "%_minor%"=="2" goto sub5_2
echo Windows XP [%PROCESSOR_ARCHITECTURE%]
echo.
echo Restarting Computer in 10 seconds
shutdown /r /f /c "Strobe IT Scheduled Reboot" /t 10
goto exit

:sub5_2
echo Windows 2003 or XP 64 bit [%PROCESSOR_ARCHITECTURE%]
echo.
echo Restarting Computer in 10 seconds
shutdown /r /f /c "Strobe IT Scheduled Reboot" /t 10
goto exit
rem --------------------------------------------------------------------------------------------------------------------



rem --------------------------------------------------------------------------------------------------------------------
rem - Windows Major Version 6
rem -------------------------
:sub6
if "%_minor%"=="1" goto sub6_1
if "%_minor%"=="2" goto sub6_2
if "%_minor%"=="3" goto sub6_3
echo Windows Vista or Windows 2008 [%PROCESSOR_ARCHITECTURE%]
echo.
echo Restarting Computer in 10 seconds
shutdown /r /f /c "Strobe IT Scheduled Reboot" /t 10 /d P:0:0
goto exit

:sub6_1
echo Windows 7 or Windows 2008 R2 [%PROCESSOR_ARCHITECTURE%]
echo.
echo Restarting Computer in 10 seconds
shutdown /r /f /c "Strobe IT Scheduled Reboot" /t 10 /d P:0:0
goto exit

:sub6_2
echo Windows 8 or Windows 2012 [%PROCESSOR_ARCHITECTURE%]
echo.
echo Restarting Computer in 10 seconds
shutdown /r /f /c "Strobe IT Scheduled Reboot" /t 10 /d P:0:0
goto exit

:sub6_3
echo Windows 8.1 [%PROCESSOR_ARCHITECTURE%]
echo.
echo Restarting Computer in 10 seconds
shutdown /r /f /c "Strobe IT Scheduled Reboot" /t 10 /d P:0:0
goto exit
rem --------------------------------------------------------------------------------------------------------------------



rem --------------------------------------------------------------------------------------------------------------------
rem - Windows Major Version 7
rem -------------------------
rem N/A
rem --------------------------------------------------------------------------------------------------------------------



rem --------------------------------------------------------------------------------------------------------------------
rem - General Finish Script
rem -----------------------
:exit
echo Restart Script Finished
date /T
time /T
rem exit
rem --------------------------------------------------------------------------------------------------------------------

 

 

 

Thanks

Robin