Hi,
We have a script which has been provided by a vendor. The script calls a stored procedure on a remote SQL database and removes a computer object.
I want to run the script 'Locally on the Deployment Server' (6.9 SP5 MR1) and make use of the Altiris %COMPNAME% token.
I can confirm the script runs if we run it outside of Altiris (E.g. Windows), but not within Altiris.
NB: Our 'Altiris eXpress Server' service runs under the context of an Active Directory account which has appropriate rights to run the stored procedure on the SQL server.
We have other VBS scripts which access other remote objects on different systems and these work fine.
I'm wondering if anyone can help get this script working within Altiris DS, I think it needs amending...
Thanks,
RL
'================
' Execute_BatchDelete.vbs (Execute the Machine_BatchDelete SP)
' Release v1.0
' ================
Dim sDSN, SQLServer, SQLDB, NetBiosName, objShell
'CONFIGURATION
'================
SQLServer = "SQL1"
SQLDB = "DB1"
'================
Set objShell = CreateObject("WScript.Shell")
Set objCommand = CreateObject("ADODB.Command")
Set objParam = CreateObject("ADODB.Parameter")
Set rs = CreateObject("ADODB.Recordset")
sDSN = "Provider=SQLOLEDB;Data Source=" & SQLServer & ";Initial Catalog=" & SQLDB & ";Integrated Security=SSPI"
NetBiosName = objShell.ExpandEnvironmentStrings("%COMPNAME%")
objCommand.ActiveConnection = sDSN
objCommand.commandtext = "Machine_BatchDelete"
objCommand.CommandType = 4 'defines cmd type as stored proc
Set objParm = objCommand.CreateParameter("@GroupName",200,1,256)
objCommand.Parameters.Append objParm
Set objParm = objCommand.CreateParameter("@MachineNameFilter",200,1,64,NetBiosName)
objCommand.Parameters.Append objParm
Set objParm = objCommand.CreateParameter("@PreviewOnly",11,1,1,0)
objCommand.Parameters.Append objParm
set rs = objCommand.Execute