Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. How to access Local Security Policy using c#

How to access Local Security Policy using c#

Scheduled Pinned Locked Moved C#
csharpsecuritytutorialquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Pranav Soral
    wrote on last edited by
    #1

    I want to access Local Security Policy (User Rights assignment) using C#. Is it possible? My requirement is to add/remove users from certain policies programatically. Thanks, Pranav

    S O 2 Replies Last reply
    0
    • P Pranav Soral

      I want to access Local Security Policy (User Rights assignment) using C#. Is it possible? My requirement is to add/remove users from certain policies programatically. Thanks, Pranav

      S Offline
      S Offline
      Sathesh Sakthivel
      wrote on last edited by
      #2

      One Post is Enough.

      Regards, Satips.

      1 Reply Last reply
      0
      • P Pranav Soral

        I want to access Local Security Policy (User Rights assignment) using C#. Is it possible? My requirement is to add/remove users from certain policies programatically. Thanks, Pranav

        O Offline
        O Offline
        Osrald
        wrote on last edited by
        #3

        I think you should use IEnumerator iHeirarchy = SecurityManager.PolicyHierarchy(); then you can loop each policy level PolicyLevel polLevel = iHeirarchy.Current as PolicyLevel; and then you can get the codegroup by taking polLevel.RootCodeGroup.Children or get the named permission set polLevel.NamedPermissionSets from here you can manipulate whatever you wan't like removing or adding.

        P 1 Reply Last reply
        0
        • O Osrald

          I think you should use IEnumerator iHeirarchy = SecurityManager.PolicyHierarchy(); then you can loop each policy level PolicyLevel polLevel = iHeirarchy.Current as PolicyLevel; and then you can get the codegroup by taking polLevel.RootCodeGroup.Children or get the named permission set polLevel.NamedPermissionSets from here you can manipulate whatever you wan't like removing or adding.

          P Offline
          P Offline
          Pranav Soral
          wrote on last edited by
          #4

          Thanks a ton! Pranav

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups