Jump to content

Recommended Posts

Posted

Slightly different from the usual 'bulk creation' question. I already have my AD users created. However my predecessor did not fill in all the information. In paticular i would like to fill in the First Name/Surname/Display Name fields (for ABTutor) and email address (for Moodle LDAP). Any suggestions how to do this?

 

Note I do not want to re-create the accounts, just modify them.

Posted (edited)

I use a simple vbscript to run through the ou, and update attributes for each user in the ou


Set objParent = GetObject("LDAP://OU=Year group,OU=address,DC=dot,DC=com")

objparent.Filter = Array("user")



for each objUser in objParent

 'Wscript.Echo "Modifying " & objUser.Get("sAMAccountName")

objUser.put "mail", objUser.Get("sAMAccountName") & "@email.address.com"


objuser.put "proxyAddresses", "SMTP:" & objUser.Get("sAMAccountName") & "@email.address.com"

objuser.EmployeeType = "STUDENT"

objUser.put "UserPrincipalName", objUser.Get("sAMAccountName") & "@address.com"

objuser.Setinfo



   

next

Wscript.Echo "Done ;)"

 

Al colleague is writing a scrip that will update UPN's from sims so moodle courses can be automatically created

 

 

edit: just look in hte adsiedit/ldap for the attribute names of fistname,lastname etc

Edited by CyberNerd
Posted
Ok, that'll work fine for email addresses. What about First/Last/Display Names? I have the information in a CSV file currently.
Posted
objuser.put "middleName"

 

objuser.put "givenName"

 

objuser.put "sn"
sirname

 

objuser.put "name"
= displayname ?

 

you can find all these in the adsi edit - incase you need some extra fields in future.

Also with moodle it's worth having some content filter on the email side - any instant messages the student sends through moodle should get caught by the email filter

Posted

Cybernerd, I understand that aspect of it. But like I said, I need to read the information in from a CSV and match it up with accounts based on the login.

 

fooby, thanks for the link. I'll try the software as soon as my registration comes through.

Posted

fooby, password control does not give me any way to import extra info into AD, just modify existing settings in bulk.

 

mrtech, same problem.

Posted
fooby, password control does not give me any way to import extra info into AD, just modify existing settings in bulk.

 

mrtech, same problem.

 

Another recent offering of mine might help though:

 

http://www.wisesoft.co.uk/Scripts/display_script.aspx?id=178

 

Password Control/Bulk Modify allows you do base modifications on other attributes - you could set the display name to "firstname, surname" but not to load the first name and surname information from a spreadsheet.

 

The VBScript above will allow you to update AD Attributes from a CSV file - hope this helps. :)

 

As a side note I have been thinking of adding another tool to allow users to sync active directory with a database (HR database for example or a spreadsheet). I've also been thinking of adding an import utility (you can always use account management spreadsheet for now). The site and tools are all updated in my spare time - I often have lots of ideas but not enough time to implement them. :(

Posted

So close. That works for everything apart from changing the cn attribute. :(

 

LDAP://CN=T Nicholson,OU=Year10,OU=Pupils,OU=All Users,DC=carrhill,DC=lancs,DC=sch,DC=uk

Change cn from 'T Nicholson' to 'Thomas Nicholson'

Commit Changes: Failed. 

Posted
So close. That works for everything apart from changing the cn attribute. :(

 

LDAP://CN=T Nicholson,OU=Year10,OU=Pupils,OU=All Users,DC=carrhill,DC=lancs,DC=sch,DC=uk

Change cn from 'T Nicholson' to 'Thomas Nicholson'

Commit Changes: Failed. 

 

Ah ha. According to this:

 

http://www.microsoft.com/technet/scriptcenter/resources/qanda/dec04/hey1214.mspx

 

One must 'move' an LDAP object to alter it's CN. Which explains the problems I was having.

 

wiseman, any chance of changing your script so it handles CN moves?

Posted
Ah ha. According to this:

 

http://www.microsoft.com/technet/scriptcenter/resources/qanda/dec04/hey1214.mspx

 

One must 'move' an LDAP object to alter it's CN. Which explains the problems I was having.

 

wiseman, any chance of changing your script so it handles CN moves?

 

If the CN is based on another attribute my PasswordControl/BulkModify app will work (use the script for other attribute modifications).

 

The script could probably be modified to handle the cn attribute - I might look at this when I get chance (I'm away for the weekend so don't know when I'll get round to it).

Posted
@Geoff: Why not use CSVDE to export your existing users to a CSV, edit the file and then perform the import after deleting the original users?
  • 2 weeks later...
Posted

Someone asked about using the "mail" attribute to match their csv data with users in Active Directory. I decided to update the script to allow users to choose the attribute used to search (rather than hard-coded for sAMAccountName).

 

Simply change the strSearchAttribute to "mail" to get this to work. :cool:

 

Other users might want to use the userPrincipalName or other attributes to match rows in the csv file with users in AD.

 

http://www.wisesoft.co.uk/Scripts/display_script.aspx?id=178

  • 1 year later...
Posted

Hi,

 

I am trying to do exacly the same process. I need to add the student enrolment numbers to my students AD account.

 

I have tried to use CSVDE, but it doesn't allow you to overwrite existing accounts.

It will only import or export, it won't let you update.

 

If anyone has come up with a solution to bulk editing ad accounts, I would be most interested in it.

 

Thanks,

 

Barry.

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