Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Old Forums
 CLOSED - General SQL Server
 Can't Run DTS with xp_cmdshell but can in cmd prom

Author  Topic 

Jim77
Constraint Violating Yak Guru

440 Posts

Posted - 2006-09-04 : 06:36:06
Hi there guys I am having a issue with DTSRUN command in sql2000 I can run a DTS package from the command prompt no problem that sends a email to myself but as soon as I try to run it through the xp_cmdshell it throws up a error: MapiLogonEX Failed due to MAPI error 273: MAPI Logon failed

Has anyone got a solution please ?

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-09-04 : 06:48:58
Which are the contexts?
When running xp_cmdshell, is that under SA account?


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

Jim77
Constraint Violating Yak Guru

440 Posts

Posted - 2006-09-04 : 06:52:54
Yes Peso this is my code that runs in cmdshell :

dtsrun /Sservername /NdtsProcessItems /Usa /Ppas123

this is what I am trying to run in the sp that throws up the above error :

EXEC master..xp_cmdshell 'dtsrun /Sservername /NdtsProcessItems /Usa /Ppas123'
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-09-04 : 06:59:23
I think the difference is that when you try manually with command prompt, the DTS package notices that it is you that runs the package and you have an email profile.

When running DTS package with xp_commandshell, DTS doesn't recognize an email profile for the sa account.
Try to change xp_commandshell to

EXEC master..xp_cmdshell 'dtsrun /Sservername /NdtsProcessItems /Uyourname /Pyourpass'

and see if that works out for you.



Peter Larsson
Helsingborg, Sweden
Go to Top of Page

Jim77
Constraint Violating Yak Guru

440 Posts

Posted - 2006-09-04 : 07:09:56
Yeah I see were you are getting at here but my password changes every 2 weeks, I will try like you said and run it with the sql service account that has got a MAPI profile associatted with it .
cheersPeso
Go to Top of Page

Jim77
Constraint Violating Yak Guru

440 Posts

Posted - 2006-09-04 : 08:39:09
Error string: Login failed for user 'Domain\Service Account'.

Ah it is failing for all accounts that I try coming up with this error message even when I try running through my own account
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-09-04 : 08:49:25
You mean that no xp_cmdshell works?
Only when run from command prompt directly?


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

Jim77
Constraint Violating Yak Guru

440 Posts

Posted - 2006-09-04 : 09:19:22
I have set permissions in Extended Stored Procedures in Master for the account I want to run this under and I have run other xp_cmdshell procs on the same server and all works corectly,

I have asked my System administrator to set up a MAPI profile for sa but he refuses, it seems this is the only account that runs the dts package but because it doesnt have a MAPI account it cannot send a email, all other accounts just fail saying login failed for user domain\user even thought these users have been set up as dbo's and in the sys admins role..
Go to Top of Page
   

- Advertisement -