netadmin Posted October 28, 2007 Posted October 28, 2007 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.
GrumbleDook Posted October 28, 2007 Posted October 28, 2007 I would suggest looking at ADSI Scripting by Thomas Eck, or several of his articles that are now on WindowsITPro (formerly WinScriptingSolutions).
dan400007 Posted October 29, 2007 Posted October 29, 2007 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.
localzuk Posted October 29, 2007 Posted October 29, 2007 May I ask why you'd want to do this via mySQL? An LDAP server would be more appropriate...
limbo Posted October 29, 2007 Posted October 29, 2007 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?
netadmin Posted October 29, 2007 Author Posted October 29, 2007 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...
limbo Posted October 30, 2007 Posted October 30, 2007 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.
netadmin Posted October 30, 2007 Author Posted October 30, 2007 Thanks, limbo. That would be great. I will send you a PM next week.
klawd Posted October 30, 2007 Posted October 30, 2007 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.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now