Configure Control M Agent from command line

C:\Users\caulfiek>ctmwincfg
Agent Configuration Utility
Agent Name: Default
CM Name : WIN
CM Type : WIN2K
1) Logon As User (Y/N) . . . . . . . . . . . .: [N]
2) Logon Domain. . . . . . . . . . . . . . . .: [N]
3) Job children inside job object . . .(Y/N) .: [Y]
4) Add Job Object statistics to Sysout (Y/N) .: [Y]
5) Sysout Name. . . . . . . (MEMNAME|JOBNAME) .: [JOBNAME]
6) Wrap parameters with double quotes .(1-4) .: [4]
7) Run user ‘Logon Script’ (Y/N) . . . . . . .: [Y]
8) CJK Encoding. . . . . . . . . . . . . . . .: []
9) Default Printer . . . . . . . . . . . . . .: []
10) Echo Job commands into Sysout (Y/N) . . . .: [Y]
11) SMTP Parameters
s) Save
q) Quit

ctmagcfg too.

ag_diag_comm will give you an overview of how the agent is installed, quite useful.

Add a new Control M Agent User

When running a chart on a development server it’s good practive to change over the control M Agent userid to a testing or regular user id.

C:\Users\caulfiek>ctmpwd -ACTION ADD -USER caulfiek -PASSWORD xxxxxxx

Please wait while the system updates security properties.
This should require 5 to 20 seconds…
User CAULFIEK added successfully.

     If the new user has a “Roaming Profile” instead of a “Local Profile”
     the Agent services should be run by a “User Account”
     and not by the “Local System Account”

Refer to Control-M/Agent Documentation
for information about performing this action.

Quick Update: This can all be done from the Control M Configuration Manager GUI (Tools->Security->Owners Authentication Settings).

Killing a non responding window service

How to kill a non responding service using “sc” and “TaskKill”

C:\WINDOWS>sc queryex “My Service”

SERVICE_NAME: My Service TYPE : 110 WIN32_OWN_PROCESS (interactive)
STATE : 2 START_PENDING
(STOPPABLE, PAUSABLE, ACCEPTS_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0
PID : 6868
FLAGS :

C:\WINDOWS>taskkill /PID 6868 /F

SUCCESS: The process with PID 6868 has been terminated.

cannot load assembly or dependencies

I got this on a Win2008R2 x64bit server where I’m running a 32bit app.

Details: Could not load file or assembly ‘FIXForge.NET.FIX.Engine-net-4.0.dll’ or one of its dependencies. The specified module could not be found.”

So I figured that all I have to do was load it into the Global Assembly with gacutil /i and I’d be ok. But…

“Failure adding assembly to the cache: This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded”.

How can this be? I was using SDK 6, so I installed SDK 7.1 and tried again with the same result.

However if you switch to the ‘proper’ version of gacutil it will work ok.

Go to C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\NETFX 4.0 Tools\x64

Now gacutil /i will register your dll.

Use the /l [assembly name] option after too see the reaults (take “.dll”) off the end of the assembly name.