guess translated (from script in >
http://mow001.blogspot.com/2006/08/p...ry-part-7.html
) it would be this (no AD handy so not tested)
you really need to use the psbase.Invoke, as the wrapper does not handle
this (and ADSI generated method properties) correct, if I remember well.(
there is a thread about it)
$newUser.psbase.Commitchanges()
$newUser.psbase.Invoke("SetPassword","P@ssW0Rd")
$newUser.psbase.pwdLastSet = 0
# Enable User
$newUser.psbase.userAccountControl = 512
$newUser.Commitchanges()
I also find the put() ugly and the commit / setInfo, bit thats the way the
wrapper wants it (oops, sorry my rant mode comes back a bit )
as again I see how much confusion this wrapper brings,
I also use this solution at work, that helps a lot. :
http://pathologicalscripter.wordpres...-methods-back/
also good info about RC and AD you can find here :
http://tech-comments.blogspot.com/20...ll-10-rc2.html
PS why do you put all properties from CSV in varables first ?
Greetings /\/\o\/\/
"/\/\o\/\/ [MVP]" <mow001@hotmail.NoSpam> wrote in message
news:917C2F17-35E3-41E6-A137-FB13E9B73B23@microsoft.com...
>I did find your blogentries allready ;-)
>
> you need to save the Object first , because the object must exist before
> setting the password
> http://mow001.blogspot.com/2006/08/p...ry-part-7.html
>
> Greetings /\/\o\/\/
>
> "Techstarts" <preetamzare@gmail.com> wrote in message
> news:uTcPiaTSHHA.388@TK2MSFTNGP04.phx.gbl...
>> Marc,
>>
>> Inspire by your blogs I have created two Blogs, one for reading AD
>> properties and other for creating bulk users. However when i create bulk
>> users I can;t enable account and set password in one go.
>>
>> If you find suitable time could have a look at techstarts.blogspot.com,
>> sorry to reply back to group. I was not sure If I would have left comment
>> would that made sense.
>>
>> Thanks,
>> Techstarts.blogspot.com
>> ----------------------------
>>
>> "/\/\o\/\/ [MVP]" <oMVP@discussions.microsoft.com> wrote in message
>> news:E89D47E3-CDA4-4E2B-A423-3EE59BED449A@microsoft.com...
>>> comments inline
>>>
>>> "PowerShell" wrote:
>>>
>>>> MOW, you are simply superb,
>>>>
>>>
>>> Thanks ;-)
>>>
>>>> Can I have your real Name.
>>>
>>> Marc van Orsouw
>>> MVP Windows Admin Frameworks (PowerShell )
>>> http://thePowerShellGuy.com
>>>
>>>> Also I'm want to learn powershell and active directory. Could you
>>>> please
>>>> give me some links. I have seen lots of link I guess 10 parts series on
>>>> your
>>>> Blogspot.
>>>
>>> (I next to the serie I have some more example posts/ scripts (23 total I
>>> think) ;-)
>>>
>>> you can find a list (of most of them ) here
>>>
>>> http://del.icio.us/powershell/ActiveDirectory
>>>
>>>> But very few work due changes in RC2, if you could give more details
>>>> about
>>>> it.
>>>
>>> I describe the changes here :
>>>
>>> http://mow001.blogspot.com/2006/09/p...directory.html
>>> http://mow001.blogspot.com/2006/09/p...ectory_29.html
>>>
>>> from there it should be not that hard "translating the "old" examples (
>>> adding psbase mostly )
>>>
>>> as I do not that much AD at work anymore at this moment and I switched
>>> to
>>> IronPython for my AD work (my hopes are on V1.x or V2 for PowerShell to
>>> switch back ), could be some time till I do an AD post again (sorry)
>>>
>>> but if you have questions, don't hesitate to ask.
>>>
>>> Thanks again, for the Heads up.
>>>
>>> Greetings /\/\o\/\/
>>>
>>>> Cheers,
>>>> PReetam
>>>> http://techstarts.blogspot.com
>>>>
>>>> ----------------------------------------------------------
>>>>
>>>>
>>>>
>>>> "/\/\o\/\/ [MVP]" <oMVP@discussions.microsoft.com> wrote in message
>>>> news
0771CDD-596A-44C2-8546-1AD2FF56A84A@microsoft.com...
>>>> > WMI would be an option for this :
>>>> >
>>>> > PS H:\> $time = ( Get-WmiObject Win32_OperatingSystem -ComputerName .
>>>> > ).LocalDateTime
>>>> > PS H:\> $time
>>>> > 20070130100352.027000+060
>>>> > PS H:\> $NewTime = ( [wmi]'' ).ConvertToDateTime( $time ).AddHours(2)
>>>> > PS H:\> $newtime
>>>> >
>>>> > 2007 Jan 30 12:03:52 PM
>>>> >
>>>> >
>>>> > PS H:\> $newTime = ( [wmi]'' ).ConvertFromDateTime($NewTime)
>>>> > PS H:\> $newtime
>>>> > 20070130120352.027000+060
>>>> > PS H:\> ( Get-WmiObject Win32_OperatingSystem -ComputerName .
>>>> > ).SetDateTime($newtime)
>>>> >
>>>> > Greetings /\/\o\/\/
>>>> >
>>>> >
>>>> > "bmerri19" wrote:
>>>> >
>>>> >> Can the set-date cmdlet be executed to a remote server? I don't
>>>> >> see -computer
>>>> >> in the syntax listing (get-help set-date).
>>>> >>
>>>> >> With the upcoming DST change in March, I was looking at Powershell
>>>> >> as an
>>>> >> option to change a few servers times:
>>>> >>
>>>> >> Set-Date (Get-Date).AddHours(-1)
>>>> >>
>>>> >> Thanks,
>>>> >> Brian
>>>>
>>>>
>>>>
>>
>>
>