Update Active Directory with mySQL table data?
Does anyone know of a way to update Active Directory user information (name, username, password) with data from a mySQL table?
My future goal is to have Active Directory automatically synchronize with mySQL (which is located on a remote server) once per day, during the night. I hope to set it up so that if the user exists in mySQL but not in Active Directory, it will add the user to Active Directory. If the user already exists, it will update the fields in Active Directory with the data from mySQL.
Are there any free scripts that do this? If not, does anyone have any tips on how to start writing a script like this?
Thanks.
Re: Update Active Directory with mySQL table data?
I would suggest looking at ADSI Scripting by Thomas Eck, or several of his articles that are now on WindowsITPro (formerly WinScriptingSolutions).
Re: Update Active Directory with mySQL table data?
I currently use PHP/LDAP for modifying some aspects of the user accounts in the active directory. This would allow for the modification of items such as the password, forename, surname, homefolder, etc. I've not tried creating a user from scratch in PHP or modifying an accounts username though.
Depends if you want to have a front end to it for reporting and giving it more expansion potential.
Re: Update Active Directory with mySQL table data?
May I ask why you'd want to do this via mySQL? An LDAP server would be more appropriate...
Re: Update Active Directory with mySQL table data?
Quote:
Originally Posted by claridentech
I hope to set it up so that if the user exists in mySQL but not in Active Directory, it will add the user to Active Directory.
We already do this - using a VB app to connect to the two different databases and then it is a question of comparing and adding / updating records where appropriate.
In reality we use connect to three different databases to do this - one is the Active Directory, one is out CMIS SQL server and the third is an MSAccess dbase that registers the student CMIS ID to their Active Directory username.
This means that new students / staff put into the CMIS database get a username created overnight which is then emailed to their form tutor (and with 1800 students you can guess how much work that saves us - especailly during the summer!)
I am guessing this is the kind of thing you are trying to achieve?
Re: Update Active Directory with mySQL table data?
Thanks for all the help so far.
I am not really needing a front end or any reporting tools for this system.
I am wanting to use mySQL because I am wanting to copy the user data from our online portal system to Active Directory. This online portal system runs on mySQL. I know LDAP would be better, but I'm still hoping this will work.
Limbo, that system sounds almost exactly like what I was thinking of. It sounds amazing! I'm sure the automated system does save a lot of time during the summer.
Is there any chance you might be able to email me some code samples from this VB app? I am just getting started with VB...
Re: Update Active Directory with mySQL table data?
Quote:
Originally Posted by claridentech
Is there any chance you might be able to email me some code samples from this VB app? I am just getting started with VB...
Not in school this week to get my hands on the code (Term time holidays are a wonderful thing!) - drop me a PM as a reminder next week and I will see what I can dig out to get give you a hand.
Re: Update Active Directory with mySQL table data?
Thanks, limbo. That would be great.
I will send you a PM next week.
Re: Update Active Directory with mySQL table data?
If you go to:
http://dev.mysql.com/downloads/connector/
You can download, then install the ODBC connector which will then let you connect from VBS/VB/VBA etc.
We use this to link our excel assessment application to our mysql behaviour database.