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
  1. Home
  2. General Programming
  3. C#
  4. DomainController() is inaccessible due to its protection level??

DomainController() is inaccessible due to its protection level??

Scheduled Pinned Locked Moved C#
question
6 Posts 5 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.
  • L Offline
    L Offline
    lane0p2
    wrote on last edited by
    #1

    Hi Guys, i'm trying to use the DomainController class to access the metadata of an OU, but i keep getting: "'System.DirectoryServices.ActiveDirectory.DomainController.DomainController()' is inaccessible due to its protection level" any ideas on how i can change this access level? i can access the classes with the DirectoryServices namespace, it just seems to be the ActiveDirectory namespace in struggling with! sorry if this is dumb question, i'm a newbie! Many Thanks, Phil

    E M P D 4 Replies Last reply
    0
    • L lane0p2

      Hi Guys, i'm trying to use the DomainController class to access the metadata of an OU, but i keep getting: "'System.DirectoryServices.ActiveDirectory.DomainController.DomainController()' is inaccessible due to its protection level" any ideas on how i can change this access level? i can access the classes with the DirectoryServices namespace, it just seems to be the ActiveDirectory namespace in struggling with! sorry if this is dumb question, i'm a newbie! Many Thanks, Phil

      E Offline
      E Offline
      Estys
      wrote on last edited by
      #2

      The constructor DomainController() is protected, so is inaccessible to you. I saw a method getDomainController(DirectoryContext), maybe that's the way to go.

      If you can read this, you don't have Papyrus installed

      1 Reply Last reply
      0
      • L lane0p2

        Hi Guys, i'm trying to use the DomainController class to access the metadata of an OU, but i keep getting: "'System.DirectoryServices.ActiveDirectory.DomainController.DomainController()' is inaccessible due to its protection level" any ideas on how i can change this access level? i can access the classes with the DirectoryServices namespace, it just seems to be the ActiveDirectory namespace in struggling with! sorry if this is dumb question, i'm a newbie! Many Thanks, Phil

        M Offline
        M Offline
        mgr_2k7
        wrote on last edited by
        #3

        Try using DirectorySearcher class.

        1 Reply Last reply
        0
        • L lane0p2

          Hi Guys, i'm trying to use the DomainController class to access the metadata of an OU, but i keep getting: "'System.DirectoryServices.ActiveDirectory.DomainController.DomainController()' is inaccessible due to its protection level" any ideas on how i can change this access level? i can access the classes with the DirectoryServices namespace, it just seems to be the ActiveDirectory namespace in struggling with! sorry if this is dumb question, i'm a newbie! Many Thanks, Phil

          P Offline
          P Offline
          Philip Lane
          wrote on last edited by
          #4

          Thanks for your help guy, this is how i did it... DirectoryContext dCon = new DirectoryContext(DirectoryContextType.Domain); DomainController dc = DomainController.FindOne(dCon); ActiveDirectoryReplicationMetadata adMeta = dc.GetReplicationMetadata(name); foreach (AttributeMetadata a in adMeta.Values) { }

          1 Reply Last reply
          0
          • L lane0p2

            Hi Guys, i'm trying to use the DomainController class to access the metadata of an OU, but i keep getting: "'System.DirectoryServices.ActiveDirectory.DomainController.DomainController()' is inaccessible due to its protection level" any ideas on how i can change this access level? i can access the classes with the DirectoryServices namespace, it just seems to be the ActiveDirectory namespace in struggling with! sorry if this is dumb question, i'm a newbie! Many Thanks, Phil

            D Offline
            D Offline
            Dalek Dave
            wrote on last edited by
            #5

            have you changed your id? Hey ho, glad you got it sorted.

            ------------------------------------ I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave CCC League Table Link CCC Link[^]

            L 1 Reply Last reply
            0
            • D Dalek Dave

              have you changed your id? Hey ho, glad you got it sorted.

              ------------------------------------ I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave CCC League Table Link CCC Link[^]

              L Offline
              L Offline
              lane0p2
              wrote on last edited by
              #6

              i have a home and a work account - dont know how i managed that! :)

              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