Login | |
|
 |
RE: export ad user's group memberships to MS Access - 5/30/2006 6:36:27 PM
|
|
 |
|
| |
gdewrance
Posts: 587
Score: 3
Joined: 3/16/2006
Status: offline
|
Just in case people ask why they dont work. here is the problem Set objRoot = GetObject("[link=http://www.visualbasicscript.com/ldap://RootDSE]LDAP://RootDSE[/link should read Set objRoot = GetObject("LDAP://RootDSE")
|
|
| |
|
|
|
 |
RE: export ad user's group memberships to MS Access - 5/31/2006 5:07:36 PM
|
|
 |
|
| |
gdewrance
Posts: 587
Score: 3
Joined: 3/16/2006
Status: offline
|
I was playing around so the script could find the default Domain and came up with this.(Worked for me let me know if its correct) For your Group and Computer Scripts try adding. (AD Users script finds the default already) Set objDomain = getObject("LDAP://rootDse") DomainString = objDomain.Get("dnsHostName") then in the computer script change the line to Set NTaccount = GetObject("WinNT://" & DomainString & "/" & ComputerName & "$") and remove or comment out 'DomainName = "DOMAIN" and 'strDomainName = "DOMAIN" ' change this to your domain name I just commented it out.
< Message edited by gdewrance -- 5/31/2006 5:11:02 PM >
_____________________________
"You start coding. I'll go find out what they want."
|
|
| |
|
|
|
 |
RE: Export AD Information to MS Access, (computers, use... - 6/5/2006 3:48:07 AM
|
|
 |
|
| |
edavis6678
Posts: 122
Score: 0
Joined: 1/12/2006
Status: offline
|
Really nice to see this in action. your problem is your table doesn't have the fields available to take data. Just expand your table and you'll be good to go. Line 20: Was this: SqlCommand = "CREATE TABLE [" & dbTableName & "] (ADGroupName Text(150), SamAccountName Text(150), Department Text(150), IsPrimary BIT, UserAdsPath Memo,ADGroupDescription Text(150))" Change to this: SqlCommand = "CREATE TABLE [" & dbTableName & "] (ADGroupName Text(150),FirstName Text(150), LastName Text(150), SamAccountName Text(150), Department Text(150), IsPrimary BIT, UserAdsPath Memo,ADGroupDescription Text(150))" Hope this explains it. -Eric
|
|
| |
|
|
|
 |
RE: Export AD Information to MS Access, (computers, use... - 2/19/2008 4:22:48 AM
|
|
 |
|
| |
edavis6678
Posts: 122
Score: 0
Joined: 1/12/2006
Status: offline
|
Nice to see someone get some use from it. I can answer part of your problem. To modify the data collected, first delete the existing table and re-run the script with the following changes: SqlCommand = "CREATE TABLE [" & dbTableName & "] (ADGroupName Text(150), SamAccountName Text(150),ADGroupDescription Text(150))" Change the Insert command in both places: 1st Insert: qryInsert = "INSERT INTO [" & dbTableName & "](ADGroupName, SamAccountName) VALUES ('" & ADGroupName & "','" & SamAccountName & "')" 2nd Insert: qryInsert = "INSERT INTO [" & dbTableName & "](ADGroupName, ADGroupDescription, SamAccountName) VALUES ('" & ADGroupName & "','" & ADGroupDescription & "','" & SamAccountName & "')" As for it dying after 45K records? You may have to go to MS SQL or some other type of database. Make sure your MDB is local to your machine. Not sure what else. Hope this helps
|
|
| |
|
|
|
|
|