NOTE: This script is provided by KACE support without gaurantee or warranty as to usage and portability between versions.
Custom Scripting is not supported under Support Guidelines and is presented for demonstration and instructional purposes
The Batch File
REM =========================================================================================== REM Title: Install DSN by Script REM Author: KACE Support REM Description: REM Detects 64 bit architecture and installs DSN in the correct registry branch accrodingly REM =========================================================================================== @echo off If defined ProgramFiles(x86) ( %WINDIR%\SysWOW64\odbcconf.exe CONFIGDSN "SQL Server" "DSN=K1000|Description=KACETest|SERVER=127.0.0.1|Trusted_Connection=No|Database=ORG1" ) else ( %WINDIR%\System32\odbcconf.exe CONFIGDSN "SQL Server" "DSN=K1000|Description=KACETest|SERVER=127.0.0.1|Trusted_Connection=No|Database=ORG1" )
Create this file and save it on your desktop as DSNadd.bat
Create a new Online Kscript
Click Scripting | Choose Action | Add New Item
Now attach the .bat file you created above as a dependancy.
Now under Verify
Choose Launch a program...
Directory: $(KACE_DEPENDENCY_DIR)
File: DSNadd.bat
Wait for completion checked
Parameters:
Click Save.
Now scroll to the bottom of the screen and click Save.
Your script is now ready to run.
As this script is setup if assigned to a label or computer and scheduled it will install repeatedly.
This script is set up to be more of a one time push action. If you wanted to use it in a schedule you would need to add something to detect and move the verify step down to Remediation.
One way to achieve this is...
© ALL RIGHTS RESERVED. Feedback Terms of Use Privacy Cookie Preference Center