Announcement

Collapse
No announcement yet.

Active Directory Users list

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Active Directory Users list

    Hi All,
    i want help,
    which utility are used to find how many Users in the Each Domain and all in the Global Catlog,
    i Don't want to Active directory users and Computers go to groups , take snap shots or count down the users manulay
    so any utility are used to solve this waiting for reply
    mail me -
    [email protected]

  • #2
    Re: Active Directory Users list

    Why not create a simple query.

    Insert this into the query in ADUC

    (&(objectCategory=person)(objectClass=user)(name=* ))

    Comment


    • #3
      Re: Active Directory Users list

      http://www.google.com/search?q=all+u...n+a+forest+vbs
      Code:
      '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
      '
      '   AllUsersInGlobalCatalog.vbs
      '   http://msdn2.microsoft.com/en-us/library/ms676892.aspx
      '
      '   outputs the cn and disintguishedName of all users 
      '   in the current forest. This is accomplished by binding 
      '   to the global catalog and then searching for all users
      '   objects (that meet the criteria).
      '
      '   Be aware that this code example can output all users 
      '   in the forest, but on a large enterprise, it can take 
      '   a long time to search for and show all users. Use more 
      '   filters in the search command to avoid excessive network traffic.
      '
      '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
      
          Const ADS_SECURE_AUTHENTICATION = 1
          
          Dim oGC
          Dim oEntrprise
          
          ' Get the enterprise object from the GC namespace.
          Set oGC = GetObject("GC:")
          For Each child In oGC
              Set oEntrprise = child
              Exit For
          Next
          
          ' Setup ADO.
          Set oConn = CreateObject("ADODB.Connection")
          Set oComm = CreateObject("ADODB.Command")
           
          oConn.Provider = "ADsDSOObject"
          oConn.Properties("ADSI Flag") = ADS_SECURE_AUTHENTICATION
          
          oConn.Open
          oComm.ActiveConnection = oConn
          
          ' Set the search command and filter.
          oComm.CommandText = "<" & oEntrprise.ADsPath & ">;(&(objectCategory=person)" _
                                  & "(objectClass=user));cn,distinguishedName;subTree"
          
          ' Execute the query.
          Set oRS = oComm.Execute
          
          ' show the results.
          oRS.MoveFirst
          While Not oRS.EOF
      
              wscript.echo chr(34) & oRS.Fields("cn") & chr(34)  & "," & _ 
                        chr(34) & oRS.Fields("distinguishedName") & chr(34)
      
              oRS.MoveNext
          Wend
      Run this script from a Dosprompt:
      cscript.exe "path\AllUsersInGlobalCatalog.vbs">"c:\allUsers.csv"

      Or via a batch-file:
      @cmd /c cscript.exe "path\AllUsersInGlobalCatalog.vbs">"c:\allUsers.csv"

      the output file c:\alUsers.csv can be opened with notepad or excel.

      \Rems


      -EDIT-

      And here is a command-line method with about similar results:
      Code:
      Dsquery.exe * forestroot -gc -scope subtree -limit 0 -filter "(&(objectCategory=person)(objectClass=user)(name=*))" -attr distinguishedName cn -q>"c:\allUsers.txt"
      Last edited by Rems; 31st October 2007, 10:54.

      This posting is provided "AS IS" with no warranties, and confers no rights.

      __________________

      ** Remember to give credit where credit's due **
      and leave Reputation Points for meaningful posts

      Comment


      • #4
        Re: Active Directory Users list

        Hallo,


        Did you check the scriptig guy from MS??

        Just try it..

        http://www.microsoft.com/technet/scr...s/default.mspx

        Comment


        • #5
          Re: Active Directory Users list

          Originally posted by Cyberian View Post
          Hallo,


          Did you check the scriptig guy from MS??

          Just try it..

          http://www.microsoft.com/technet/scr...s/default.mspx
          d00d... rems IS the scripting guy.

          no point wasting your time.. rems is on point.
          its easier to beg forgiveness than ask permission.
          Give karma where karma is due...

          Comment

          Working...
          X