WMI Help.. (Please)

B

buc

I have written a simple app (code mimic's mostly a sample from MSDN) to use
WMI to get the proc.serial number and hard drive serial number. I then
generate a key from this data and create a sort of registration key for
other software that ties the key to this machine. When a normal user runs
this software app it WMI queries the proc/HD number and checks against the
previous generated key.All that said.. It works fine except it requires
admin priv. to run apparently. I run it under numerous standalone Windows XP
boxes under an account with admin priv's with no problem. It will not run
under ANY other account unless it has admin priv's. I saw a post that said
to go into control panel - administrative tools to the COMPUTER
MANAGEMENT/SERVICES&APPs/WMI CONTROL icon and set the security, so, I set
the ROOT and all keys below it. I gave the EVERYONE group all the checkboxs
and made sure it propagated to the last subkey. Still won't run without
admin priv. What other setting do I need? I dont wont to give all the users
local admin rights..Thanks BUC
 
P

Philip Nunn [MSFT]

When you say it won't run, what behavior are you seeing? (access denied
error vs. no instances returned?) If you could post the pertinent snippet
of your code that may also be helpful.

What classes are you using and what properties are you reading?
Win32_processor and win32_diskdrive seem to work as non-admin user. Also
what OS and service pack are you using?
 
B

buc

I created a dll on the LOCAL winXP box to get some LOCAL system info using
the WMI example from the MSDN.I call SELECT * FROM Win32_Processor and do
the pObj->Get(L"ProcessorID",0,&procID,NULL,NULL); it retrieves the proc ID
whether I am logged in as an admin OR as a normal user. No problems.. If I
change the select to SELECT * FROM Win32_PhysicalMedia and do the
pObj->Get(L"SerialNumber",0,&procID,NULL,NULL); it get's the hard drive
serial number with no problem, unless I am logged in as a normal user. It
FAILS (returns NULL Serial Number)as a normal user but not as an admin.Why?
I set WMI permissions & DCOM
stuff to give the everyone group more priv's.. Why doesn't this work?
I have seen other posts on using the Win32_PhysicalMedia and others seem to
have this issue.
I have tried this on 5 diff machines 3 Dells and 2 Microns. Same results,
even on my laptop also.
I can use other Win32_xxx's in normal user mode but the PhysicalMedia class
seems to requir something different kind of permission. I used the MSDN
example and it breaks with WIN32_PhysicalMedia under a normal user mode in
Windows XP. Please Help.. Thanks...


Philip Nunn said:
When you say it won't run, what behavior are you seeing? (access denied
error vs. no instances returned?) If you could post the pertinent snippet
of your code that may also be helpful.

What classes are you using and what properties are you reading?
Win32_processor and win32_diskdrive seem to work as non-admin user. Also
what OS and service pack are you using?

--
Philip Nunn [MSFT]
This posting is provided "AS IS" with no warranties, and confers no
rights. Use of included script samples are subject to the terms specified
at http://www.microsoft.com/info/cpyright.htm.
buc said:
I have written a simple app (code mimic's mostly a sample from MSDN) to
use WMI to get the proc.serial number and hard drive serial number. I then
generate a key from this data and create a sort of registration key for
other software that ties the key to this machine. When a normal user runs
this software app it WMI queries the proc/HD number and checks against the
previous generated key.All that said.. It works fine except it requires
admin priv. to run apparently. I run it under numerous standalone Windows
XP boxes under an account with admin priv's with no problem. It will not
run under ANY other account unless it has admin priv's. I saw a post that
said to go into control panel - administrative tools to the COMPUTER
MANAGEMENT/SERVICES&APPs/WMI CONTROL icon and set the security, so, I set
the ROOT and all keys below it. I gave the EVERYONE group all the
checkboxs and made sure it propagated to the last subkey. Still won't run
without
admin priv. What other setting do I need? I dont wont to give all the
users local admin rights..Thanks BUC
 
A

alkazam

so what is the solution to this problem?

*I have written a simple app (code mimic's mostly a sample from MSDN)
to use
WMI to get the proc.serial number and hard drive serial number. I
then
generate a key from this data and create a sort of registration key
for
other software that ties the key to this machine. When a normal user
runs
this software app it WMI queries the proc/HD number and checks
against the
previous generated key.All that said.. It works fine except it
requires
admin priv. to run apparently. I run it under numerous standalone
Windows XP
boxes under an account with admin priv's with no problem. It will not
run
under ANY other account unless it has admin priv's. I saw a post that
said
to go into control panel - administrative tools to the COMPUTER
MANAGEMENT/SERVICES&APPs/WMI CONTROL icon and set the security, so,
I set
the ROOT and all keys below it. I gave the EVERYONE group all the
checkboxs
and made sure it propagated to the last subkey. Still won't run
without
admin priv. What other setting do I need? I dont wont to give all the
users
local admin rights..Thanks BUC *
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top