Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 09/10/19 in all areas

  1. 1 point
    As we all know managing windows updates can be a pain sometimes, and thanks to the report created by Gavsto (https://www.gavsto.com/free-report-get-a-second-opinion-on-your-patching/) we've discovered the patch compliance reporting within Automate can be very misleading. Using this report I started to dig into the anomalies and discovered two problems The report showed the last Cumulative Update and when the installation was attempted, whether it was successful or not I didn't want to rely on a manual task to review a report, I wanted automate to raise a ticket when a machine fell behind by 35 days so we can go fix the issue Based on these issues, I decided the best way to proceed was to expand upon Gavsto's idea. Since we're trying to verify the actual current patch level of every computer, I didn't want to rely on the information already existing in Automate in case it was incorrect. I figured the most accurate source of the current patch level would be the computer itself. I created two new extra data fields and populated them with a small powershell script. The logic for the powershell script followed the same principal as the report, list out the latest cumulative update's that were installed but with the added condition of making sure the update was successful. The EDF's I created and the powershell scripts to populate them were Last Successful Patch - The Title of the patch that was last installed $Result = @(); $Session = New-Object -ComObject Microsoft.Update.Session; $Searcher = $Session.CreateUpdateSearcher(); $HistoryCount = $Searcher.GetTotalHistoryCount(); $Result = ( $Searcher.QueryHistory(0,$HistoryCount) | Where-Object { ( $_.ResultCode -eq 2 -or $_.ResultCode -eq 3 ) -and ( $_.Title -like '*Security Monthly Quality*' -or $_.Title -like '*Servicing Stack Update*' -or $_.Title -like '*Cumulative Security Update*' -or $_.Title -like '*Cumulative Update For*' -or $_.Title -like '*Feature update to*' ) -and ( $_.Title -notlike '*Cumulative Security Update For Internet Explorer*' -and $_.Title -notlike '*Cumulative Security Update for ActiveX*' -and $_.Title -notlike '*Cumulative Update for .NET Framework*' ) } | Sort-Object Date); If ($Result.count -gt 0) { return ($Result[-1]).Title } Else { Return "No CU Patching Information Available" }; Last Successful Patch Timestamp - The date and time this patch was installed, in a YYYYMMDD-HHMMSS format $Result = @(); $Session = New-Object -ComObject Microsoft.Update.Session; $Searcher = $Session.CreateUpdateSearcher(); $HistoryCount = $Searcher.GetTotalHistoryCount(); $Result = ( $Searcher.QueryHistory(0,$HistoryCount) | Where-Object { ( $_.ResultCode -eq 2 -or $_.ResultCode -eq 3 ) -and ( $_.Title -like '*Security Monthly Quality*' -or $_.Title -like '*Servicing Stack Update*' -or $_.Title -like '*Cumulative Security Update*' -or $_.Title -like '*Cumulative Update For*' -or $_.Title -like '*Feature update to*' ) -and ( $_.Title -notlike '*Cumulative Security Update For Internet Explorer*' -and $_.Title -notlike '*Cumulative Security Update for ActiveX*' -and $_.Title -notlike '*Cumulative Update for .NET Framework*' ) } | Sort-Object Date); If ($Result.count -gt 0) { return ($Result[-1]).Date.ToString('yyyyMMdd-HHmmss') } Else { Return "No CU Patching Information Available" }; The added benefit from this approach was it didn't matter how the patch was installed, whether through automate, manually or by a third party, it should always appear which is great to get an accurate sense of patch level when on boarding a new client. Now we had the latest patch information from the computer in Automate I simply created an internal monitor to compare the timestamp and log a ticket for anything that hasn't successfully patched in over 35 days. So far this has been working for me, it's also highlighted a few machines that haven't been patched since last year that didn't show up in the report. A few ideas we've had so far to improve upon this Add some verification to only log a ticket if the machine has been online during the past 35 days Run some autofix actions prior to logging a ticket such as Force the EDF's to update and revalidate Attempt to run a patch job I'd love to hear peoples feedback on this approach, any gotcha's you might see catching us out in future, or ideas to improve on the solution. If nothing else hopefully this posts helps some others detect systems that aren't patching properly.
  2. 1 point
    I use this batch file as a startup script or as a scheduled task assigned by a GPO to deploy/maintain LabTech Agent installations. I normally place it under the \\DOMAIN\NetLogon share where it can be run manually on a workstation as well. The only customization needed is the value defined for "LTServerHostname". This just needs to be a partial match of the LT Server URL so that the script can tell if the LabTech installation belongs to you or someone else. The script beginning tests if LTService is started and exists if it is running. It checks the LTServer name and if it is not yours it moves right to the removal steps. If it is yours, it checks that the LTSvcMon service is running and if so, it exits. If neither is running it checks to make sure that the service exists and tries to start it. If it starts successfully the scripts exits. This allows the script to be run as often as desired, and it will only proceed to install if the current agent is missing or broken. If the service won't start, doesn't exist, or is associated with the wrong LT Server, it enters the next stage, "PrepareForInstall". Here it verifies that the .Net requirements have been met (I haven't added in any PowerShell requirements) and uses Ninite or DISM to install .Net 3.5 if needed. It also detects Terminal Servers and enters TS Install Mode. The next stage is "StartUnInstall", where it kills processes, stops and deletes the services, and thoroughly rips out the old installation by removing registry keys and renaming the LTSvc folder. This is the section you would be interested in for a LabTech Agent Uninstall script. The last stage is the "BeginLTInstall" stage, where the agent installer is launched. @echo off REM NOTE - Script operation relies on ninitepro.exe and ltsilent.exe being in the same folder as this batch file. (Should probably test for this, right?) SETLOCAL SET "LTServerHostname=MYMSPNAME.hostedrmm.com" SET "TSMode=QUERY" REM DATE/TIME format expected: "Day MM/DD/YYYY HH:MM:SS.ss" - Other formats will break the value of "DATETIME" SET "DATETIME=%date:~10,4%%date:~7,2%%date:~4,2%-%time:~0,2%%time:~3,2%%time:~6,2%" REM Logged output is dumped out at the end of the script. LOGGINGPATH must be defined. REM If you want each command's output to be dumped to CON as the script executes, set LOGGINGPATH=CON SET LOGGINGPATH="%temp%\ltagentdeploy-%DATETIME: =%.txt" REM To skip the safety checks for an existing installation, uncomment the next line. REM GOTO PrepareForInstall REM To skip the prerequisite checks, uncomment the next line. REM GOTO StartUnInstall REM Checking for running Labtech Service, Exit if found. sc query LTService 2>NUL | findstr /i /c:"STATE" | findstr /i /c:"RUNNING" > NUL && EXIT /B REM Checking for correct server registration, advance to install if valid server address not found reg query "HKLM\Software\LabTech\Service\Settings" 2>NUL | findstr /i /c:"%LTServerHostname%" > NUL || GOTO PrepareForInstall REM Checking for running Labtech Service Monitor, Exit if found. sc query LTSvcMon 2>NUL | findstr /i /c:"STATE" | findstr /i /c:"RUNNING" > NUL && EXIT /B REM Checking for Labtech Service, advance to install if not found sc query LTService 2>NUL | findstr /i /c:"SERVICE_NAME" > NUL || GOTO PrepareForInstall REM Try to start the services, see if they are failing and need to be reinstalled net start LTService > NUL 2>&1 net start LTSvcMon > NUL 2>&1 REM Pause for 5 seconds ping -n 5 127.0.0.1 > NUL 2>&1 REM Checking for running Labtech Service, Exit if found. sc query LTService 2>NUL | findstr /i /c:"STATE" | findstr /i /c:"RUNNING" > NUL && EXIT /B REM Pause for 5 seconds ping -n 5 127.0.0.1 > NUL 2>&1 REM Checking for running Labtech Service, Exit if found. sc query LTService 2>NUL | findstr /i /c:"STATE" | findstr /i /c:"RUNNING" > NUL && EXIT /B REM Something is wrong, let's reinstall the agent. This is the point of no return unless the script encounters an error. :PrepareForInstall REM Fixup the log path in case it was set with quotes. SET LOGGINGPATH=%LOGGINGPATH:"=% REM Determine Windows Product and Version SET "WVER=" FOR /F "usebackq tokens=2 delims==" %%A IN (`type "C:\Windows\system32\prodspec.ini" 2^>NUL ^| find /i "Product=" `) DO @SET "WVER=%%~A" IF NOT DEFINED WVER FOR /F "usebackq tokens=2*" %%A IN (`reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName 2^>NUL ^| find /i "ProductName"`) DO @SET "WVER=%%~B" FOR /F "usebackq tokens=2 delims=[]" %%A IN (`ver`) DO SET "WVER=%WVER% %%~A" SET "WVER=echo %WVER%" REM Unknown Windows %WVER% | FINDSTR /R /C:"Version [5-9]\." /C:"Version 10\." > NUL || ( Call ::TheEnd ERROR - Unrecognized Windows Version & exit /b 1 ) pushd "%WINDIR%\Temp" >> "%LOGGINGPATH%" 2>&1 ECHO %DATE% %TIME% - Check for Server OS: >> "%LOGGINGPATH%" %WVER% | FINDSTR /R /C:" Server " > NUL && ( ECHO %DATE% %TIME% - Found. Check for Terminal Server >> "%LOGGINGPATH%" CHANGE USER /QUERY 2>NUL | FINDSTR /I /C:"Remote Administration" > NUL || ( ECHO %DATE% %TIME% - Terminal Server found. Check for Terminal Server Install Mode >> "%LOGGINGPATH%" SET "TSMode=EXECUTE" CHANGE USER /QUERY 2>NUL | FINDSTR /I /C:"Execute" > NUL || SET "TSMode=INSTALL" ) ) IF "%TSMode%"=="EXECUTE" CHANGE USER /INSTALL >> "%LOGGINGPATH%" 2>&1 ECHO %DATE% %TIME% - Detecting Windows Version and Checking Prequisites >> "%LOGGINGPATH%" %WVER% detected >> "%LOGGINGPATH%" REM Windows XP/2003 %WVER% | FINDSTR /R /C:"Version 5\.[12]" > NUL && ( ECHO %DATE% %TIME% - Windows XP/2003 - Launch Ninite to deploy .Net if not installed: >> "%LOGGINGPATH%" reg query "HKLM\Software\Microsoft\NET Framework Setup\NDP" | findstr /I /C:"\v3.5" /C:"\v4." > NUL || ( copy /Y "%~dp0\ninitepro.exe" "%WINDIR%\Temp" && cmd /c "CD /D "%WINDIR%\Temp" & "%WINDIR%\TEMP\Ninitepro.exe" /select ".NET" /silent "%LOGGINGPATH%-ninite" " ) >> "%LOGGINGPATH%" 2>&1 type "%LOGGINGPATH%-ninite" >> "%LOGGINGPATH%" & DEL /Q /F "%LOGGINGPATH%-ninite" >NUL 2>&1 ECHO %DATE% %TIME% - Confirming .NET is installed >> "%LOGGINGPATH%" reg query "HKLM\Software\Microsoft\NET Framework Setup\NDP" | findstr /I /C:"\v3.5" /C:"\v4." > NUL || ( Call ::TheEnd ERROR - .NET Components could not be installed & exit /b 1 ) %WVER% | FINDSTR /R /C:" Server " > NUL && ( ECHO %DATE% %TIME% - See http://support.microsoft.com/kb/3072630 if installation fails due to crypt32 errors (Failure to establish SSL connection to LabTech server) >> "%LOGGINGPATH%" REM KB3072630 Downloads - https://technet.microsoft.com/library/security/ms15-074 REM KB3072630 supercedes previous solutions KB938397 and KB968730. REM ECHO %DATE% %TIME% - See Microsoft KB938397 for a hotfix that may be needed to complete agent installation. (Resolves crypt32 error establishing SSL connections) >> "%LOGGINGPATH%" REM ECHO %DATE% %TIME% - KB - http://support.microsoft.com/kb/938397 >> "%LOGGINGPATH%" REM ECHO %DATE% %TIME% - Windows 2003 32Bit Download Location: (http://hotfixv4.microsoft.com/Windows%%20Server%%202003/sp3/Fix200653/3790/free/315139_ENU_i386_zip.exe) >> "%LOGGINGPATH%" REM ECHO %DATE% %TIME% - Windows 2003 64bit Download Location: (http://hotfixv4.microsoft.com/Windows%%20Server%%202003/sp3/Fix200653/3790/free/315159_ENU_x64_zip.exe) >> "%LOGGINGPATH%" ) ) %WVER% | FINDSTR /R /C:"Version 5\.[12]" > NUL && GOTO StartUnInstall REM Windows Vista/7/2008 %WVER% | FINDSTR /R /C:"Version 6\.1" > NUL && ( ECHO %DATE% %TIME% - Windows Vista/7/2008 - Launch Ninite to deploy .Net if not installed: >> "%LOGGINGPATH%" reg query "HKLM\Software\Microsoft\NET Framework Setup\NDP" | findstr /I /C:"\v3.5" /C:"\v4." > NUL || ( copy /Y "%~dp0\ninitepro.exe" "%WINDIR%\Temp" && cmd /c "CD /D "%WINDIR%\Temp" & "%WINDIR%\TEMP\Ninitepro.exe" /select ".NET" /silent "%LOGGINGPATH%-ninite" " ) >> "%LOGGINGPATH%" 2>&1 type "%LOGGINGPATH%-ninite" >> "%LOGGINGPATH%" & DEL /Q /F "%LOGGINGPATH%-ninite" >NUL 2>&1 ECHO %DATE% %TIME% - Confirming .NET is installed >> "%LOGGINGPATH%" reg query "HKLM\Software\Microsoft\NET Framework Setup\NDP" | findstr /I /C:"\v3.5" /C:"\v4." > NUL || ( Call ::TheEnd ERROR - .NET Components could not be installed & exit /b 1 ) ) %WVER% | FINDSTR /R /C:"Version 6\.1" > NUL && GOTO StartUnInstall REM Windows 8 or 2012 %WVER% | FINDSTR /R /C:"Version 6\.[2-9]" /C:"Version [7-9]\.[0-9]" > NUL && ( ECHO %DATE% %TIME% - Windows 8 or 2012 - Activate built-in .NET if not installed: >> "%LOGGINGPATH%" reg query "HKLM\Software\Microsoft\NET Framework Setup\NDP" | findstr /I /C:"\v3.5" > NUL || DISM /Online /Enable-Feature /FeatureName:NetFx3 /All /NoRestart >> "%LOGGINGPATH%" 2>&1 ECHO %DATE% %TIME% - Confirming .NET is installed >> "%LOGGINGPATH%" reg query "HKLM\Software\Microsoft\NET Framework Setup\NDP" | findstr /I /C:"\v3.5" > NUL || ( Call ::TheEnd ERROR - .NET Components could not be installed & exit /b 1 ) ) %WVER% | FINDSTR /R /C:"Version 6\.[2-9]" /C:"Version [7-9]\.[0-9]" > NUL && GOTO StartUnInstall REM Windows 10 or 2016 %WVER% | FINDSTR /R /C:"Version 10\." > NUL && ( ECHO %DATE% %TIME% - Windows 10 or 2016 - Activate built-in .NET if not installed: >> "%LOGGINGPATH%" reg query "HKLM\Software\Microsoft\NET Framework Setup\NDP" | findstr /I /C:"\v3.5" > NUL || DISM /Online /Enable-Feature /FeatureName:NetFx3 /All /NoRestart >> "%LOGGINGPATH%" 2>&1 ECHO %DATE% %TIME% - Confirming .NET is installed >> "%LOGGINGPATH%" reg query "HKLM\Software\Microsoft\NET Framework Setup\NDP" | findstr /I /C:"\v3.5" > NUL || ( Call ::TheEnd ERROR - .NET Components could not be installed & exit /b 1 ) ) %WVER% | FINDSTR /R /C:"Version 10\." > NUL && GOTO StartUnInstall Call ::TheEnd ERROR - Unrecognized or Unsupported Windows Version exit /b 1 REM This is the point of no return for uninstalling/reinstalling. The script will terminate services and rename the LTSvc folder, so the existing installation is definitely going down. :StartUnInstall ECHO %DATE% %TIME% - Stop LTSvcMon if it is running >> "%LOGGINGPATH%" sc query LTSvcMon 2>NUL | findstr /i /c:"STATE" | findstr /i /c:"STOPPED" > NUL || ( SC STOP LTSvcMon >> "%LOGGINGPATH%" 2>&1 TASKKILL /im ltsvcmon.exe /f >> "%LOGGINGPATH%" 2>&1 ) ECHO %DATE% %TIME% - Stop LTService if it is running >> "%LOGGINGPATH%" sc query LTService 2>NUL | findstr /i /c:"STATE" | findstr /i /c:"STOPPED" > NUL || ( SC STOP LTService >> "%LOGGINGPATH%" 2>&1 TASKKILL /im ltsvc.exe /f >> "%LOGGINGPATH%" 2>&1 ) ECHO %DATE% %TIME% - Stop Process LTTray if it is running >> "%LOGGINGPATH%" TASKKILL /im lttray.exe /f >> "%LOGGINGPATH%" 2>&1 ECHO %DATE% %TIME% - Stop LabVNC if it is running >> "%LOGGINGPATH%" sc query LabVNC 2>NUL | findstr /i /c:"STATE" | findstr /i /c:"STOPPED" > NUL || ( SC STOP LabVNC >> "%LOGGINGPATH%" 2>&1 TASKKILL /im labvnc.exe /f >> "%LOGGINGPATH%" 2>&1 ) ECHO %DATE% %TIME% - Stop LabTech Update process if it is running >> "%LOGGINGPATH%" TASKKILL /im labtechupdate.exe /f /t >> "%LOGGINGPATH%" 2>&1 ECHO %DATE% %TIME% - Rename Old LTSVC Folder if it exists >> "%LOGGINGPATH%" IF EXIST "%WINDIR%\LTSvc\." IF EXIST "%WINDIR%\LTSvc.Old\." RMDIR "%WINDIR%\LTSvc.Old" /Q /S >> "%LOGGINGPATH%" 2>&1 IF EXIST "%WINDIR%\LTSvc\." MOVE /Y "%WINDIR%\LTSvc" "%WINDIR%\LTSvc.Old" >> "%LOGGINGPATH%" 2>&1 ECHO %DATE% %TIME% - Cleanup LTUpdate folder if found. >> "%LOGGINGPATH%" IF EXIST "%TEMP%\_LTUpdate" RMDIR "%TEMP%\_LTUpdate" /Q /S >> "%LOGGINGPATH%" 2>&1 IF EXIST "%WINDIR%\TEMP\_LTUpdate" RMDIR /Q /S "%WINDIR%\TEMP\_LTUpdate" >> "%LOGGINGPATH%" 2>&1 ECHO %DATE% %TIME% - Remove LTSvcMon Service if it exists >> "%LOGGINGPATH%" sc query LTSvcMon 2>NUL | findstr /i /c:"Service_name" > NUL && SC DELETE LTSvcMon >> "%LOGGINGPATH%" 2>&1 ECHO %DATE% %TIME% - Remove LTService Service if it exists >> "%LOGGINGPATH%" sc query LTService 2>NUL | findstr /i /c:"Service_name" > NUL && SC DELETE LTService >> "%LOGGINGPATH%" 2>&1 ECHO %DATE% %TIME% - Remove LabVNC Service if it exists >> "%LOGGINGPATH%" sc query LabVNC 2>NUL | findstr /i /c:"Service_name" > NUL && SC DELETE LabVNC >> "%LOGGINGPATH%" 2>&1 REM Search and Destroy existing installations :UninstallCleanup FOR /F "usebackq tokens=*" %%A IN (`reg query "HKLM\Software\Microsoft\windows\currentversion\uninstall" /k /f "*" 2^>NUL ^| FINDSTR /r /c:"\{........-....-....-....-............}$"`) DO REG QUERY "%%A" /v DisplayName 2>NUL | FINDSTR /i /r /c:"Labtech.* Agent" > NUL && CALL ::UninstallGUID "%%~A" >> "%LOGGINGPATH%" 2>&1 FOR /F "usebackq tokens=*" %%A IN (`reg query "HKLM\Software\WOW6432Node\Microsoft\windows\currentversion\uninstall" /k /f "*" 2^>NUL ^| FINDSTR /r /c:"\{........-....-....-....-............}$"`) DO REG QUERY "%%A" /v DisplayName 2>NUL | FINDSTR /i /r /c:"Labtech.* Agent" > NUL && CALL ::UninstallGUID "%%~A" >> "%LOGGINGPATH%" 2>&1 ECHO %DATE% %TIME% - Cleanup other Registry Keys if found >> "%LOGGINGPATH%" REG QUERY "HKLM\Software\LabTech" /ve 2>NUL | FINDSTR /i /c:"LabTech" > NUL && ECHO %DATE% %TIME% - Deleting Key "HKLM\Software\LabTech" >> "%LOGGINGPATH%" && REG DELETE "HKLM\Software\LabTech" /F >> "%LOGGINGPATH%" 2>&1 REG QUERY "HKLM\Software\WOW6432Node\LabTech" /ve 2>NUL | FINDSTR /i /c:"LabTech" > NUL && ECHO %DATE% %TIME% - Deleting Key "HKLM\Software\WOW6432Node\LabTech" >> "%LOGGINGPATH%" && REG DELETE "HKLM\Software\WOW6432Node\LabTech" /F >> "%LOGGINGPATH%" 2>&1 GOTO UninstallCleanupEnd :UninstallGUID SETLOCAL SET "_K=%~nx1" IF "%_K%"=="" exit /b 0 SET "_RK=%_K:~8,1%%_K:~7,1%%_K:~6,1%%_K:~5,1%%_K:~4,1%%_K:~3,1%%_K:~2,1%%_K:~1,1%%_K:~13,1%%_K:~12,1%%_K:~11,1%%_K:~10,1%%_K:~18,1%%_K:~17,1%%_K:~16,1%%_K:~15,1%%_K:~21,1%%_K:~20,1%%_K:~23,1%%_K:~22,1%%_K:~26,1%%_K:~25,1%%_K:~28,1%%_K:~27,1%%_K:~30,1%%_K:~29,1%%_K:~32,1%%_K:~31,1%%_K:~34,1%%_K:~33,1%%_K:~36,1%%_K:~35,1%" FOR /F "usebackq tokens=2,*" %%A IN (`REG QUERY "%~1" /v DisplayName 2^>NUL ^| FIND /i "DisplayName"`) DO ECHO %DATE% %TIME% - Uninstalling Product "%%~B", GUID %_K% start /b /wait MSIEXEC /X %_K% /QN /NORESTART ECHO %DATE% %TIME% - Uninstall Command Completed ECHO %DATE% %TIME% - Cleaning registry keys and folders related to %_K% REM echo Delete Key HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Classes\Installer\Products\%_RK% REG DELETE "HKLM\SOFTWARE\WOW6432Node\Classes\Installer\Products\%_RK%" /f 2>NUL && ECHO %DATE% %TIME% - Removed Registry Key "HKLM\SOFTWARE\WOW6432Node\Classes\Installer\Products\%_RK%" REM echo Delete Key HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products\%_RK% REG DELETE "HKLM\SOFTWARE\Classes\Installer\Products\%_RK%" /f 2>NUL && ECHO %DATE% %TIME% - Removed Registry Key "HKLM\SOFTWARE\Classes\Installer\Products\%_RK%" REM echo Delete Folder C:\Windows\Installer\%_K% IF EXIST "C:\Windows\Installer\%_K%\." rmdir /q /s "C:\Windows\Installer\%_K%" 2>NUL && ECHO %DATE% %TIME% - Removed Directory "C:\Windows\Installer\%_K%" IF EXIST "C:\ProgramData\Package Cache\%_K%\." rmdir /q /s "C:\ProgramData\Package Cache\%_K%" 2>NUL && ECHO %DATE% %TIME% - Removed Directory "C:\ProgramData\Package Cache\%_K%" REM echo Delete key %~1 REG DELETE "%~1" /f 2>NUL && ECHO %DATE% %TIME% - Removed Registry Key "%~1" ENDLOCAL :UninstallGUIDEnd exit /b 0 :UninstallCleanupEnd ECHO %DATE% %TIME% - System prerequisites confirmed.>> "%LOGGINGPATH%" :BeginLTInstall ECHO %DATE% %TIME% - Copy and launch LTSilent.exe. >> "%LOGGINGPATH%" COPY /Y "%~dp0\LTSilent.exe" "%WINDIR%\Temp" >> "%LOGGINGPATH%" 2>&1 start /b /wait "LT" cmd /c ""%WINDIR%\Temp\LTSilent.exe" /Q /S >> "%LOGGINGPATH%" 2>&1" ECHO %DATE% %TIME% - LTSilent.exe process has completed. >> "%LOGGINGPATH%" timeout /t 5 /nobreak > NUL sc query LTService 2>NUL | findstr /i /c:"Service_name" > NUL || ( Call ::TheEnd ERROR - LTService was not successfully installed & exit /b 1 ) ECHO %DATE% %TIME% - Success! LTService is installed. >> "%LOGGINGPATH%" popd :TheEnd IF NOT "[%~1]"=="[]" ECHO %DATE% %TIME% - %* >> "%LOGGINGPATH%" %WVER% | FINDSTR /R /C:" Server " > NUL && IF NOT "%TSMode%"=="QUERY" CHANGE USER /%TSMode% >> "%LOGGINGPATH%" 2>&1 IF NOT "%LOGGINGPATH%"=="CON" ( TYPE "%LOGGINGPATH%" 2>NUL ) ENDLOCAL exit /b This supports and has been tested on XP-Windows 10/Server 2003-2012R2. Server 2016 should be supported, but has not been tested.
×
×
  • Create New...