Jump to content

Recommended Posts

Posted

Ah - my cover is blown, and with such a cunning user name too!

 

We are still using vb6 here to do all our coding (although a great deal of what we do is then converted into asp so that it can be done through the web - taking away the need to be at a particular machine - or even at a particular site!)

 

We have got full site licenses for vb.net through our Microsoft Schools agreement but, as it appears many of you have also found, the motivation to relearn all over again in a new interface is very difficult to find.

Posted

I mentioned that I use CSVDE a while ago, and only one other person also uses it. I don't understand why it's so unpopular. I've found it quite easy to use.

 

All the hard work is done in creating the Excel spreadsheet, which isn't that hard. Just use formulas to generate the usernames and distinguished names from the pupils real names. Then export as a CSV.

 

All you need is one simple command:-

 

CSVDE -i -f filename.csv

 

 

Open up AD Users and computers. Check they're in the correct OU, and that the home folders and profile paths are correct. If not, it's easy to change them en masse in Server 2003. (It is much harder to do this in 2000 Server though, better to delete them, edit the spreadsheet, and do it again).

 

The hard part was the first time I used it, working out the columns needed for the CSV.

 

There, that's my 2p worth.

Posted

Yes, but compared to exporting a list of new pupils from

Please also remember that some of our members are not techies but ictco-ords and don't have the time to do things like that.

Posted

OK, point taken.

 

I probably have it fairly easy as the usernames are given to me as a spreadsheet (created manually by a teacher). I'm also quite comfortable with Excel, which I admit, a lot of people aren't. (Comes from boring office jobs I had before entering IT properly).

 

...

 

I can't believe I'm doing this. I don't work summer holidays. I'm sat at home supposedly studying for my MCSA whilst my family are out shopping. And all I'm doing is talking about work-related stuff. Ir's time to sign off.

  • 1 year later...
Posted
I think I will have to look into the edu price of vb.net as I am also used to vb6.

 

Ben

 

You could take a look at the 'Express' version.

  • 1 month later...
Posted

This may help some with a bit of modification to suit your setup.

 

Reads from a excel workbook. I had the user names/passwords etc given to me so it doesnt do that, only adds them to an ou in AD. You will have to change paths/domains/ etc but its a start :)

 

'User names etc must be on sheet1 of the workbook.  The columns can be in any order - adjust the Cells value below to suite. 
'An OU must be created on the server - the script wont do it!!

'Usage
'Copy the this script and the user Excel workbook to the server and double click to run.


' Possible Edits 
'---------------------------------------------------------------------------------------------------
'objExcel.Cells(intRow, 5)    =    5 is the column number to read. 
'("C:\Scripts\New_users.xls")   =   Path to the Excel workbook
'ou=NewUser,  =  choose an OU to suite, I addthem to "NewUsers" then moved them later.
'---------------------------------------------------------------------------------------------------


'open workbook
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open ("C:\Scripts\New_users.xls")

'int to count rows
intRow = 1

'loop until end of sheet1 adding the users to AD
Do Until objExcel.Cells(intRow,1).Value = ""
'set up the user
   Set objOU = GetObject("LDAP:// ou=NewUsers, dc=elginacad, dc=edu, dc=uk")
   Set objUser = objOU.Create("User", "cn=" & objExcel.Cells(intRow, 5).Value)
 	objUser.Put "sAMAccountName", objExcel.Cells(intRow, 5).Value 'samaccount name eg LawsoE
 	objUser.Put "userPrincipalName", objExcel.Cells(intRow, 5).Value ' account name eg LawsoE
objUser.sn = objExcel.Cells(intRow, 4).Value ' users Surname
objUser.givenname = objExcel.Cells(intRow, 3).Value 'users Forename
objUser.displayname = objExcel.Cells(intRow, 3).Value & " " & objExcel.Cells(intRow, 4).Value ' Forename and Surname
objUser.SetInfo
'set users password properties
objUser.ChangePassword "",objExcel.Cells(intRow, 7).Value ' users Password		
objUser.userAccountControl = 65536 
objUser.AccountDisabled = FALSE
objUser.SetInfo
'set users profile properties
objUser.Put "homeDirectory", "\\primergy\users\%username%"
objUser.Put "homeDrive", "U:"
objUser.Put "profilePath", "\\primergy\Profile\%username%"
objUser.Put "scriptPath", "login.bat"
objUser.SetInfo
   intRow = intRow + 1
Loop

'display msg box when finished
MsgBox "Done"
'quit Excel
objExcel.Quit

Posted
generate csv file from sims.net import through CC3 MMC 2mins done, all folders, shares, e-mail, printer quotas, disk quotas etc created automatically in AD ready to use immediately thanks RMCC3.
  • 2 weeks later...
Posted

i have found a really good script here exel bulk add user script

i have modofied it to this

' UserSpreadsheet .vbs

' Sample VBScript to create User accounts from a spreadsheet

' Author Guy Thomas http://computerperformance.co.uk/

' Version 4.6 - June 2005

' ------------------------------------------------------'

Option Explicit

Dim objRootLDAP, objContainer, objUser, objShell

Dim objExcel, objSpread, intRow

Dim strUser, strOU, strSheet

Dim strCN, strSam, strFirst, strLast, strPri, strPro, strPWD, strDin

 

' -------------------------------------------------------------'

' Important change OU= and strSheet to reflect your domain

' -------------------------------------------------------------'

 

strOU = "OU=Class Two,OU=Students Class, " ' Note the comma

strSheet = "C:\vbstest.xls"

 

' Bind to Active Directory, Users container.

Set objRootLDAP = GetObject("LDAP://rootDSE")

Set objContainer = GetObject("LDAP://" & strOU & _

objRootLDAP.Get("defaultNamingContext"))

 

' Open the Excel spreadsheet

Set objExcel = CreateObject("Excel.Application")

Set objSpread = objExcel.Workbooks.Open(strSheet)

intRow = 3 'Row 1 often contains headings

 

' Here is the 'DO...Loop' that cycles through the cells

' Note intRow, x must correspond to the column in strSheet

Do Until objExcel.Cells(intRow,1).Value = ""

strSam = Trim(objExcel.Cells(intRow, 1).Value)

strCN = Trim(objExcel.Cells(intRow, 2).Value)

strFirst = Trim(objExcel.Cells(intRow, 3).Value)

strLast = Trim(objExcel.Cells(intRow, 4).Value)

strPri = Trim(objExcel.cells(intRow, 5).Value)

strPro = Trim(objExcel.cells(intRow, 6).Value)

strPWD = Trim(objExcel.Cells(intRow, 7).Value)

strDin = Trim(objExcel.Cells(intRow, 8).Value)

 

' Build the actual User from data in strSheet.

Set objUser = objContainer.Create("User", "cn=" & strCN)

objUser.sAMAccountName = strSam

objUser.givenName = strFirst

objUser.sn = strLast

objUser.userPrincipalName = strPri

objuser.profilePath = strPro

objuser.displayName = strDin

objUser.SetInfo

 

' Separate section to enable account with its password

objUser.userAccountControl = 512

objUser.pwdLastSet = 0

objUser.SetPassword strPWD

objUser.SetInfo

 

intRow = intRow + 1

Loop

objExcel.Quit

 

WScript.Quit

 

' End of free example UserSpreadsheet VBScript.

have added userPrincipalName profilePath and displayName have also done one with the user home path as well and it all works really well it is not mine so i cant take no credit but it is a free sample and i have left the creater name in there but it works really well as i get a csv from sims copy and paste forename and sername use exel to create the rest and its done all i donow is copy and paste from csv to exel.

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