Custom Script works for some machines and not others. Get Error Message : Incorrect function
I have created a batch file that I push out that runs a command and ports the results and creates a text file located on a network share. I'm unable to see why it work on some and not the rest. Can any one help?
Here is part of the computer log file that the script failed on:
[ 2012-06-27 12:55:16:264 ] [ 1624 ] [INFO] InternetGetRequestEx : DesktopCentral Server & Port -> 10.222.65.24 : 8020
[ 2012-06-27 12:55:16:280 ] [ 1624 ] [INFO] InternetGetRequestEx : Content Length of the request file: 126 Bytes
[ 2012-06-27 12:55:16:280 ] [ 1624 ] [INFO] CreateFolder : The Directory to create is C:\Program Files\DesktopCentral_Agent\\Computer\Startup\
[ 2012-06-27 12:55:16:280 ] [ 1624 ] [INFO] Bytes read reached the contenlength
[ 2012-06-27 12:55:16:280 ] [ 1624 ] [INFO] InternetGetRequestEx: Total bytes readed = 126
[ 2012-06-27 12:55:16:296 ] [ 1624 ] [INFO] InternetGetRequestEx : Successfully downloaded the file client-data/1/domains/cammis/5709/pgp_confirm32.bat from the server 10.222.65.24 to the destination file C:\Program Files\DesktopCentral_Agent\\Computer\Startup\pgp_confirm32.bat
[ 2012-06-27 12:55:16:296 ] [ 1624 ] [INFO] ProcessScriptConfiguration : File Sucessfully downloaded to client
[ 2012-06-27 12:55:16:296 ] [ 1624 ] [INFO] ProcessScriptConfiguration:scriptNamePath:C:\Program Files\DesktopCentral_Agent\Computer\Startup\pgp_confirm32.bat
[ 2012-06-27 12:55:16:296 ] [ 1624 ] [INFO] ProcessScriptConfiguration : Going to Add Script
[ 2012-06-27 12:55:16:296 ] [ 1624 ] [INFO] AddScriptConfiguration : Script Name : C:\Program Files\DesktopCentral_Agent\Computer\Startup\pgp_confirm32.bat
[ 2012-06-27 12:55:16:296 ] [ 1624 ] [INFO] AddScriptConfiguration : Script Type : Startup
[ 2012-06-27 12:55:16:296 ] [ 1624 ] [INFO] AddScriptConfiguration : Script Params :
[ 2012-06-27 12:55:16:296 ] [ 1624 ] [INFO] AddScriptConfiguration : Script keys : 5709
[ 2012-06-27 12:55:16:296 ] [ 1624 ] [INFO] AddScriptConfiguration : Execution Type : 1
[ 2012-06-27 12:55:16:296 ] [ 1624 ] [INFO] AddScriptConfiguration : Number of executions : 0
[ 2012-06-27 12:55:16:296 ] [ 1624 ] [INFO] AddScriptConfiguration : ExecutionType is Immedeate Execution
[ 2012-06-27 12:55:16:296 ] [ 1624 ] [INFO] Inside ExecuteScript Method
[ 2012-06-27 12:55:16:296 ] [ 1624 ] [INFO] ExecuteScript : applPath -> C:\Program Files\DesktopCentral_Agent\Computer\Startup\pgp_confirm32.bat
[ 2012-06-27 12:55:16:296 ] [ 1624 ] [INFO] ExecuteScript : commandLineParam ->
[ 2012-06-27 12:55:16:296 ] [ 1624 ] [INFO] ExecuteScript : File extension to execute -> .bat
[ 2012-06-27 12:55:16:296 ] [ 1624 ] [INFO] ExecuteScript : Appln with args -> "C:\Program Files\DesktopCentral_Agent\Computer\Startup\pgp_confirm32.bat"
[ 2012-06-27 12:55:16:296 ] [ 1624 ] [INFO] GetActiveSessionId : WTSGetActiveConsoleSessionId = 0
[ 2012-06-27 12:55:16:311 ] [ 1624 ] [INFO] ExecuteScript : The active session User name is given by
[ 2012-06-27 12:55:16:343 ] [ 1624 ] [INFO] execute : Process successfully created for application "C:\Program Files\DesktopCentral_Agent\Computer\Startup\pgp_confirm32.bat"
[ 2012-06-27 12:55:17:671 ] [ 1624 ] [ERROR] Error Code : 1 , Error Message : Incorrect function.
[ 2012-06-27 12:55:17:671 ] [ 1624 ] [INFO] execute : Exit code for the application : 1
[ 2012-06-27 12:55:17:671 ] [ 1624 ] [INFO] execute : Remarks from the CreateProcess is Incorrect function. for the executable "C:\Program Files\DesktopCentral_Agent\Computer\Startup\pgp_confirm32.bat"
[ 2012-06-27 12:55:17:671 ] [ 1624 ] [INFO] @@@@@@@@ End Of ExecuteScript Method @@@@@@@@
[ 2012-06-27 12:55:17:671 ] [ 1624 ] [INFO] Message : The operation completed successfully.
[ 2012-06-27 12:55:17:671 ] [ 1624 ] [ERROR] AddScriptConfiguration : Error in executing script configuration 0 ..The operation completed successfully. [ 2012-06-27 12:55:17:671 ] [ 1624 ] [INFO] Inside DeleteScriptConfiguration
[ 2012-06-27 12:55:17:671 ] [ 1624 ] [INFO] DeleteScriptConfiguration:SOFTWARE\AdventNet\DesktopCentral\DCAgent\Scripts\Startup\5709
[ 2012-06-27 12:55:17:671 ] [ 1624 ] [INFO] deleteRegistryKey: Key successfull deleted!: 0
[ 2012-06-27 12:55:17:671 ] [ 1624 ] [INFO] deleteRegistryKey errorCode :0
[ 2012-06-27 12:55:17:671 ] [ 1624 ] [INFO] AddScriptConfiguration : Script deleted in the registry
[ 2012-06-27 12:55:17:671 ] [ 1624 ] [INFO] AddScriptConfiguration : Successfully freed the current Script .
[ 2012-06-27 12:55:17:671 ] [ 1624 ] [ERROR] Error Code : 1 , Error Message : Incorrect function.
[ 2012-06-27 12:55:17:671 ] [ 1624 ] [INFO] Freeing the allocated memory in ProcessScriptConfiguration
[ 2012-06-27 12:55:17:671 ] [ 1624 ] [INFO] GetRetryStatusData : ExecutedRetryCount Can't read
[ 2012-06-27 12:55:17:671 ] [ 1624 ] [INFO] GetRetryStatusData : TotalFailureRetryCount read sucess
[ 2012-06-27 12:55:17:671 ] [ 1624 ] [INFO] SendConfigStatusUpdateEx : Data to Send to Server ->
<?xml version="1.0" encoding="UTF-8"?>
<agent-params>
<AgentParams AGENT_PARAM_ID="3" PARAM_NAME="NAME" PARAM_VALUE="SAC0DWMJLAAZ2" />
<AgentParams AGENT_PARAM_ID="3" PARAM_NAME="DOMAIN_NETBIOS_NAME" PARAM_VALUE="CAMMIS" />
<AgentParams AGENT_PARAM_ID="3" PARAM_NAME="RESOURCE_ID" PARAM_VALUE="42" />
<AgentParams AGENT_PARAM_ID="3" PARAM_NAME="COMPUTER_NAME" PARAM_VALUE="SAC0DWMJLAAZ2" />
<AgentParams AGENT_PARAM_ID="3" PARAM_NAME="MSP_NAME" PARAM_VALUE="DC_MSP" />
<AgentParams AGENT_PARAM_ID="3" PARAM_NAME="CUSTOMER_NAME" PARAM_VALUE="DC_CUSTOMER" />
<AgentParams AGENT_PARAM_ID="3" PARAM_NAME="CUSTOMER_ID" PARAM_VALUE="1" />
<AgentParams AGENT_PARAM_ID="3" PARAM_NAME="RESOURCE_TYPE" PARAM_VALUE="1" />
<AgentParams AGENT_PARAM_ID="3" PARAM_NAME="CONFIG_DATA_ID" PARAM_VALUE="12647" />
<AgentParams AGENT_PARAM_ID="3" PARAM_NAME="STATUS" PARAM_VALUE="7" />
<AgentParams AGENT_PARAM_ID="3" PARAM_NAME="REMARKS" PARAM_VALUE="Failed to Run the script : Incorrect function." />
<AgentParams AGENT_PARAM_ID="3" PARAM_NAME="ERROR_CODE" PARAM_VALUE="-1" />
<AgentParams AGENT_PARAM_ID="3" PARAM_NAME="COLLECTION_ID" PARAM_VALUE="5709" />
<AgentParams AGENT_PARAM_ID="3" PARAM_NAME="IP_ADDRESS" PARAM_VALUE="10.222.70.162" />
<AgentParams AGENT_PARAM_ID="3" PARAM_NAME="LAST_RETRY_ATTEMPT" PARAM_VALUE="0" />
<AgentParams AGENT_PARAM_ID="3" PARAM_NAME="TOTAL_RETRY_COUNT" PARAM_VALUE="2" />
<AgentParams AGENT_PARAM_ID="3" PARAM_NAME="APPLY_TYPE" PARAM_VALUE="Refresh" />
<AgentParams AGENT_PARAM_ID="3" PARAM_NAME="NEXT_APPLY_TYPE" PARAM_VALUE="Refresh/Startup" />
<AgentParams AGENT_PARAM_ID="3" PARAM_NAME="COMPUTER_DOMAIN_NAME" PARAM_VALUE="CAMMIS" />
<AgentParams AGENT_PARAM_ID="3" PARAM_NAME="AGENT_TIME" PARAM_VALUE="1340826916000" />
</agent-params>
[ 2012-06-27 12:55:17:671 ] [ 1624 ] [INFO] Config Id : 0 is not a patch/servicepack configuration, so sending default configuration string
[ 2012-06-27 12:55:17:671 ] [ 1624 ] [INFO] AgentSendRequest : The url to get / send in UTF8 format is given by /statusUpdate?computerName=SAC0DWMJLAAZ2&domainName=CAMMIS&customerId=1&actionToCall=3&actions=1
[ 2012-06-27 12:55:17:671 ] [ 1624 ] [INFO] InternetSendRequestEx : DesktopCentral Server & Port -> 10.222.65.24 : 8020
[ 2012-06-27 12:55:17:686 ] [ 1624 ] [INFO] InternetSendRequestEx : Successfully posted the data to the server 10.222.65.24
[ 2012-06-27 12:55:17:686 ] [ 1624 ] [INFO] InternetSendRequestEx : Reading the response sent by the server 10.222.65.24
[ 2012-06-27 12:55:17:686 ] [ 1624 ] [INFO] SendConfigStatusUpdateEx : Successfully posted the Configuration status to the server . So going to trucate the datas available (if any) in the confighistory file
[ 2012-06-27 12:55:17:686 ] [ 1624 ] [INFO] @@@@@@@@ End Of ProcessScriptConfiguration Method @@@@@@@@
[ 2012-06-27 12:55:17:686 ] [ 1624 ] [INFO] WriteEvent: Registering Event Source!
[ 2012-06-27 12:55:17:686 ] [ 1624 ] [INFO] WriteEvent: Reporting event Desktopcentral Agent has processed pgp scan 32 bit (Script Configuration) . For more details see the logs under <Desktopcentral_Agent>\logs folders .
[ 2012-06-27 12:55:17:686 ] [ 1624 ] [INFO] UpdateConfigDataStatus : The Required SubKey is given by Software\AdventNet\DesktopCentral\DCAgent\CollectionHistory\5709
[ 2012-06-27 12:55:17:686 ] [ 1624 ] [INFO] deleteValue: Key found ...!: 0
[ 2012-06-27 12:55:17:686 ] [ 1624 ] [INFO] deleteValue: Delete value ConfigDataID success!
[ 2012-06-27 12:55:17:686 ] [ 1624 ] [INFO] Completed the processing of Script Configuration configuration
[ 2012-06-27 12:55:17:686 ] [ 1624 ] [INFO] ******************************************************************************
[ 2012-06-27 12:55:17:686 ] [ 1624 ] [INFO] Message : The operation completed successfully.
[ 2012-06-27 12:55:17:686 ] [ 1624 ] [INFO] ProcessConfigurations : configuration Failed.it ill try to redeploy again
Here is part of the computer log file that the script worked on:
[ 2012-06-27 12:53:37:472 ] [ 4200 ] [INFO] AgentSendRequest : The url to get / send in UTF8 format is given by client-data/1/domains/cammis/5709/pgp_confirm32.bat
[ 2012-06-27 12:53:37:472 ] [ 4200 ] [INFO] InternetGetRequestEx : DesktopCentral Server & Port -> 10.222.65.24 : 8020
[ 2012-06-27 12:53:37:472 ] [ 4200 ] [INFO] InternetGetRequestEx : Content Length of the request file: 126 Bytes
[ 2012-06-27 12:53:37:472 ] [ 4200 ] [INFO] CreateFolder : The Directory to create is C:\Program Files\DesktopCentral_Agent\\Computer\Startup\
[ 2012-06-27 12:53:37:472 ] [ 4200 ] [INFO] Bytes read reached the contenlength
[ 2012-06-27 12:53:37:472 ] [ 4200 ] [INFO] InternetGetRequestEx: Total bytes readed = 126
[ 2012-06-27 12:53:37:503 ] [ 4200 ] [INFO] InternetGetRequestEx : Successfully downloaded the file client-data/1/domains/cammis/5709/pgp_confirm32.bat from the server 10.222.65.24 to the destination file C:\Program Files\DesktopCentral_Agent\\Computer\Startup\pgp_confirm32.bat
[ 2012-06-27 12:53:37:503 ] [ 4200 ] [INFO] ProcessScriptConfiguration : File Sucessfully downloaded to client
[ 2012-06-27 12:53:37:503 ] [ 4200 ] [INFO] ProcessScriptConfiguration:scriptNamePath:C:\Program Files\DesktopCentral_Agent\Computer\Startup\pgp_confirm32.bat
[ 2012-06-27 12:53:37:503 ] [ 4200 ] [INFO] ProcessScriptConfiguration : Going to Add Script
[ 2012-06-27 12:53:37:503 ] [ 4200 ] [INFO] AddScriptConfiguration : Script Name : C:\Program Files\DesktopCentral_Agent\Computer\Startup\pgp_confirm32.bat
[ 2012-06-27 12:53:37:503 ] [ 4200 ] [INFO] AddScriptConfiguration : Script Type : Startup
[ 2012-06-27 12:53:37:503 ] [ 4200 ] [INFO] AddScriptConfiguration : Script Params :
[ 2012-06-27 12:53:37:503 ] [ 4200 ] [INFO] AddScriptConfiguration : Script keys : 5709
[ 2012-06-27 12:53:37:503 ] [ 4200 ] [INFO] AddScriptConfiguration : Execution Type : 1
[ 2012-06-27 12:53:37:503 ] [ 4200 ] [INFO] AddScriptConfiguration : Number of executions : 0
[ 2012-06-27 12:53:37:503 ] [ 4200 ] [INFO] AddScriptConfiguration : ExecutionType is Immedeate Execution
[ 2012-06-27 12:53:37:503 ] [ 4200 ] [INFO] Inside ExecuteScript Method
[ 2012-06-27 12:53:37:503 ] [ 4200 ] [INFO] ExecuteScript : applPath -> C:\Program Files\DesktopCentral_Agent\Computer\Startup\pgp_confirm32.bat
[ 2012-06-27 12:53:37:503 ] [ 4200 ] [INFO] ExecuteScript : commandLineParam ->
[ 2012-06-27 12:53:37:503 ] [ 4200 ] [INFO] ExecuteScript : File extension to execute -> .bat
[ 2012-06-27 12:53:37:503 ] [ 4200 ] [INFO] ExecuteScript : Appln with args -> "C:\Program Files\DesktopCentral_Agent\Computer\Startup\pgp_confirm32.bat"
[ 2012-06-27 12:53:37:503 ] [ 4200 ] [INFO] GetActiveSessionId : WTSGetActiveConsoleSessionId = 0
[ 2012-06-27 12:53:37:503 ] [ 4200 ] [INFO] ExecuteScript : The active session User name is given by 20432808
[ 2012-06-27 12:53:37:503 ] [ 4200 ] [INFO] @@@@@@@@ End of ExecuteInSystemSession Method @@@@@@@@
[ 2012-06-27 12:53:37:503 ] [ 4200 ] [INFO] GetActiveSessionId : WTSGetActiveConsoleSessionId = 0
[ 2012-06-27 12:53:37:503 ] [ 4200 ] [INFO] GetProcessID : Retrieved Explorer Session ID : 0
[ 2012-06-27 12:53:37:503 ] [ 4200 ] [INFO] GetProcessID : Compare Explorer Session ID : 0
[ 2012-06-27 12:53:37:503 ] [ 4200 ] [INFO] GetProcessID : Process ID for winlogon.exe is 736
[ 2012-06-27 12:53:37:503 ] [ 4200 ] [INFO] GetProcessToken : The Process token for the process winlogon.exe is given by 512
[ 2012-06-27 12:53:37:503 ] [ 4200 ] [INFO] ExecuteWithToken : EnvironmentBlock Created sucessfully
[ 2012-06-27 12:53:38:378 ] [ 4200 ] [INFO] ExecuteWithToken : profile Loaded sucessfully
[ 2012-06-27 12:53:38:378 ] [ 4200 ] [INFO] ExecuteWithToken : Process successfully created for application "C:\Program Files\DesktopCentral_Agent\Computer\Startup\pgp_confirm32.bat"
[ 2012-06-27 12:53:39:800 ] [ 4200 ] [ERROR] Error Code : 1 , Error Message : Incorrect function.
[ 2012-06-27 12:53:39:800 ] [ 4200 ] [INFO] ExecuteWithToken : Exit code of the process : 1
[ 2012-06-27 12:53:39:800 ] [ 4200 ] [INFO] ExecuteWithToken : EnvironmentBlock destroyed sucessfully
[ 2012-06-27 12:53:41:362 ] [ 4200 ] [INFO] ExecuteWithToken : Profile Unloaded sucessfully
[ 2012-06-27 12:53:41:362 ] [ 4200 ] [INFO] ExecuteWithToken : Remarks from the CreateProcessAsUser is Incorrect function. for the executable "C:\Program Files\DesktopCentral_Agent\Computer\Startup\pgp_confirm32.bat"
[ 2012-06-27 12:53:41:362 ] [ 4200 ] [INFO] @@@@@@@@ End of ExecuteInSystemSession Method @@@@@@@@
[ 2012-06-27 12:53:41:362 ] [ 4200 ] [INFO] @@@@@@@@ End Of ExecuteScript Method @@@@@@@@
[ 2012-06-27 12:53:41:362 ] [ 4200 ] [INFO] Message : The operation completed successfully.
[ 2012-06-27 12:53:41:362 ] [ 4200 ] [ERROR] AddScriptConfiguration : Error in executing script configuration 0 ..The operation completed successfully. [ 2012-06-27 12:53:41:362 ] [ 4200 ] [INFO] Inside DeleteScriptConfiguration
[ 2012-06-27 12:53:41:362 ] [ 4200 ] [INFO] DeleteScriptConfiguration:SOFTWARE\AdventNet\DesktopCentral\DCAgent\Scripts\Startup\5709
[ 2012-06-27 12:53:41:362 ] [ 4200 ] [INFO] deleteRegistryKey: Key successfull deleted!: 0
[ 2012-06-27 12:53:41:362 ] [ 4200 ] [INFO] deleteRegistryKey errorCode :0
[ 2012-06-27 12:53:41:362 ] [ 4200 ] [INFO] AddScriptConfiguration : Script deleted in the registry
[ 2012-06-27 12:53:41:362 ] [ 4200 ] [INFO] AddScriptConfiguration : Successfully freed the current Script .
[ 2012-06-27 12:53:41:362 ] [ 4200 ] [ERROR] Error Code : 1 , Error Message : Incorrect function.
[ 2012-06-27 12:53:41:362 ] [ 4200 ] [INFO] Freeing the allocated memory in ProcessScriptConfiguration
[ 2012-06-27 12:53:41:362 ] [ 4200 ] [INFO] GetRetryStatusData : ExecutedRetryCount Can't read
[ 2012-06-27 12:53:41:362 ] [ 4200 ] [INFO] GetRetryStatusData : TotalFailureRetryCount read sucess
[ 2012-06-27 12:53:41:362 ] [ 4200 ] [INFO] SendConfigStatusUpdateEx : Data to Send to Server ->
<?xml version="1.0" encoding="UTF-8"?>
New to ADSelfService Plus?