Re: Script a change to 700 current users using Excel
- From: "Netengineerguy" <Netengineerguy@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 25 Apr 2005 09:08:03 -0700
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.
>
>
>
.
- Follow-Ups:
- Re: Script a change to 700 current users using Excel
- From: Jim Vierra
- Re: Script a change to 700 current users using Excel
- References:
- Script a change to 700 current users using Excel
- From: Netengineerguy
- Re: Script a change to 700 current users using Excel
- From: Jim Vierra
- Script a change to 700 current users using Excel
- Prev by Date: Re: Script a change to 700 current users using Excel
- Next by Date: RE: populate group from LDAP query
- Previous by thread: Re: Script a change to 700 current users using Excel
- Next by thread: Re: Script a change to 700 current users using Excel
- Index(es):
Relevant Pages
|