Results 1 to 7 of 7

Thread: No results for 'User' policies

  1. #1
    PreviousPoster is offline 100+ Helpful Posts! 50+ Helpful Posts
    Join Date
    Dec 1969
    Posts
    1,254

    Default

    I am attempting to determine policy settings on my local PC. I can get the 'Computer' settings by doing the following (using C#):

    ManagementScope ms = new ManagementScope("\\root\\RSOP\\Computer");
    ObjectQuery oq = new ObjectQuery("SELECT * FROM RSOP_RegistryPolicySetting");
    ManagementObjectSearcher mos = new ManagementObjectSearcher(ms, oq);
    ManagementObjectCollection moc = mos.Get();

    This gives me a nice long list of policies. However, if I attempt to get the user policies ("\\root\\RSOP\\User" as the path), I get nothing returned. No errors, just no results. Anyone have any suggestions? I have also tries selecting from RSOP_PolicySetting and get the same type of result.

  2. #2
    gpoguy is offline 10+ Helpful Posts Happy to be helping others
    Join Date
    Dec 1969
    Posts
    13

    Default

    Well, there are no instances under RSOP\User. All the instances are under the SID of the particular user. So for example you would need to connect to RSOP\User\<SID>

  3. #3
    PreviousPoster is offline 100+ Helpful Posts! 50+ Helpful Posts
    Join Date
    Dec 1969
    Posts
    1,254

    Default

    Thanks for the reply. What format should the SID take? I tried the typical S-1-5-21-... and all I get is a 'Invalid parameter' error.

  4. #4
    gpoguy is offline 10+ Helpful Posts Happy to be helping others
    Join Date
    Dec 1969
    Posts
    13

    Default

    Yes, standard SID string form. You of course need to make sure that the SID exists in WMI. I use WMIX as a WMI browser. Great tool.

  5. #5
    PreviousPoster is offline 100+ Helpful Posts! 50+ Helpful Posts
    Join Date
    Dec 1969
    Posts
    1,254

    Default

    Again, thanks for the reply. However, I still just get 'Invalid parameter'.

    Here is the code snippet:
    ManagementScope ms = new ManagementScope("\\root\\RSOP\\User\\S-1-5-21-dddddddd-dddddddddd-dddddddd-dddd");
    ObjectQuery oq = new ObjectQuery("SELECT * FROM RSOP_RegistryPolicySetting");
    ManagementObjectSearcher mos = new ManagementObjectSearcher(ms, oq);
    ManagementObjectCollection moc = mos.Get();

    I don't want to go publishing my SID, but I check it in several places, including WMI, LDAP and WIN32, so I know it is the correct SID.

    By the way, I use WinXP Professional with SP2 and I am an Administrator of my PC.

  6. #6
    PreviousPoster is offline 100+ Helpful Posts! 50+ Helpful Posts
    Join Date
    Dec 1969
    Posts
    1,254

    Default

    I discovered what the problem is:
    The SID needs to be specified with '_' (underscores) instead of '-' (dashes).

    Again, thanks for your help.

  7. #7
    gpoguy is offline 10+ Helpful Posts Happy to be helping others
    Join Date
    Dec 1969
    Posts
    13

    Default

    Yes, sorry-- I didn't even notice that when I was looking at WMI!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Search Engine Friendly URLs by vBSEO