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. Account Property of Active Directory/Win 2k users

Account Property of Active Directory/Win 2k users

Scheduled Pinned Locked Moved C#
questionsysadminwindows-admin
9 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.
  • U Offline
    U Offline
    User 1301677
    wrote on last edited by
    #1

    How can I detect whether the account of a user is enabled/disabled using Active Directory? The user can be of any Win Server i.e. Win2K/WinXP/Win2K3 I am able to retrieve the other properties using Active Directory. I need to enumerate thru all the users present on the server ..... and hence I don't know their passwords and hence cannot check whether their account is enabled/disabled by authenticating using the username and the password. Any suggestion/comment is welcomed ...............

    N B 2 Replies Last reply
    0
    • U User 1301677

      How can I detect whether the account of a user is enabled/disabled using Active Directory? The user can be of any Win Server i.e. Win2K/WinXP/Win2K3 I am able to retrieve the other properties using Active Directory. I need to enumerate thru all the users present on the server ..... and hence I don't know their passwords and hence cannot check whether their account is enabled/disabled by authenticating using the username and the password. Any suggestion/comment is welcomed ...............

      N Offline
      N Offline
      Nick Parker
      wrote on last edited by
      #2

      Suvadip De wrote: How can I detect whether the account of a user is enabled/disabled using Active Directory? Have you looked at the DirectoryEntry [^] class? There are serveral articles on CP and MSDN that cover this material. - Nick Parker
      My Blog | My Articles

      B U 2 Replies Last reply
      0
      • N Nick Parker

        Suvadip De wrote: How can I detect whether the account of a user is enabled/disabled using Active Directory? Have you looked at the DirectoryEntry [^] class? There are serveral articles on CP and MSDN that cover this material. - Nick Parker
        My Blog | My Articles

        B Offline
        B Offline
        BrcKcc
        wrote on last edited by
        #3

        This 'flag' is actually part of a MS defined enumeration that is the value of the userAccountControl attribute. More documentation is available at: http://msdn.microsoft.com/library/default.asp?url=/library/en-s/adschema/adschema/a\_useraccountcontrol.asp Try this and see if it helps. - Bruce BRCKCC

        N 1 Reply Last reply
        0
        • B BrcKcc

          This 'flag' is actually part of a MS defined enumeration that is the value of the userAccountControl attribute. More documentation is available at: http://msdn.microsoft.com/library/default.asp?url=/library/en-s/adschema/adschema/a\_useraccountcontrol.asp Try this and see if it helps. - Bruce BRCKCC

          N Offline
          N Offline
          Nick Parker
          wrote on last edited by
          #4

          You might try replying to Suvadip so he gets the reply, it only went to me. :) - Nick Parker
          My Blog | My Articles

          1 Reply Last reply
          0
          • U User 1301677

            How can I detect whether the account of a user is enabled/disabled using Active Directory? The user can be of any Win Server i.e. Win2K/WinXP/Win2K3 I am able to retrieve the other properties using Active Directory. I need to enumerate thru all the users present on the server ..... and hence I don't know their passwords and hence cannot check whether their account is enabled/disabled by authenticating using the username and the password. Any suggestion/comment is welcomed ...............

            B Offline
            B Offline
            BrcKcc
            wrote on last edited by
            #5

            This 'flag' is actually part of a MS defined enumeration that is the value of the userAccountControl attribute. More documentation is available at: http://msdn.microsoft.com/library/default.asp?url=/library/en-s/adschema/adschema/a\_useraccountcontrol.asp Try this and see if it helps. - Bruce BRCKCC

            U 1 Reply Last reply
            0
            • B BrcKcc

              This 'flag' is actually part of a MS defined enumeration that is the value of the userAccountControl attribute. More documentation is available at: http://msdn.microsoft.com/library/default.asp?url=/library/en-s/adschema/adschema/a\_useraccountcontrol.asp Try this and see if it helps. - Bruce BRCKCC

              U Offline
              U Offline
              User 1301677
              wrote on last edited by
              #6

              BrcKcc wrote: _http://msdn.microsoft.com/library/default.asp?url=/library/en-s/adschema/adschema/a\_useraccountcontrol.asp_ The above link gives the following : Page Cannot Be Found We apologize for the inconvenience, but the page you are seeking cannot be found in this location. Can u provide me with the actual document (if you have it) ?

              B 1 Reply Last reply
              0
              • N Nick Parker

                Suvadip De wrote: How can I detect whether the account of a user is enabled/disabled using Active Directory? Have you looked at the DirectoryEntry [^] class? There are serveral articles on CP and MSDN that cover this material. - Nick Parker
                My Blog | My Articles

                U Offline
                U Offline
                User 1301677
                wrote on last edited by
                #7

                Nick Parker wrote: Have you looked at the DirectoryEntry [^] class? Nick, I am using the Directory Entry class to get the usernames and their details on the Active Directory and also to authenticate a user for their login. But among the property lists their isn't any option for checking whether the user's account has been disabled or enabled. Though when trying to authenticate the user provided username and password, even if correct username and password is given and if the account is disabled, I am getting error and hence authentication is failing. But thats only possible if I know both the username and password. But here, I only know the domain path, and enumerating that I am able to get the usernames only and not the passwords. So, I think, I need to get the enabled/disabled property of an user account in some different way, which I suppose is possible. And to add to that, the link provided by Bruce does not exist anymore .... Suvadip.

                1 Reply Last reply
                0
                • U User 1301677

                  BrcKcc wrote: _http://msdn.microsoft.com/library/default.asp?url=/library/en-s/adschema/adschema/a\_useraccountcontrol.asp_ The above link gives the following : Page Cannot Be Found We apologize for the inconvenience, but the page you are seeking cannot be found in this location. Can u provide me with the actual document (if you have it) ?

                  B Offline
                  B Offline
                  BrcKcc
                  wrote on last edited by
                  #8

                  Sorry. Try this link: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adschema/adschema/a\_useraccountcontrol.asp Sorry, the other link was bad. - Bruce BRCKCC

                  U 1 Reply Last reply
                  0
                  • B BrcKcc

                    Sorry. Try this link: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adschema/adschema/a\_useraccountcontrol.asp Sorry, the other link was bad. - Bruce BRCKCC

                    U Offline
                    U Offline
                    User 1301677
                    wrote on last edited by
                    #9

                    Hi pal, I found the relevant doc and it contained information on my requirements. The problem now is that I am new to C# programming and facing problem to implement it. Can u help me by providing some sample code? :confused: Suvadip.

                    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