Re: xpsql.cpp

From: Bil (biljanat@nbrm.gov.mk)
Date: 12/25/02


From: "Bil" <biljanat@nbrm.gov.mk>
Date: Wed, 25 Dec 2002 14:29:53 +0100


Dan, at my servers this line returns nothing (Null):
EXEC master..xp_cmdshell 'CScript.exe //NOLOGO C:\WhoAmI.vbs'

Anyway, thank you very much for your help. I wish you also Merry Christmas
and Happy Holidays.

Thanks again and the best,
Biljana

"Dan Guzman" <danguzman@nospam-earthlink.net> wrote in message
news:edwQBM2qCHA.1776@TK2MSFTNGP10...
> Although the environment variable still reports the SQL Server service
> account, the actual security context has been changed to the proxy
> account. You can verify this by executing the following VBScript via
> xp_cmdshell:
>
> 'C:\WhoAmI.vbs
> Set Network = CreateObject("WScript.Network")
> WScript.Echo "UserDomain=" & Network.UserDomain
> WScript.Echo "UserName=" & Network.UserName
>
>
> USE MyDatabase
> GO
> CREATE PROCEDURE [dbo].[usp_test] AS
> --this reports the SQL Server service account
> EXEC master..xp_cmdshell 'ECHO %USERNAME%'
> --this reports the proxy account
> EXEC master..xp_cmdshell 'CScript.exe //NOLOGO C:\WhoAmI.vbs'
> GO
> GRANT EXEC ON usp_test TO public
> GO
> SETUSER 'SomeNonSaUser'
> GO
> EXEC usp_test
> GO
>
> Also, note that direct execute permissions on xp_cmdshell are not needed
> if the user database is owned by 'sa' since the ownership chain is
> unbroken.
>
> --
> Happy Holidays.
>
> Dan Guzman
> SQL Server MVP
>



Relevant Pages

  • Re: Stored Procedure Fails Only When Called By Agent
    ... Stored Procedure 1: ... EXEC sp_addlinkedserver '10.1.2.10', 'SQL Server' ... LOCALMACHINE\myaccount/pass3, the same account that owns the job. ...
    (microsoft.public.sqlserver.replication)
  • Re: Domain Password Policy
    ... Dan typed: ... I agree we pretty much have one pc that acts as an application server ... that handles the scripts. ... So if I understand correctly we can set an account for this pc which ...
    (microsoft.public.windows.server.general)
  • Re: receiving duplicate email messages
    ... > Dan - you'll get a hero medal for this! ... > identical Account ID/Pop Server. ... would BE a bug to allow more than one account with the same username and POP ... SMTP-only "alias" account if you want it to appear that you're replying from ...
    (microsoft.public.mac.office.entourage)
  • Re: The Microsoft Search service cannot be administered under the
    ... I followed the instructions on both of those articles and still have no luck ... The search account, sql server, and sql agent account are all running as ... > exec sp_defaultdb N'NT Authority\System', ...
    (microsoft.public.sqlserver.fulltext)
  • Re: Biztalk 2006 SSO Default Configuration Failed
    ... exec sp_addserver 'my-machine', 'local' ... this apparently returns the name of the SQL Server at the time it ... >>>I'm using an account with administrative privileges for the account that ...
    (microsoft.public.biztalk.server)

Loading