
Hi,
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.
Z

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.
http://www.wisesoft.co.uk/software/b...s/default.aspx
![]()

Agree with that suggestion, used it myself for various things and its great![]()

Thanks,
Can anyone else vouch for this software? Last thing i want is for it to bugger up AD.
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.
WiseSoft - Resources for IT Professionals

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![]()

WiseSoft Sofware has worked very well for me!and to be honest i would trust his software over a script
![]()
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"
Code:Set oRoot=getobject("LDAP://rootdse") sDomain=oRoot.get("defaultNamingContext") Set oConn = CreateObject("ADODB.Connection") oConn.Provider = "ADsDSOOBJECT" oconn.Open sQuery = "<LDAP://" & sDomain & ">;(&(objectClass=user)(objectcategory=person));ADsPath, displayname;subtree" Set oRS = oConn.Execute(sQuery) do While Not oRS.EOF sUser=oRS("ADSPath") sDisplay=ors("displayname") iSpace=instr(sDisplay," ") if iSpace<>0 then sGivenName=left(sDisplay,iSpace-1) sSurname=mid(sDisplay,iSpace+1) Set oUser=getobject(sUser) if oUser.givenname="" and oUser.sn="" then wscript.echo "changing" oUser.GivenName=sGivenName oUser.sn=sSurname oUser.setinfo end if end if oRS.MoveNext loop

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.
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![]()
FN-GM (29th July 2009)
@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![]()
FN-GM (29th July 2009)

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.

For Reference, I have just made a bulk change on my 2008 Test Domain and it worked perfectly!![]()

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!

Cheers, now just finding out how to seperate them in excel
There are currently 1 users browsing this thread. (0 members and 1 guests)