Category Archives: Control M

Unable to open excel macro from Control-M

I’ve been trying to get several Control-M jobs to work on our new Win 2008 R2 x64 Servers, but they always fail as they are trying to open scripts that call Excel macros as part of their function.

2012-08-14 17 : 24: 59 Error generating Sample Report [SampleRptBatch][CreateFileNames] Microsoft Office Excel cannot access the file ‘D:\SampleReport\SampleFormat.xlsm’. There are several possible reasons:

• The file name or path does not exist.

• The file is being used by another program.

• The workbook you are trying to save has the same name as a currently open workbook.

On analysis, I can see that the Control-M Agent (ver 7) is running jobs as a Service, and not as a TCP or RDP session as I had thought.

This all comes down to an issue with Services, Win 2008 R2 x64 and Excel 2007. For Excel to open, when called from a service, it requires a “Desktop” folder to be placed in

    C:\Windows\SysWOW64\config\systemprofile\Desktop

Qgawa’s reply here, helped me sort this out.

http://social.msdn.microsoft.com/Forums/en/innovateonoffice/thread/b81a3c4e-62db-488b-af06-44421818ef91

 

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).

Control M Agent on Unix

Some useful infor on where to find stuff on your Contrl M agent (ctmag).

On any unix build go to : /opt/cntlm/ctmag3/ctm/     where agent 3 is the active agent.

sub dirs:

  • proclog: a great place to check on health of agent. Look here for issues with locked or dead users inhibiting jobs running.
  • sysout: the place where the sysouts go! better to use unix directly rather than the Contrl M Enterprise GUI, if you’re happy with find’ing and grep’ing for what you need.

(if you’re on a win server, then C:/Program Files/BMC should get you close to the equivalent of above).