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

Re: One2Many Script Repository

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

New Contributor

Re: One2Many Script Repository

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 Smiley Happy.

 

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

New Contributor

Re: One2Many Script Repository

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!

New Contributor

Re: One2Many Script Repository

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

Re: One2Many Script Repository

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.

New Contributor

Re: One2Many Script Repository

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. 

New Contributor

Re: One2Many Script Repository

Remote Command Type Task to unnistall.

cd c:\program files\logmein\x86

logmein uninstall

shutdown -r

New Contributor

Re: One2Many Script Repository - Microsoft Security Essentials & Windows Defender

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

Smiley Very HappyefenderScan
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

Smiley Very Happyefenderemail
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

New Contributor

Re: One2Many Script Repository - Create Restore Point Silently

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\defaultSmiley Frustratedystemrestore").CreateRestorePoint "Clevespace manually created this restore point before installing Windows Updates", 0, 100
End If

 

Active Contributor

Re: One2Many Script Repository

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.