Scripts Thread, Script to populate AD fields in Coding and Web Development; Hi,
All of our student user accounts do not have the First Name and Surname field populated. How ever the ...
28th July 2009, 08:29 PM #1
Script to populate AD fields
All of our student user accounts do not have the First Name and Surname field populated. How ever the Full Name field is populated with the students full name.
Does anyone have a script that can copy the first word from the Full Name field and put that into the first name field then put the remaining words into the surname field?
I have found scripts to import accounts, reset passwords on bulk but do nothing like this.
Any help would be appreciated.
28th July 2009, 08:48 PM #2
I don't have my scripting head on at the moment but you could use Wisesoft's brilliant bulk updater, point it at an OU, get it to take the current content into a spreadsheet, hack it up with splits on the full name field and then push the changes back in.
4 Thanks to kmount:
FN-GM (28th July 2009), Jackd (29th July 2009), john (28th July 2009), maniac (28th July 2009)
28th July 2009, 08:52 PM #3
Agree with that suggestion, used it myself for various things and its great
28th July 2009, 09:04 PM #4
Can anyone else vouch for this software? Last thing i want is for it to bugger up AD.
28th July 2009, 09:26 PM #5
I have used wisesofts password reset util ( registration is free ) and so are downloads etc and works a charm so am guessing that would be the same - if your worried about that you could use a virtual machine and install server 2003 and make a few dummy accounts to test and see if it works how you want it.
Originally Posted by FN-GM
WiseSoft - Resources for IT Professionals
28th July 2009, 09:48 PM #6
I have a Virtual Server farm with 4 Server 2008 Machines but i will test on that first. Because it works on the test doesn't mean it will work live
28th July 2009, 10:20 PM #7
WiseSoft Sofware has worked very well for me! and to be honest i would trust his software over a script
28th July 2009, 10:24 PM #8
This will work but note that it could add first name/last name to objects which aren't ordinary users. It checks to see if the first name or surname are already set and it also makes sure there is a space in the name but it can't cope with (eg) John Smith Jones, Jane Mary Moore or Mr J Baker.
If all your pupils are under a single top level OU then you could change the line which works out sDomain so it says something like sDomain="ou=pupils, dc=schoolname,dc=county,dc=sch,dc=uk"
Set oConn = CreateObject("ADODB.Connection")
oConn.Provider = "ADsDSOOBJECT"
sQuery = "<LDAP://" & sDomain & ">;(&(objectClass=user)(objectcategory=person));ADsPath, displayname;subtree"
Set oRS = oConn.Execute(sQuery)
do While Not oRS.EOF
if iSpace<>0 then
if oUser.givenname="" and oUser.sn="" then
28th July 2009, 11:23 PM #9
Just what I'm looking for, need to get my staff details updated with proper names, looks like this will do the trick nicely
Originally Posted by kmount
29th July 2009, 08:33 AM #10
I can completely understand your concern but you'll be pleased to know it has roll back functionality is the changes aren't quite what you wanted it'll roll them back.
Originally Posted by FN-GM
There are a couple of other useful tools on there, the password reset one is nice and the account management spreadsheet which can create users etc from simple data.
Definitely one for the toolkit guys
29th July 2009, 08:40 AM #11
@FN-GM: I will 100% vouch for Wisesofts products. They are absolutely fantastic. Rolling 'PasswordControl' out to ICT teacher so they can change pupils passwords (as I did at the last school). Use BulkADUser semi-regularly to make changes to AD. About to make changes to logon script location which I'll run through this for all users.
I'm going to use the Account Manager spreadsheet this year to add the new year 7's to AD. Beats re-writting the Pascal code I've used in previous years
29th July 2009, 09:12 AM #12
Thanks guys, i will look into this next week.
I have setup Moodle and it using LDAP so i need the firstname and surname feild to be in there.
29th July 2009, 09:17 AM #13
For Reference, I have just made a bulk change on my 2008 Test Domain and it worked perfectly!
29th July 2009, 09:48 AM #14
I too also did a bulk change and update, worked fine here. Admittedly was on a virtual server, but I am creating a new OU and gonna run a few tests on my live server in a min!
29th July 2009, 12:29 PM #15
Cheers, now just finding out how to seperate them in excel
By -Jim in forum Web Development
Last Post: 27th March 2009, 10:09 PM
By tw15ns in forum MIS Systems
Last Post: 3rd January 2009, 03:38 PM
By garethedmondson in forum Office Software
Last Post: 11th December 2008, 03:22 PM
Last Post: 3rd October 2008, 11:36 AM
By cjohnsonuk in forum MIS Systems
Last Post: 20th March 2008, 01:42 PM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)