Re: Script a change to 700 current users using Excel



Here are the missing pieces
Set objUser = objOU.Create("User", "cn=" & objExcel.Cells(intRow, 1))
objUser.Rename "newname"
objUser.SetInfo

--
Jim Vierra

"Netengineerguy" <Netengineerguy@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:CC25336D-633C-4CD2-AB40-52376DDAE04A@xxxxxxxxxxxxxxxx
> This script is great, but I want to modify current users, not create
> users.
> Can anyone modify it to change not create? (I am a scripting novice and
> can
> not get the correct syntax)
>
> Set objExcel = CreateObject("Excel.Application")
> Set objWorkbook = objExcel.Workbooks.Open("C:\Scripts\New_users.xls")
> intRow = 2
> Do Until objExcel.Cells(intRow,1).Value = ""
> Set objOU = GetObject("ou=Finance, dc=fabrikam, dc=com")
> Set objUser = objOU.Create("User", "cn=" & objExcel.Cells(intRow,
> 1).Value)
> objUser.sAMAccountName = objExcel.Cells(intRow, 2).Value
> objUser.GivenName = objExcel.Cells(intRow, 3).Value
> objUser.SN = objExcel.Cells(intRow, 4).Value
> objUser.AccountDisabled = FALSE
> objUser.SetInfo
> intRow = intRow + 1
> Loop
> objExcel.Quit
>
> Thanks for any help.


.



Relevant Pages

  • Re: Modifying a record field value while not blocking it to others
    ... And of course again the record you are trying to modify has not to be 'open' ... someone opens that ID=12 record everything in it is locked. ... often add a script line which opens a random record if the file holds enough ... system where customers use Credits when renting items and get Credits ...
    (comp.databases.filemaker)
  • Re: modifying objects in ADAM ADSIEDIT
    ... which is the NetBIOS name I referred to. ... ' Prompt for NetBIOS name of object in AD. ... ' Prompt for the attribute to modify. ... How do I script this by just modifying ...
    (microsoft.public.windows.server.scripting)
  • Re: sus office updates
    ... You can modify the registry ... or you can script a change for MSI to add ... my "encrypted" product code for Office 2003 Professional is: ...
    (microsoft.public.sms.tools)
  • Re: Modifying a record field value while not blocking it to others
    ... And of course again the record you are trying to modify has not to be ... someone opens that ID=12 record everything in it is locked. ... often add a script line which opens a random record if the file holds ... system where customers use Credits when renting items and get Credits ...
    (comp.databases.filemaker)
  • Re: Global Change in text files
    ... >batch program. ... I need to modify this path to ... >Does anyone have a quick script to do this? ... Prev by Date: ...
    (microsoft.public.windows.server.scripting)