Jump to content

Recommended Posts

Posted

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

Posted
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

Posted
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 ;)
Posted

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 oRoot=getobject("LDAP://rootdse")
sDomain=oRoot.get("defaultNamingContext")
Set oConn = CreateObject("ADODB.Connection")
oConn.Provider = "ADsDSOOBJECT"
oconn.Open
sQuery = ";(&(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

Posted
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.

 

Just what I'm looking for, need to get my staff details updated with proper names, looks like this will do the trick nicely :)

 

Mike.

Posted
Thanks,

 

Can anyone else vouch for this software? Last thing i want is for it to bugger up AD.

 

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 :)

  • Thanks 1
Posted

@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 :D

  • Thanks 1
Posted

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.

Posted
Definitely one for the toolkit guys :)

 

yeah - been using the password reset tool for quite some time - used to use it at the kingswood school when i was working there not sure if they still use it

Posted

Quick Question.

 

I have exported all the kids into excel. If i change the order of them of how they appear in excel how will this effect it when import it back in?

 

Thanks

Posted

Thanks for the vote of confidence in my software. :)

 

Performing Bulk Updates to Activie Directory always has an element of risk associated with it. Regardless of the software/script you use, test the update in a qa environment first and also have a recent backup of your directory database when performing the update in your live environment. The rollback feature in Bulk AD Users provides an additional level of protection making it unlikely that you would need to perform an authoritative restore.

 

I agree with the first suggestion about using the Edit In Excel feature to perform the update. You should be able to use a formula in Excel to extract the firstname/surname - something like this:

 

=MID(A1,1,FIND(" ",A1,1)-1)

=MID(A1,FIND(" ",A1,1)+1,LEN(A1))

 

(Replace A1 with the cell containing the full name)

 

There formula just splits the first name and surname based on the first space character - you might need to review the data after applying the formula to all rows to ensure that there are no anomalies.

 

Good luck. :)

  • Thanks 2
Posted
Thanks for the vote of confidence in my software. :)

 

Performing Bulk Updates to Activie Directory always has an element of risk associated with it. Regardless of the software/script you use, test the update in a qa environment first and also have a recent backup of your directory database when performing the update in your live environment. The rollback feature in Bulk AD Users provides an additional level of protection making it unlikely that you would need to perform an authoritative restore.

 

I agree with the first suggestion about using the Edit In Excel feature to perform the update. You should be able to use a formula in Excel to extract the firstname/surname - something like this:

 

=MID(A1,1,FIND(" ",A1,1)-1)

=MID(A1,FIND(" ",A1,1)+1,LEN(A1))

 

(Replace A1 with the cell containing the full name)

 

There formula just splits the first name and surname based on the first space character - you might need to review the data after applying the formula to all rows to ensure that there are no anomalies.

 

Good luck. :)

 

Thanks i managed Excel after going through help.

 

I am going to upload when the NM comes back to be double sure.

 

Nice software, rep points for you!

Posted
Quick Question.

 

I have exported all the kids into excel. If i change the order of them of how they appear in excel how will this effect it when import it back in?

 

Thanks

 

The Edit In Excel feature uses the ADsPath column to bind to user accounts in AD. The order of the rows are not important.

Posted
Thanks, when i import this back over its not going to reset the passwords or anything will it?

 

Thanks

 

No, you would need to explicitly ask for the passwords to be changed.

 

The old version of "Edit In Excel" (The one that was part of Password Control) used to update all attributes in the Excel sheet if the value was different to what is stored in AD. This had a greater chance of you overwriting another users update. The new version (Bulk AD Users) allows you to tell the application which attributes you have updated and only those specified will be updated.

 

Note: There is no update via Excel. Only "Edit In Excel" which takes the current contents of the grid and allows you to update in Excel. When you close and save the Excel file, the application will then ask you which columns you want to update. There is also a CSV Update tool included in the application which can also be used to perform updates.

 

I'm planning to extend the update features to any data source in future, but it will be a while before the next release.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...