All Forums >> [Scripting] >> Post a VBScript >> RE: Export Active Directory Users to Excel Worksheet Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
I could have done the excel script that way, but the problem with what you are asking is that the what happens when a user is a member of over lets say 100 groups? (that's why I chose to use Access and just dumped a flat table) - the output would be unreadable and pretty much useless in Excel. (I limited the smtp address to 10 for this reason)
I'm not sure exactly what you are after, one thought you could do if you want a nice report is use the scipts I wrote for access and then build a query/report in Access to display what you want.
Ping me via my email if you want some help building a query.
Private message me and I can help you offline, but the domain name is obtained by using RootDSE.
The computer running the script MUST be a member of the domain that you are trying to export.
In the script, add the Msgbox like to see what domain name ldap it's getting.
--------------- strDNC = objRoot.Get("DefaultNamingContext") Set objDomain = GetObject("LDAP://" & strDNC) ' Bind to the top of the Domain using LDAP using ROotDSE MsgBox strDNC '<-------------------add this to find out the name it's getting
Great script.....I'm trying to read in a.txt file that contains SamAccountName and run this through your script.....i.e produce an .xls file that contains info for only those listed in my .txt input, vs for everyone in the domain.
I realize this should be prety straight forward....but I just can't seem to get anything to work.
If you have anything to do this it would be most appreaciated.