Announcement

Collapse
No announcement yet.

Export Active Directory data

Collapse
This topic is closed.
X
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Export Active Directory data

    Does anyone know how I can export the email address field in AD to a text file?

    Thanks...

  • #2
    Re: Export Active Directory data

    Hello,
    One of the simplest methods is using Active Directory Users and Computers.
    1. Open this Snap-in, go to View, Add /Remove columns and add E-mail address to the Displayed columns list;
    2. Select the desired OU from witch you intend to make the export, go to Action and Export list;
    3. Choose the format and name of the destination file;
    4. Save

    That is all.
    Attached Files
    Last edited by netxt; 9th May 2006, 21:52.
    Regards,
    Csaba Papp
    MCSA+messaging, MCSE, CCNA
    ...............................
    Remember to give credit where credit is due and leave reputation points where appropriate
    .................................

    Comment


    • #3
      Re: Export Active Directory data

      If all you want is the primary SMTP address then the following will do the trick:
      Code:
      dsquery * -filter 
      "(&(objectCategory=person)(objectClass=user)(mail=*))" -attr mail displayname -limit 0 > email_addresses.txt
      If you want *all* the SMTP addresses the user has, then you have to look at proxyAddresses attribute and loop through it's values.
      Something like the script below will do:

      Code:
      'Global variables
      Dim Container
      Dim OutPutFile
      Dim FileSystem
      
      'Initialize global variables
      Set FileSystem = WScript.CreateObject("Scripting.FileSystemObject")
      Set OutPutFile = FileSystem.CreateTextFile("smtpaddresses.txt", True)
      
      'Replace with valid DN of the container you want to enumerate
      Set Container=GetObject("LDAP://DC=domain,DC=local")
      
      'Enumerate Container
      EnumerateUsers Container
      
      'Clean up
      OutPutFile.Close
      Set FileSystem = Nothing
      Set Container = Nothing
      
      'Say Finished when your done
      WScript.Echo "Finished"
      WScript.Quit(0)
      
      'List all Users
      Sub EnumerateUsers(Cont)
      Dim User
      
      'Go through all Users and select them
      For Each User In Cont
      Select Case LCase(User.Class)
      
      'If you find Users
      Case "user"
        'Select all proxyAddresses
        Dim Alias
        If Not IsEmpty(User.proxyAddresses) Then
          'OutPutFile.Write User.DisplayName
          For Each Alias in User.proxyAddresses
        	If InStr(1,Alias,"smtp",1) > 0 Then
      			OutPutFile.WriteLine User.DisplayName & vbTab & Replace(Alias,"smtp:","",1,1,1)
      			WScript.Echo User.DisplayName & vbTab & Replace(Alias,"smtp:","",1,1,1)
      		End If
          'WScript.Echo Alias
        	Next
        End If
      
      Case "organizationalunit" , "container"
        EnumerateUsers User
      
      End Select
      Next
      End Sub
      Guy Teverovsky
      "Smith & Wesson - the original point and click interface"

      Comment


      • #4
        Re: Export Active Directory data

        Another easy way:

        Use a dsquery.exe command to pipe the results to a dsget.exe command.

        dsquery.exe returns objects based on defined search critera such as an OU, a domain, common name containing... , etc.

        dsget.exe in turn takes the objects and reports on attributes within the object. Email address being one of the many attributes defined for user objects in a standard AD schema.

        If you need the syntax for the above, let me know and I'll post when I get home from work tonight.

        Jas
        VCDX3 #34, VCDX4, VCDX5, VCAP4-DCA #14, VCAP4-DCD #35, VCAP5-DCD, VCPx4, vEXPERTx4, MCSEx3, MCSAx2, MCP, CCAx2, A+
        boche.net - VMware Virtualization Evangelist
        My advice has no warranties. Follow at your own risk.

        Comment


        • #5
          Re: Export Active Directory data

          Originally posted by jasonboche
          Another easy way:

          Use a dsquery.exe command to pipe the results to a dsget.exe command.

          dsquery.exe returns objects based on defined search critera such as an OU, a domain, common name containing... , etc.

          dsget.exe in turn takes the objects and reports on attributes within the object. Email address being one of the many attributes defined for user objects in a standard AD schema.

          If you need the syntax for the above, let me know and I'll post when I get home from work tonight.

          Jas

          Yes Jason, it would be great if you posted the syntax, then we could use this entire thread to build some sort of a tip page on what are the options available to export the users' email addresses (or any other attribute).
          Last edited by danielp; 9th May 2006, 22:19.
          Cheers,

          Daniel Petri
          Microsoft Most Valuable Professional - Active Directory Directory Services
          MCSA/E, MCTS, MCITP, MCT

          Comment


          • #6
            Re: Export Active Directory data

            Sure thing Daniel. Let's try the following as a rough first draft. I had to cut a considerable amount of text from my original post as I was way over the 10,000 character post limit. I've trimmed it down to under 10,000 characters. All parameters for all AD command line tools are too big to fit in a 10,000 character post. Perhaps there could be several posts covering each AD command line tool.

            Here is a list of the Active Directory command line tools:
            dsadd.exe
            dsget.exe
            dsmod.exe
            dsmove.exe
            dsrm.exe
            dsquery.exe


            dsquery.exe
            Here are the parameters for the dsquery user command:
            Parameters
            {StartNode | forestroot | domainroot}
            Specifies the node where the search will start. You can specify the forest root (forestroot), domain root (domainroot), or a nodeís distinguished name (StartNode). If forestroot is specified, the search is done using the global catalog. The default value is domainroot.
            -o {dn | rdn | upn | samid}
            Specifies the format in which the list of entries found by the search will be displayed. A dn value displays the distinguished name of each entry. A rdn value displays the relative distinguished name of each entry. A upn value displays the user principal name of each entry. A samid value displays the SAM account name of each entry. By default, the dn format is used.
            -scope {subtree | onelevel | base}
            Specifies the scope of the search. A value of subtree indicates that the scope is a subtree rooted at start node. A value of onelevel indicates the immediate children of start node only. A value of base indicates the single object represented by start node. If forestroot is specified as StartNode, subtree is the only valid scope. By default, the subtree search scope is used.
            -name Name
            Searches for users whose name attributes (value of CN attribute) matches Name. For example, "jon*" or "*ith" or "j*th".
            -desc Description
            Searches for users whose description attribute matches Description. For example, "jon*" or "*ith" or "j*th".
            -upn UPN
            Searches for users whose UPN attribute matches UPN.
            -samid SAMName
            Searches for users whose SAM account name matches SAMName.
            -inactive NumberOfWeeks
            Searches for to find all users that have been inactive (stale) for at least the specified number of weeks.
            -stalepwd NumberOfDays
            Searches for all users that have not changed their password for at least the specified number of days.
            -disabled
            Searches for all users whose accounts are disabled.
            {-s Server | -d Domain}
            Connects to a specified remote server or domain. By default, the computer is connected to the domain controller in the logon domain.
            -u UserName
            Specifies the user name with which the user logs on to a remote server. By default, -u uses the user name with which the user logged on. You can use any of the following formats to specify a user name:
            user name (for example, Linda)
            domain\user name (for example, widgets\Linda)
            user principal name (UPN) (for example, [email protected])
            -p {Password | *}
            Specifies to use either a password or a * to log on to a remote server. If you type *, you are prompted for a password.
            -q
            Suppresses all output to standard output (quiet mode).
            -r
            Specifies that the search use recursion or follow referrals during search. By default, the search will not follow referrals during search.
            -gc
            Specifies that the search use the Active Directory global catalog.
            -limit NumberOfObjects
            Specifies the number of objects that match the given criteria to be returned. If the value of NumberOfObjects is 0, all matching objects are returned. If this parameter is not specified, by default the first 100 results are displayed.
            {-uc | -uco | -uci}
            Specifies that output or input data is formatted in Unicode. The following table lists and describes each format. Value Description
            -uc Specifies a Unicode format for input from or output to a pipe (|).
            -uco Specifies a Unicode format for output to a pipe (|) or a file.
            -uci Specifies a Unicode format for input from a pipe (|) or a file.


            dsget.exe

            Here is a list of objects dsget can extract attributes from:
            DSGET COMPUTER
            DSGET CONTACT
            DSGET SUBNET
            DSGET GROUP
            DSGET OU
            DSGET SERVER
            DSGET SITE
            DSGET USER
            DSGET QUOTA
            DSGET PARTITION


            Here is a list of attributes dsget can return for the USER object:
            -dn
            Displays the distinguished names of the users.
            -samid
            Displays the SAM account names of the users.
            -sid
            Displays the user security IDs (SIDs).
            -upn
            Displays the user principal names of the users.
            -fn
            Displays the first names of the users.
            -mi
            Displays the middle initials of the users.
            -ln
            Displays the last names of the users.
            -display
            Displays the display names of the users.
            -empid
            Displays the employee IDs of the users.
            -desc
            Displays the descriptions of the users.
            -full
            Displays the full names of the users.
            -office
            Displays the office locations of the users.
            -tel
            Displays the telephone numbers of the users.
            -email
            Displays the e-mail addresses of the users.
            -hometel
            Displays the home telephone numbers of the users.
            -pager
            Displays the pager numbers of the users.
            -mobile
            Displays the mobile phone numbers of the users.
            -fax
            Displays the fax numbers of the users.
            -iptel
            Displays the user IP phone numbers.
            -webpg
            Displays the user Web page URLs.
            -title
            Displays the titles of the users.
            -dept
            Displays the departments of the users.
            -company
            Displays the company information for the users.
            -mgr
            Displays the user managers of the users.
            -hmdir
            Displays the drive letter to which the home directory of the user is mapped to if the home directory path is a UNC path.
            -hmdrv
            Displays the user's home drive letter if home directory is a UNC path.
            -profile
            Displays the user profile paths.
            -loscr
            Displays the user logon script paths.
            -mustchpwd
            Displays information about whether users must change their passwords at the time of next logon (yes) or not (no).
            -canchpwd
            Displays information about whether users can change their password (yes) or not (no).
            -pwdneverexpires
            Displays information about whether the user passwords never expires (yes) or not (no).
            -disabled
            Displays information about whether user accounts are disabled for logon (yes) or not (no).
            -acctexpires
            Displays dates indicating when user accounts expire. If the accounts never expire, never is displayed.
            -reversiblepwd
            Displays information about whether the user passwords are allowed to be stored using reversible encryption (yes) or not (no).
            UserDN
            Required. Specifies the distinguished name of the user you want to view.
            -memberof
            Displays the immediate list of groups of which the user is a member.
            -expand
            Displays the recursively expanded list of groups of which the user is a member. This option takes the immediate group membership list of the user, and then recursively expands each group in this list to determine its group memberships as well to arrive at a complete closure set of the groups.
            {-uc | -uco | -uci}
            Specifies that output or input data is formatted in Unicode. The following table lists and describes each format.
            -part PartitionDN
            Connect to the directory partition with the distinguished name of PartitionDN.
            -qlimit
            Displays the effective quota of the user within the specified directory partition.
            -qused
            Displays how much of the quota the user has used within the specified directory partition. Value Description
            -uc Specifies a Unicode format for input from or output to a pipe (|).
            -uco Specifies a Unicode format for output to a pipe (|) or a file.
            -uci Specifies a Unicode format for input from a pipe (|) or a file.


            All Active Directory command line tools are documented in Windows Server 2003 online help. Just open up the Help link off the start menu and type in dsget as a search criteria and you will find all of the parameters documented. The long list of parameters above are a copy/paste from the Windows Server 2003 online help.
            Last edited by jasonboche; 10th May 2006, 05:18.
            VCDX3 #34, VCDX4, VCDX5, VCAP4-DCA #14, VCAP4-DCD #35, VCAP5-DCD, VCPx4, vEXPERTx4, MCSEx3, MCSAx2, MCP, CCAx2, A+
            boche.net - VMware Virtualization Evangelist
            My advice has no warranties. Follow at your own risk.

            Comment


            • #7
              Re: Export Active Directory data

              As I mentioned in an earlier post, both dsquery and dsget can be used as standalone commands to return a list of objects or object attributes respectively, -=or=- dsquery can be used to return a list of objects which can then be directly piped into a dsget command to return attributes of the queried objects.

              Here are a few examples which directly addresses what the original author of this post was looking for.

              Consider the following Active Directory where our user objects are stored in the default "Users" container that is built into Active Directory:


              The following screenshot shows two commands.

              The first command uses dsquery to query all user objects in the default built-in Users contaner (CN=Users). It then pipes the list of user objects into a dsget command which outputs the Email address of all the user objects that were piped into it.

              The second command uses dsquery to query all user objects in the default built-in Users contaner (CN=Users). It then pipes the list of user objects into a dsget command which outputs the UPN of all the user objects that were piped into it.





              Consider the next Active Directory (which is just a slight variation of the above example) where our user objects are stored in the Marketing OU which is a sub-OU of the Production OU in the contoso.com Active Directory domain:


              The only thing I'm pointing out in this second example is that the built-in "Users" container in AD is addressed as CN=Users (CN stands for "Common Name"). Whereas an OU in AD is addressed as OU=xxx (OU stands for "Organizational Unit"). When OUs are nested, they are presented in the following format: OU=child ou,OU=parent ou,DC=contoso,DC=com

              The following screenshot shows two commands.

              The first command uses dsquery to query all user objects in the Marketing OU (OU=Marketing). It then pipes the list of user objects into a dsget command which outputs the Email address of all the user objects that were piped into it.

              The second command uses dsquery to query all user objects in the Marketing OU (OU=Marketing). It then pipes the list of user objects into a dsget command which outputs the UPN of all the user objects that were piped into it.




              Getting the information above piped into a text file is the last part and very easy:

              Code:
              dsquery user "OU=Marketing,OU=Production,DC=Contoso,DC=com" | dsget user -samid -Email > c:\mytextfile.txt
              The command above would output text into c:\mytextfile.txt
              The output that goes in the text file would look like:
              Last edited by jasonboche; 10th May 2006, 00:50. Reason: spelling
              VCDX3 #34, VCDX4, VCDX5, VCAP4-DCA #14, VCAP4-DCD #35, VCAP5-DCD, VCPx4, vEXPERTx4, MCSEx3, MCSAx2, MCP, CCAx2, A+
              boche.net - VMware Virtualization Evangelist
              My advice has no warranties. Follow at your own risk.

              Comment


              • #8
                Re: Export Active Directory data

                Other potentially useful examples:




                Show me the samid and upn name of all disabled user accounts in the domain
                Code:
                C:\>dsquery user -disabled | dsget user -samid -upn
                  samid                   upn
                  Guest
                  krbtgt
                  B03EED71-B218-46F9-B
                dsget succeeded

                Show me the samid and upn of each user account in the domain and show me when the user account expires
                Code:
                C:\>dsquery user | dsget user -samid -upn -acctexpires
                  samid                   upn                    acctexpires
                  Administrator                                  never
                  Guest                                          never
                  krbtgt                                         never
                  jason                   [email protected]       never
                  TsInternetUser                                 never
                  arcada                  [email protected]      never
                  nav                     [email protected]         never
                  storc01                 [email protected]     never
                  vcenter                 [email protected]     never
                  amy                     [email protected]         never
                  cluster                 [email protected]     never
                  si_rev                  [email protected]      never
                  george                  [email protected]      never
                  B03EED71-B218-46F9-B                           never
                  sim                     [email protected]         never
                  schedule                [email protected]    never
                  sql                     [email protected]         never
                dsget succeeded

                Show me the samid and upn of each user account in the domain and show me when the user account expires. Send output to a file called c:\log.txt
                Code:
                C:\>dsquery user | dsget user -samid -upn -acctexpires > c:\log.txt

                Show me the samid and upn name of each user account in the Production OU in the CONTOSO.COM domain with a password age of 14 days or older and also show me if the account is flagged for "user must change password" and if the user account is allowed to change its password
                Code:
                C:\>dsquery user "OU=Production,DC=contoso,DC=com" -stalepwd 14 | dsget user -samid -upn -mustchpwd -canchpwd
                  samid                   upn                    mustchpwd    canchpwd
                  Administrator                                  no           yes
                  Guest                                          yes          no
                  krbtgt                                         no           yes
                  jason                   [email protected]       no           yes
                  TsInternetUser                                 no           no
                  arcada                  [email protected]      no           yes
                  nav                     [email protected]         no           yes
                  storc01                 [email protected]     no           yes
                  vcenter                 [email protected]     no           yes
                  amy                     [email protected]         no           yes
                  cluster                 [email protected]     no           no
                  si_rev                  [email protected]      no           no
                  george                  [email protected]      no           no
                  B03EED71-B218-46F9-B                           no           yes
                  sim                     [email protected]         no           no
                  schedule                [email protected]    no           yes
                dsget succeeded
                Last edited by jasonboche; 10th May 2006, 02:50.
                VCDX3 #34, VCDX4, VCDX5, VCAP4-DCA #14, VCAP4-DCD #35, VCAP5-DCD, VCPx4, vEXPERTx4, MCSEx3, MCSAx2, MCP, CCAx2, A+
                boche.net - VMware Virtualization Evangelist
                My advice has no warranties. Follow at your own risk.

                Comment


                • #9
                  Re: Export Active Directory data

                  That's a good one. I bet Guy has more to offer. In the meantime, here's a small one I like:

                  enumerate all the groups a user belongs to, even nested ones:

                  Code:
                  dsquery user -samid usnername  | dsget user -memberof -expand
                  Cheers,

                  Daniel Petri
                  Microsoft Most Valuable Professional - Active Directory Directory Services
                  MCSA/E, MCTS, MCITP, MCT

                  Comment


                  • #10
                    Re: Export Active Directory data

                    How about this one (VBScript) for putting into Excel?


                    Dim ObjWb
                    Dim ObjExcel
                    Dim x, zz
                    Set objRoot = GetObject("LDAP://RootDSE")
                    strDNC = objRoot.Get("DefaultNamingContext")
                    Set objDomain = GetObject("LDAP://" & strDNC) ' Bind to the top of the Domain using LDAP using ROotDSE
                    Call ExcelSetup("Sheet1") ' Sub to make Excel Document
                    x = 1
                    Call enummembers(objDomain)
                    Sub enumMembers(objDomain)
                    On Error Resume Next
                    Dim Secondary(20) ' Variable to store the Array of 2ndary email alias's
                    For Each objMember In objDomain ' go through the collection

                    If ObjMember.Class = "user" Then ' if not User object, move on.
                    x = x +1 ' counter used to increment the cells in Excel

                    objwb.Cells(x, 1).Value = objMember.Class
                    ' I set AD properties to variables so if needed you could do Null checks or add if/then's to this code
                    ' this was done so the script could be modified easier.
                    SamAccountName = ObjMember.samAccountName
                    Cn = ObjMember.CN
                    FirstName = objMember.GivenName
                    LastName = objMember.sn
                    initials = objMember.initials
                    Descrip = objMember.description
                    Office = objMember.physicalDeliveryOfficeName
                    Telephone = objMember.telephonenumber
                    EmailAddr = objMember.mail
                    WebPage = objMember.wwwHomePage
                    Addr1 = objMember.streetAddress
                    City = objMember.l
                    State = objMember.st
                    ZipCode = objMember.postalCode
                    Title = ObjMember.Title
                    Department = objMember.Department
                    Company = objMember.Company
                    Manager = ObjMember.Manager
                    Profile = objMember.profilePath
                    LoginScript = objMember.scriptpath
                    HomeDirectory = ObjMember.HomeDirectory
                    HomeDrive = ObjMember.homeDrive
                    AdsPath = Objmember.Adspath
                    LastLogin = objMember.LastLogin

                    zz = 1 ' Counter for array of 2ndary email addresses
                    For each email in ObjMember.proxyAddresses
                    If Left (email,5) = "SMTP:" Then
                    Primary = Mid (email,6) ' if SMTP is all caps, then it's the Primary
                    ElseIf Left (email,5) = "smtp:" Then
                    Secondary(zz) = Mid (email,6) ' load the list of 2ndary SMTP emails into Array.
                    zz = zz + 1
                    End If
                    Next
                    ' Write the values to Excel, using the X counter to increment the rows.

                    objwb.Cells(x, 2).Value = SamAccountName
                    objwb.Cells(x, 3).Value = CN
                    objwb.Cells(x, 4).Value = FirstName
                    objwb.Cells(x, 5).Value = LastName
                    objwb.Cells(x, 6).Value = Initials
                    objwb.Cells(x, 7).Value = Descrip
                    objwb.Cells(x, .Value = Office
                    objwb.Cells(x, 9).Value = Telephone
                    objwb.Cells(x, 10).Value = EmailAddr
                    objwb.Cells(x, 11).Value = WebPage
                    objwb.Cells(x, 12).Value = Addr1
                    objwb.Cells(x, 13).Value = City
                    objwb.Cells(x, 14).Value = State
                    objwb.Cells(x, 15).Value = ZipCode
                    objwb.Cells(x, 16).Value = Title
                    objwb.Cells(x, 17).Value = Department
                    objwb.Cells(x, 1.Value = Company
                    objwb.Cells(x, 19).Value = Manager
                    objwb.Cells(x, 20).Value = Profile
                    objwb.Cells(x, 21).Value = LoginScript
                    objwb.Cells(x, 22).Value = HomeDirectory
                    objwb.Cells(x, 23).Value = HomeDrive
                    objwb.Cells(x, 24).Value = Adspath
                    objwb.Cells(x, 25).Value = LastLogin
                    objwb.Cells(x,26).Value = Primary

                    ' Write out the Array for the 2ndary email addresses.
                    For ll = 1 To 20
                    objwb.Cells(x,26+ll).Value = Secondary(ll)
                    Next
                    ' Blank out Variables in case the next object doesn't have a value for the property
                    SamAccountName = "-"
                    Cn = "-"
                    FirstName = "-"
                    LastName = "-"
                    initials = "-"
                    Descrip = "-"
                    Office = "-"
                    Telephone = "-"
                    EmailAddr = "-"
                    WebPage = "-"
                    Addr1 = "-"
                    City = "-"
                    State = "-"
                    ZipCode = "-"
                    Title = "-"
                    Department = "-"
                    Company = "-"
                    Manager = "-"
                    Profile = "-"
                    LoginScript = "-"
                    HomeDirectory = "-"
                    HomeDrive = "-"
                    Primary = "-"
                    For ll = 1 To 20
                    Secondary(ll) = ""
                    Next
                    End If

                    ' If the AD enumeration runs into an OU object, call the Sub again to itinerate

                    If objMember.Class = "organizationalUnit" or OBjMember.Class = "container" Then
                    enumMembers (objMember)
                    End If
                    Next
                    End Sub
                    Sub ExcelSetup(shtName) ' This sub creates an Excel worksheet and adds Column heads to the 1st row
                    Set objExcel = CreateObject("Excel.Application")
                    Set objwb = objExcel.Workbooks.Add
                    Set objwb = objExcel.ActiveWorkbook.Worksheets(shtName)
                    Objwb.Name = "Active Directory Users" ' name the sheet
                    objwb.Activate
                    objExcel.Visible = True
                    objwb.Cells(1, 2).Value = "SamAccountName"
                    objwb.Cells(1, 3).Value = "CN"
                    objwb.Cells(1, 4).Value = "FirstName"
                    objwb.Cells(1, 5).Value = "LastName"
                    objwb.Cells(1, 6).Value = "Initials"
                    objwb.Cells(1, 7).Value = "Descrip"
                    objwb.Cells(1, .Value = "Office"
                    objwb.Cells(1, 9).Value = "Telephone"
                    objwb.Cells(1, 10).Value = "Email"
                    objwb.Cells(1, 11).Value = "WebPage"
                    objwb.Cells(1, 12).Value = "Addr1"
                    objwb.Cells(1, 13).Value = "City"
                    objwb.Cells(1, 14).Value = "State"
                    objwb.Cells(1, 15).Value = "ZipCode"
                    objwb.Cells(1, 16).Value = "Title"
                    objwb.Cells(1, 17).Value = "Department"
                    objwb.Cells(1, 1.Value = "Company"
                    objwb.Cells(1, 19).Value = "Manager"
                    objwb.Cells(1, 20).Value = "Profile"
                    objwb.Cells(1, 21).Value = "LoginScript"
                    objwb.Cells(1, 22).Value = "HomeDirectory"
                    objwb.Cells(1, 23).Value = "HomeDrive"
                    objwb.Cells(1, 24).Value = "Adspath"
                    objwb.Cells(1, 25).Value = "LastLogin"
                    objwb.Cells(1, 26).Value = "Primary SMTP"
                    End Sub
                    MsgBox "Done" ' show that script is complete
                    TIA

                    Steven Teiger [SBS-MVP(2003-2009)]
                    http://www.wintra.co.il/
                    sigpic
                    Iím honoured to have been selected for the SMB 150 list for 2013. This is the third time in succession (no logo available for 2011) that I have been honoured with this award.

                    We donít stop playing because we grow old, we grow old because we stop playing.

                    Comment


                    • #11
                      Re: Export Active Directory data

                      Hi people, ihave seen this queryies but steel i need help. I need data from AD like this:
                      user; name; number of logons; pwd expires; pwd request; last logon date (date format any); member of;
                      If you have an answer please post it.

                      Thanks in advance
                      Igor

                      Comment


                      • #12
                        Re: Export Active Directory data

                        Hi all,
                        I'm trying to export a list of users in a certain group under a couple of OUs and none of the scripts I've seen will do this for me. I've been trying dsquery, and I've managed to run it with no errors, but I get no output, even when I specify a filename.

                        Thanks,

                        Eoin.
                        Thanks,

                        Eoin

                        Comment


                        • #13
                          Re: Export Active Directory data

                          Eoin has been banned for 2 weeks for posting in this sticky and for not starting a New Topic for his question..
                          1 1 was a racehorse.
                          2 2 was 1 2.
                          1 1 1 1 race 1 day,
                          2 2 1 1 2

                          Comment


                          • #14
                            Re: Export Active Directory data

                            Just to add another one to the list.

                            I have a small batch file that runs and gets me a list of anything i want from a user.

                            What do i use?? CSVDE.

                            An example of my script is

                            Code:
                            csvde -d "ou=you,ou=can,ou=enter,dc=whatever,dc=you,dc=want" -l "cn,department,title,mail,telephonenumber,mobile,physicalDeliveryOfficeName" -f "\\CompName\c$\AD Export\filename.csv"
                            I know this works as i use it regularly.

                            The bolded mail is what i use to extract the email address.

                            Comment


                            • #15
                              Re: Export Active Directory data

                              Hi,

                              I am faced with rebuilding a rather large AD server. So what I'd like to know is: if you export users via the AD snap-in, can you use these to set up a new server and if so, what does it preserve? Thanks for your time.

                              Comment

                              Working...
                              X