Home All Groups Group Topic Archive Search About

xp_cmdshell doesn't work

Author
5 Sep 2006 7:31 AM
Filip De Backer
Hi evryone,

This sql code doesn't work.
set @cmd =
'D:\data\gegevensbeheer\produktie\AccountSynchroTrigger\AccountSynchroTrigger.exe '
set @cmd = @cmd + Cast(@PersoonID as nvarchar(10))
exec master.dbo.xp_cmdshell @cmd

It has worked with a simpel exe program.
This exe program adds user to the active directory.
In that exe, I impersonate the user to the one that had enough rights in the
AD.

When I execute this exe on the server (command line), it works fine, but
when I execute it in the query analyser, it doesn't.

How Can I set a specific user with an sql statement or how can I solve this
problem?

thanks

Filip

PS: the exe is a c# 2.0 program.

Author
5 Sep 2006 7:40 AM
ML
Read up on executiong xp_cmdshell in Books Online. It sounds like the usual
security issue.

What version are you on?
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_xp_aa-sz_4jxo.asp


ML

---
http://milambda.blogspot.com/
Are all your drivers up to date? click for free checkup

Author
5 Sep 2006 7:48 AM
Filip De Backer
SQL Server 2000 SP4



Show quoteHide quote
"ML" wrote:

> Read up on executiong xp_cmdshell in Books Online. It sounds like the usual
> security issue.
>
> What version are you on?
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_xp_aa-sz_4jxo.asp
>
>
> ML
>
> ---
> http://milambda.blogspot.com/
Author
5 Sep 2006 7:50 AM
Filip De Backer
SQL Server 2000 SP4

On the folder where the exe is in, I've set full control to everyone.
This to test if it was security.
I find it strange, that even with the full control, I've got this problem.



Show quoteHide quote
"ML" wrote:

> Read up on executiong xp_cmdshell in Books Online. It sounds like the usual
> security issue.
>
> What version are you on?
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_xp_aa-sz_4jxo.asp
>
>
> ML
>
> ---
> http://milambda.blogspot.com/
Author
5 Sep 2006 7:54 AM
ML
Does the SQL Server service account have sufficient privileges?


ML

---
http://milambda.blogspot.com/
Author
5 Sep 2006 8:03 AM
Filip De Backer
the mssqlserver service is started with the administrator account
the lmssqlserver agent is started with the administrator account


Show quoteHide quote
"ML" wrote:

> Does the SQL Server service account have sufficient privileges?
>
>
> ML
>
> ---
> http://milambda.blogspot.com/
Author
5 Sep 2006 8:05 AM
ML
Any error messages? (i.e. what does "doesn't work" mean?)


ML

---
http://milambda.blogspot.com/
Author
5 Sep 2006 8:15 AM
Filip De Backer
the error messages are:

NULL
Unhandled Exception: System.NullReferenceException: Object reference not set
to an instance of an object.
   at LessiusBLL.AccountBeheerBLL.MaakNieuweAccount(Int32 persoonId)
   at AccountsSynchroTrigger.Program.Main(String[] args)
NULL
Unhandled Exception: System.NullReferenceException: Object reference not set
to an instance of an object.
   at LessiusBLL.AccountBeheerBLL.MaakNieuweAccount(Int32 persoonId)
   at AccountsSynchroTrigger.Program.Main(String[] args)
NULL

no errors when executing command line on the server



Show quoteHide quote
"ML" wrote:

> Any error messages? (i.e. what does "doesn't work" mean?)
>
>
> ML
>
> ---
> http://milambda.blogspot.com/
Author
5 Sep 2006 8:19 AM
ML
Have you asked this in a .Net related newsgroup?
It may be a .Net security issue.


ML

---
http://milambda.blogspot.com/

Bookmark and Share