I have a script that creates a local account on a server
and puts the user in the Users group. I need it to also
check the following boxes: User cannot change password
and Password never expires.

Here is what I have:

'Create gssrdp local user account
strComputer = "MyComputer"
Set colAccounts = GetObject("WinNT://" & strComputer
& ",computer")
Set objUser = colAccounts.Create("user", "gssrdp")
objUser.SetPassword "password"
objUser.SetInfo


'Add gssrdp user to the local Users group
strComputer = "MyComputer"
Set objGroup = GetObject("WinNT://" & strComputer
& "/Users,group")
Set objUser = GetObject("WinNT://" & strComputer
& "/gssrdp,user")
objGroup.Add(objUser.ADsPath)

Any thoughts?

Thanks,

Jeff

Re: script to create account by Torgeir

Torgeir
Wed Oct 06 10:29:47 CDT 2004

Jeff wrote:

> I have a script that creates a local account on a server
> and puts the user in the Users group. I need it to also
> check the following boxes: User cannot change password
> and Password never expires.
Hi

Here is an example:

http://groups.google.com/groups?selm=400D9FB5.FB0F7F88%40hydro.com




--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx

Re: script to create account by anonymous

anonymous
Wed Oct 06 13:12:37 CDT 2004

Torgeir,

Thanks!

Jeff

>-----Original Message-----
>Jeff wrote:
>
>> I have a script that creates a local account on a server
>> and puts the user in the Users group. I need it to also
>> check the following boxes: User cannot change password
>> and Password never expires.
>Hi
>
>Here is an example:
>
>http://groups.google.com/groups?selm=400D9FB5.FB0F7F88%
40hydro.com
>
>
>
>
>--
>torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
>Administration scripting examples and an ONLINE version of
>the 1328 page Scripting Guide:
>http://www.microsoft.com/technet/scriptcenter/default.mspx
>.
>