DataField
asked on
run WMIC from query analyzer, acess denied!
I tried to run the following sql statement from Query Analyzer,
************************** ********** ********** ********** *******
EXEC master.dbo.xp_cmdshell 'wmic /node:zid3159 service where (name=''JRun Default'') set state=''Running'''
************************** ********** ********** ********** *******
get following error:
************************** ********** ********** ********** *******
ERROR:
Code = 0x80041003
Description = Access denied
Facility = WMI
NULL
************************** ********** ********** ********** *******
but it works fine if run the following command-line directly:
************************** ********** ********** ********** *******
wmic /node:zid3159 service where (name='JRun Default') get state
************************** ********** ********** ********** *******
WHY??????????????????????? ??????????
**************************
EXEC master.dbo.xp_cmdshell 'wmic /node:zid3159 service where (name=''JRun Default'') set state=''Running'''
**************************
get following error:
**************************
ERROR:
Code = 0x80041003
Description = Access denied
Facility = WMI
NULL
**************************
but it works fine if run the following command-line directly:
**************************
wmic /node:zid3159 service where (name='JRun Default') get state
**************************
WHY???????????????????????
ASKER
I user my windows login to logon server (windows 2003) remotely, it is ok I execute it from command prompt. But it doesn't work if I run from query analyzer.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Just want to let you know, you want to work the minimum security required for this account, rather than leave it at Administrator.
1. SQL Server service account (if your SQL login is a sysadm)
2. Proxy account (if your SQL Server login is not sysadm)
Whichever user you are doesn't have permission to run WMIC
Look up Books online for more info.