GRANT EXECUTE ON xp_cmdshell

  • Hi, When attempting to grant the xp_cmdshell to a user GRANT EXECUTE ON xp_cmdshell to 'User' i see the following error :-

    "Cannot find the user 'User', because it does not exist or you do not have permission". I'm logged on as a system administrator with full rights.

    Any advice?


    Kindest Regards,

    Nick

  • Please login as change user in surface area configuration and try to use instance/system name rather than IP

    Thanks

  • Hi,

    Thanks for your advice. I changed the username I'm logged on with and tried again. The message "Cannot find the user 'PostOptApp', because it does not exist or you do not have permission"

    was displayed again.

    I've checked in the surface ara configuration and the cmd_shell is enabled.


    Kindest Regards,

    Nick

  • If you do have 'sa' privilages you can check following:

    1. In surface area configuration xp_cmdshell is enabled.

    2. exec this command in Query window

    sp_helpuser 'PostOptApp'

    If about command gives you error message that means user is not exist.

    HTH

    ---------------------------------------------------
    "Thare are only 10 types of people in the world:
    Those who understand binary, and those who don't."

  • Ahh great.

    The message is :-

    The name supplied (User) is not a user, role, or aliased login.

    Does this help?


    Kindest Regards,

    Nick

  • Create a new user or login with existing users

    Thanks

  • Nick,

    You need to create the user first.

    Refer this link for further detail:

    ms-help://MS.SQLCC.v10/MS.SQLSVR.v10.en/s10de_6tsql/html/61a40eb4-573f-460c-9164-bd1bbfaf8b25.htm

    Cheers!

    ---------------------------------------------------
    "Thare are only 10 types of people in the world:
    Those who understand binary, and those who don't."

  • Great,

    Ok when i change to the user DB and run the helpuser account i get data back. However, when i go to run the following :-

    use USERDB

    GRANT EXECUTE ON xp_cmdshell TO USER

    The message "Permissions on server scoped catalog views or system stored procedures or extended stored procedures can be granted only when the current database is master" is shown.

    When i use the master DB

    use master

    GRANT EXECUTE ON xp_cmdshell TO USER

    I get this message...

    Cannot find the user 'user', because it does not exist or you do not have permission.


    Kindest Regards,

    Nick

  • Great,

    Ok when i change to the user DB and run the helpuser account i get data back. However, when i go to run the following :-

    use USERDB

    GRANT EXECUTE ON xp_cmdshell TO USER

    The message "Permissions on server scoped catalog views or system stored procedures or extended stored procedures can be granted only when the current database is master" is shown.

    When i use the master DB

    use master

    GRANT EXECUTE ON xp_cmdshell TO USER

    I get this message...

    Cannot find the user 'user', because it does not exist or you do not have permission.


    Kindest Regards,

    Nick

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply