Re: Script a change to 700 current users using Excel



Thanks! However, am I missing something? It looks like you are still creating
a user and then renaming it. I want to specifically change the
"sAMAccountName" property of 700 existing users after I upgrade the domain
from NT 4.0

Thanks. :-)

"Jim Vierra" wrote:

> 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: Script a change to 700 current users using Excel
    ... to show that you retrieve the user object and apply the "Rename" method. ... However, am I missing something? ... >>> This script is great, but I want to modify current users, not create ...
    (microsoft.public.windows.server.scripting)
  • Re: destroy table vs truncated
    ... If you are truly just removing data then using "modify to truncated" is ... could create problems where a necessary secondary index is now missing. ... structure (assuming that the original structure is not heap) the ... US - Comprehensive Solutions ...
    (comp.databases.ingres)
  • Re: (setf (getf ...))
    ... > itself, or modify of any part, car or cdr, of the list structure ... So am I missing anything? ... original value is NIL -- there's no cars or cdrs to modify. ...
    (comp.lang.lisp)
  • Re: Msconfig
    ... Autoruns is a free program that will allow you to view and/or modify ALL ... startup items. ... Donny Broome ... The say they are missing or can not be loaded. ...
    (microsoft.public.windowsxp.newusers)
  • Re: XOR drawing on Tk canvas?
    ... > Is there some trick I'm missing here, or am I going to have ... > to modify the PhotoImage directly to get my hilighting? ...
    (comp.lang.tcl)