Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am gathering performance data via WMI and would like to avoid having to use an account in the Administrators group for this purpose. The target machine is running Windows Server 2003 with the latest SP/updates.

I've done what I believe to be the appropriate configuration to allow our user access to WMI (similar to what is described here: http://msdn.microsoft.com/en-us/library/aa393266.aspx).

Here are the specific steps that were followed:

  1. Open Administrative Tools -> Computer Management: Under Computer Management (Local) Expand Services and Applications, right click WMI Control and select properties. In the Security tab, expand Root, highlight CIMV2, click Security (near bottom of window); add Performance Monitor Users and enable the options : Enable Account and Remote Enable.

  2. ­
  3. Open Administrative Tools -> Component Services: Under Console Root go to Component Services-> Computers -> Right click My Computer and select properties, select the COM security tab, in “Access Permissions” click "Edit Default" select(or add then select) “Performance Monitor Users” group and allow local access and remote access and click ok. In “Launch and Activation Permissions” click “Edit Default” select(or add then select) “Performance Monitor Users” group and allow Local and Remote Launch and Activation Permissions.

  4. ­
  5. Open Administrative Tools -> Component Services: Under Console Root go to Component Services-> Computers -> My Computer -> DCOM Config -> highlight “Windows Management and Instrumentation” right click and select properties, Select the Security tab, Under “Launch and Activation Permissions” select Customize, then click edit, add the “Performance Users Group” and allow local and remote Remote Launch and Remote Activation privileges.

I am able to connect remotely via WMI Explorer but when I perform this query:

Select CommandLine, ProcessId FROM Win32_Process

I get a valid result but every row has an empty CommandLine. If I add the user to the Administrators group and re-run the query, the CommandLine column contains the expected data.

It seems there is a permission I am missing somewhere but I am not having much luck tracking it down.

Many thanks in advance.

share|improve this question
add comment

2 Answers

I don't believe this is a permissions issue but perhaps a subtlety of your query structure, and I'll explain by way of code I've created to perform just this operation (to be able to later cache the command lines).

In my CacheMyWork app's code (which you can browse here), the specific query that I issue - and which definitely returns CommandLine results - is

SELECT CommandLine FROM Win32_Process WHERE ProcessId =

I haven't used the WMI Explorer for a while, but maybe it returns the CommandLine for a single process, but not for the whole array at once? Dunno.

I've had this app available for three years, and while I don't recall at the moment the last time I tested it while running as a non-Admin user, I am 99% sure that it must work in that scenario because thousands have downloaded it and no one has yet reported that it wasn't restarting cached apps after rebooting. [Yes, I know what happens to people who ASSUME, but this hasn't stopped me from being a foolhardy assumer here.]

share|improve this answer
    
Maybe you could try running the CMW app (cachemywork.codeplex.com) as one of these unprivileged users, select a few listed apps, and then check their HKCU\...\RunOnce registry key, to see if any command lines have been cached? –  ParanoidMike Oct 29 '10 at 0:39
    
Hi Mike, your answer gave me a couple of ideas that have moved things a long at least a little bit. First, I was only running the query from a remote machine via WMI explorer. I tried logging the user in via RDP and doing the same query via WMI explorer on the host and voila, CommandLine etc. all appear. What is even more bizarre, is that while I am logged in, the remote WMI query also returns the CommandLine but when I logout it goes back to being blank.. Very bizarre. Thanks for your response! –  user57935 Oct 29 '10 at 18:05
add comment

It's a bit embarrassing to turn around my opinion on this so fully, but your follow-up comment to my first attempt makes the permissions theory sound much more convincing all of a sudden.

Windows these days has carried with it permissions that are assigned differently based on whether the requesting process is remote or local, and this stinks of the kind of behaviour I've seen when an object is ACL'd so that INTERACTIVE is allowed but REMOTE is not. When you logon via RDP, your access token will include the INTERACTIVE SID; when you perform a remote query (which uses RPC, which usually comes in over Named Pipes or straight TCP/IP), your access token doesn't include INTERACTIVE but instead REMOTE. Further, I've seen cases where two different access attempts or logon sessions end up somehow "pooling" their combined access rights, so your case of "when I am logged in, the remote WMI query also succeeds" actually makes some sense. I'd have to re-read Windows Internals to understand if the sessions, WinStations or access tokens are actually being shared, but certainly what you report is consistent with some experiences I've had.

There's no good reason why the CommandLine attribute should be ACL'd differently than the ProcessID attribute, but it sure looks like that's what's going on. Wish I knew whether this was something you could alter through deeply-embedded configuration settings, or if it's simply hard-coded in the Windows OS.

I went back through the permissions-altering steps you outlined in the original question, and there were two places where the local/remote difference seemed to show up:

  • (2) Component Services > COM Security > Launch and Activation Permissions - INTERACTIVE is granted full permissions
  • (3) Component Services > DCOM Config > Windows Management and Instrumentation > Security > Launch and Activation Permissions - both "Launch" and "Activation" provide permissions that differ whether you're Local or Remote.

I'd focus your investigations on these areas and anywhere else you happen to notice such local/remote (INTERACTIVE/REMOTE) differential permissions. While none of these definitively points to the CommandLine attribute you're after, it's nearly-certain in my mind (yes, even more certain than my previous answer) that differences like these will account for the behaviour you're seeing, and closing the gap between "remote" and "local" would enable the results you seek. [Let's just hope that Microsoft hasn't hard-coded things so that - no matter what you configure - you can't expose the CommandLine attribute to remote queries. It wouldn't be the first time a short-sighted hard-coded design has frustrated our use of their OS...]

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.