Monday, February 20, 2012

master..xp_cmdshell Error 997 from GetProxyAccount

Hello all,
I have an aspx page that inserts a record in a table via a stored
procedure. That table has a trigger which gets fired on an insert. The
trigger has the following code
EXEC master..xp_cmdshell 'C:\MyApp\try.exe'
This all works when the stored procedure is fired inserting the record
in turn firing off the trigger; but when the ASPX page runs the stored
procedure I get the following error.
A severe error occurred on the current command. The results, if any,
should be discarded. xpsql.cpp: Error 997 from GetProxyAccount on line
472
The Guest login has permissions to the extended stored procedure
xp_cmdshell on the master db, but this has not helped.
Any help would be greatly appriciated.
PhilHi,
You need to set up a proxy account.
Create an user and then configure that in EM (Management, right-clickSQL
Agent, configure that proxy account).
Have a look into below article:-
http://support.microsoft.com/defaul...microsoft.com:
80/support/kb/articles/Q264/1/55.ASP&NoWebContent=1
Thanks
Hari
MCDBA
"Phil" <toomuchphill@.hotmail.com> wrote in message
news:8358f7c7.0406132044.6b353856@.posting.google.com...
> Hello all,
> I have an aspx page that inserts a record in a table via a stored
> procedure. That table has a trigger which gets fired on an insert. The
> trigger has the following code
> EXEC master..xp_cmdshell 'C:\MyApp\try.exe'
> This all works when the stored procedure is fired inserting the record
> in turn firing off the trigger; but when the ASPX page runs the stored
> procedure I get the following error.
> A severe error occurred on the current command. The results, if any,
> should be discarded. xpsql.cpp: Error 997 from GetProxyAccount on line
> 472
> The Guest login has permissions to the extended stored procedure
> xp_cmdshell on the master db, but this has not helped.
> Any help would be greatly appriciated.
> Phil|||Thanks for that Hari,
I am going forward... I think
The error I am getting now is General network error. Check your
network documentation.
I have now configured the proxy account within EM. I unticked the
'Only users with SysAdmin privileges can execute cmdExec and
ActiveScripting job steps.'
I have since changed the trigger from executing my .exe to execute a
.bat which simply copies a file. The Internet Guest account has
privileges to the directory.
The batch file is being run but the copy is not working. I guess this
is to do with the privileges still.
Any suggestions would be greatly appreciated.
Phil.
"Hari" <hari_prasad_k@.hotmail.com> wrote in message news:<eRBIv2cUEHA.3944@.tk2msftngp13.phx.
gbl>...[vbcol=seagreen]
> Hi,
> You need to set up a proxy account.
> Create an user and then configure that in EM (Management, right-clickSQL
> Agent, configure that proxy account).
> Have a look into below article:-
> [url]http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:[/ur
l]
> 80/support/kb/articles/Q264/1/55.ASP&NoWebContent=1
>
> --
> Thanks
> Hari
> MCDBA
> "Phil" <toomuchphill@.hotmail.com> wrote in message
> news:8358f7c7.0406132044.6b353856@.posting.google.com...|||- Start SQL Enterprise manager
- Open your server
- open the Management folder
- right mouse on SQL Server Agent and select properties
- select Job System tab
- UNCHECK the box in the section 'Non SysAdmin job step proxy account'
which says 'Only users with SysAdmin priveleges can ...'
- when the dialog comes up enter the username, password, [domain] of
some defined Windows user with sysAdmin priveleges (create one if needed fir
st).
- click Apply and OK
"Phil" wrote:

> Hello all,
> I have an aspx page that inserts a record in a table via a stored
> procedure. That table has a trigger which gets fired on an insert. The
> trigger has the following code
> EXEC master..xp_cmdshell 'C:\MyApp\try.exe'
> This all works when the stored procedure is fired inserting the record
> in turn firing off the trigger; but when the ASPX page runs the stored
> procedure I get the following error.
> A severe error occurred on the current command. The results, if any,
> should be discarded. xpsql.cpp: Error 997 from GetProxyAccount on line
> 472
> The Guest login has permissions to the extended stored procedure
> xp_cmdshell on the master db, but this has not helped.
> Any help would be greatly appriciated.
> Phil
>

No comments:

Post a Comment