Announcement

Collapse
No announcement yet.

ALOT of help with vbs script for extracting user information from AD

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

  • ALOT of help with vbs script for extracting user information from AD

    I am not a programmer by any stretch of the imagination, so I need ALOT of help with this. I got this script from Teiger's post SEE ATTACHMENT and have attempted to modify it but I am clueless. I would like to have the following fields included on two different tabs on one spreadsheet. We currently use dumpsec but it will not include the telephone field, we have just implemented VOIP and have users that move around so keeping track of which user has what phone number has become important.

    I know this is a very specific request, and since I do not write code, I do not know how much time would be involved with this request. If it is way too involved, then please say so.

    I tried to post the URLs here, but since this is my first post I could not.

    We have a 2008 R2 Domain/Forest

    Report 1 UserName, FullName PswdRequired, PswdExpires, PswdExpiresTime,AcctDisabled, AcctLockedOut, AcctExpiresTime,LastLogonTime, LastLogonServer, LogonHours show “true” last login time”

    Report 2 include the following fields:
    UserName, FullName, Groups, Telephone Number


    I have tried to get the fields that I need using ADSI Edit and CSVDE -f but the password fields either come up blank or have integers in them. From what I have read on technet SEE ATTACHMENT I think I need to read the attribute user accounts control then read certain flags within that attribute field, for the password values that I need and convert the integers into text….again clueless

    Attached is Teiger's script that I have attempted to modify...don’t laugh to hard. I could not even figure out how to remove the code for the primary and secondary emails. I am surprised that it still works!
    Attached Files

  • #2
    Re: ALOT of help with vbs script for extracting user information from AD

    Hi,

    can you tell us ... if users are located in specific ou or spread accross entire domain.
    Thanks & Regards
    v-2nas

    MCTS 2008, MCTIP, MCSE 2003, MCSA+Messaging E2K3, MCP, E2K7
    Sr. Wintel Eng. (Investment Bank)
    Independent IT Consultant and Architect
    Blog: http://www.exchadtech.blogspot.com

    Show your appreciation for my help by giving reputation points

    Comment


    • #3
      Re: ALOT of help with vbs script for extracting user information from AD

      v-2nas,

      Accross the entire single domain/forest.

      Comment


      • #4
        Re: ALOT of help with vbs script for extracting user information from AD

        Hi,

        Can you use QuestAD commandlets in your domain? It's free, reporting will be very easy. i can write up a small code for you usin questAD Commandlets.
        Thanks & Regards
        v-2nas

        MCTS 2008, MCTIP, MCSE 2003, MCSA+Messaging E2K3, MCP, E2K7
        Sr. Wintel Eng. (Investment Bank)
        Independent IT Consultant and Architect
        Blog: http://www.exchadtech.blogspot.com

        Show your appreciation for my help by giving reputation points

        Comment


        • #5
          Re: ALOT of help with vbs script for extracting user information from AD

          Yes, we can use the QuestAD commandlets.

          Comment


          • #6
            Re: ALOT of help with vbs script for extracting user information from AD

            I'm moving this to scripting where you will get a better response.
            Tom Jones
            MCT, MCSE (2000:Security & 2003), MCSA:Security & Messaging, MCDBA, MCDST, MCITP(EA, EMA, SA, EDA, ES, CS), MCTS, MCP, Sec+
            PhD, MSc, FIAP, MIITT
            IT Trainer / Consultant
            Ossian Ltd
            Scotland

            ** Remember to give credit where credit is due and leave reputation points where appropriate **

            Comment


            • #7
              Re: ALOT of help with vbs script for extracting user information from AD

              Is this the same as the PowerGUI? I use this for the AD recycle bin.

              Comment


              • #8
                Re: ALOT of help with vbs script for extracting user information from AD

                powergui is editor you need to install quest active directory commandlets.

                just do google for it

                or you can check this
                get-pssnapin and check if you quest active directory provider listed
                Thanks & Regards
                v-2nas

                MCTS 2008, MCTIP, MCSE 2003, MCSA+Messaging E2K3, MCP, E2K7
                Sr. Wintel Eng. (Investment Bank)
                Independent IT Consultant and Architect
                Blog: http://www.exchadtech.blogspot.com

                Show your appreciation for my help by giving reputation points

                Comment


                • #9
                  Re: ALOT of help with vbs script for extracting user information from AD

                  v-2nas,

                  I got all the commandlets installed and got some output.

                  I have been trying to learn as I go and came up with this.

                  Get-QADUser -SizeLimit 0 | select givenname, sn, displayname, telephonenumber, passwordlastset, passwordage, PasswordStatus, canchpwd, acctexpirestime, lastlogon, lastlogontimestamp, logonhours, accountisexpired, accountisdisabled, accountislockedout, indirectmemberof | export-csv c:\user-profile.csv

                  BUT the output for passwordage looks like this 214.21:54:24.6661010.

                  I get nothing for canchpwd, acctexpirestime, indirectmemberof
                  I would also like to get the lastlogin server if possible.

                  Comment


                  • #10
                    Re: ALOT of help with vbs script for extracting user information from AD

                    Hi,

                    here is what you need to do... if you have same group of users < 500
                    then you can run this command

                    Report 1
                    get-qaduser -includeAllProperties | Select samAccountName, DisplayName, LastlogonTimeStamp, AccoutIsDisabled, AccountIsExpired, AccountExpirationStatus, PasswordIsExpired, PasswordStatus, PasswordExpires, logonHours, logonWorkstation | export-csv -path c:\report1.csv -notype

                    Report2
                    get-qaduser | select samAccountName, DisplayName, TelephoneNumber | export-csv -path c:\report2.csv -notype

                    and in report 2 do you want to find out user's group membership ?
                    Thanks & Regards
                    v-2nas

                    MCTS 2008, MCTIP, MCSE 2003, MCSA+Messaging E2K3, MCP, E2K7
                    Sr. Wintel Eng. (Investment Bank)
                    Independent IT Consultant and Architect
                    Blog: http://www.exchadtech.blogspot.com

                    Show your appreciation for my help by giving reputation points

                    Comment


                    • #11
                      Re: ALOT of help with vbs script for extracting user information from AD

                      and in report 2 do you want to find out user's group membership

                      Yes please.

                      Comment


                      • #12
                        Re: ALOT of help with vbs script for extracting user information from AD

                        Originally posted by JStuer View Post
                        v-2nas,

                        I

                        BUT the output for passwordage looks like this 214.21:54:24.6661010.

                        PasswordAge :
                        Time that has elapsed since the password was set or last changed.

                        The format is HH:MM:SS:mmss
                        Thanks & Regards
                        v-2nas

                        MCTS 2008, MCTIP, MCSE 2003, MCSA+Messaging E2K3, MCP, E2K7
                        Sr. Wintel Eng. (Investment Bank)
                        Independent IT Consultant and Architect
                        Blog: http://www.exchadtech.blogspot.com

                        Show your appreciation for my help by giving reputation points

                        Comment


                        • #13
                          Re: ALOT of help with vbs script for extracting user information from AD

                          Report 1
                          Got ouput for everything except logonworkstation, and the logonhours looks like this 1FF8FF1FF8FF1FF8FF1FF8FF1FF8FF1FF8FF1FF8FF

                          Report 2 ran fine

                          Comment


                          • #14
                            Re: ALOT of help with vbs script for extracting user information from AD

                            Hi,

                            if you use simply memberof, then all the members DN will be dumped into one single cell in csv file.

                            What you can do is use (get-qaduser -identity administrator).memberof. This will show you multivaule attribute in one column multi row. then latter you can use excel to get the usernames
                            Thanks & Regards
                            v-2nas

                            MCTS 2008, MCTIP, MCSE 2003, MCSA+Messaging E2K3, MCP, E2K7
                            Sr. Wintel Eng. (Investment Bank)
                            Independent IT Consultant and Architect
                            Blog: http://www.exchadtech.blogspot.com

                            Show your appreciation for my help by giving reputation points

                            Comment


                            • #15
                              Re: ALOT of help with vbs script for extracting user information from AD

                              Can the logonhours be converted from this 1FF8FF1FF8FF1FF8FF1FF8FF1FF8FF1FF8FF1FF8FF to say ALL or this Sun(6-24)Mon(6-24)Tue(6-24)Wed(6-24)Thu(6-24)Fri(6-24)Sat(6-24)


                              How do you give points?

                              Comment

                              Working...
                              X