How do I read the machine policy in C#?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ushach
    New Member
    • Nov 2006
    • 17

    How do I read the machine policy in C#?

    hi,
    how do i read the machine policy in c#?
    any pointers will be highly appreciated.
  • tlhintoq
    Recognized Expert Specialist
    • Mar 2008
    • 3532

    #2
    ---> Google (pointer to google, get it?)


    I did a google search with the terms "C# read machine policy" and got numerous positive seeming hits such as...

    http://forums.msdn.mic rosoft.com/en-US/csharplanguage/thread/0f698291-e9b8-4e40-beeb-23fd4083ad9e/

    "Machine policy" is a bit vague as to what specifically you are looking for (password rules, domain policies etc.) but I'm sure a more specific set of search terms should narrow down the results.

    Comment

    • Ushach
      New Member
      • Nov 2006
      • 17

      #3
      [QUOTE=tlhintoq]---> Google (pointer to google, get it?)

      thanks for your inputs.To be ore specific,I want to read
      Computer Configuration\A dministrative Templates\Windo ws Components\Term inal Services\Termin al Server\Device and Resource Redirection fileds (gpedit.msc values) through c#.

      Comment

      • tlhintoq
        Recognized Expert Specialist
        • Mar 2008
        • 3532

        #4
        I know nothing of the gpedit.msc you mention. But a fast search got me this description:

        http://vlaurie.com/computers2/Articles/group_policy_ed itor.htm

        Correct me if I'm wrong, but the first paragraph describes these policies as a way of changing registry settings to get the results you want. Which is how most of Windows stores its settings.

        So, to read the policies you read the registry settings for item(s) you want to knwo the value of. Reading the registry is pretty straight forward and well documented.

        The second paragraph tells you the location of the user policies as:
        %SystemRoot%\Sy stem32\GroupPol icy\Machine\Reg istry.pol

        So it would seem reading this file should give you a concise list of all the policy values without having to dig through numerous registry settings.

        Does that help?

        Comment

        Working...