Home All Groups Group Topic Archive Search About

How to change user passwords



Author
2 Aug 2005 12:05 PM
Oscar B.
Hello, I need to asign a password to all users with a simple vbs.

I tested a vbs that I find in Microsoft script, but he respond that had an
error in line 1.
Any idea??

Set objUser = GetObject _
    ("LDAP://cn=user,ou=management,dc=fabrikam,dc=com")
objUser.SetPassword "i5A2sjhe"


Thaks!!

Author
2 Aug 2005 12:21 PM
Ramon Jiménez [MVP]
have you changed the domain context provided by the example with your own
domain

i.e. if your domain is "mycompany.org"
> Set objUser = GetObject _
>     ("LDAP://cn=user,ou=management,dc=mycompany,dc=org")
> objUser.SetPassword "i5A2sjhe"

Be sure User is placed in an existing OU called Management (example you
provide)

--
Saludos
Ramon Jiménez, PMP
MCSE 2000/2003, CCA, ITIL
MS MVP - Windows Server System - Infrastructure Architect
Show quote
"Oscar B." <Osc***@discussions.microsoft.com> wrote in message
news:6F53B596-0F8E-4703-9E62-651BEA92F235@microsoft.com...
> Hello, I need to asign a password to all users with a simple vbs.
>
> I tested a vbs that I find in Microsoft script, but he respond that had an
> error in line 1.
> Any idea??
>
> Set objUser = GetObject _
>     ("LDAP://cn=user,ou=management,dc=fabrikam,dc=com")
> objUser.SetPassword "i5A2sjhe"
>
>
> Thaks!!
Author
2 Aug 2005 3:04 PM
Oscar B.
Yes I change properly the user, OU and domain and he return that message:

Linea: 2
Caracter: 1
Error: Se esperaba una instruccion
Codigo: 800A0400
Origen: Error de compilacion de Microsoft VBScript
---------------------------------------
SOURCE CODE:

Set objUser = GetObject _
("LDAP://cn=user,ou=management,dc=mycompany,dc=org")
objUser.SetPassword "i5A2sjhe"
---------------------------------------

Show quote
"Ramon Jiménez [MVP]" wrote:

> have you changed the domain context provided by the example with your own
> domain
>
> i.e. if your domain is "mycompany.org"
> > Set objUser = GetObject _
> >     ("LDAP://cn=user,ou=management,dc=mycompany,dc=org")
> > objUser.SetPassword "i5A2sjhe"
>
> Be sure User is placed in an existing OU called Management (example you
> provide)
>
> --
> Saludos
> Ramon Jiménez, PMP
> MCSE 2000/2003, CCA, ITIL
> MS MVP - Windows Server System - Infrastructure Architect
> "Oscar B." <Osc***@discussions.microsoft.com> wrote in message
> news:6F53B596-0F8E-4703-9E62-651BEA92F235@microsoft.com...
> > Hello, I need to asign a password to all users with a simple vbs.
> >
> > I tested a vbs that I find in Microsoft script, but he respond that had an
> > error in line 1.
> > Any idea??
> >
> > Set objUser = GetObject _
> >     ("LDAP://cn=user,ou=management,dc=fabrikam,dc=com")
> > objUser.SetPassword "i5A2sjhe"
> >
> >
> > Thaks!!
>
>
>
Author
3 Aug 2005 4:01 PM
Oscar B.
Any idea that I append?
It's posible change the password with "net user" command??

Show quote
"Ramon Jiménez [MVP]" wrote:

> have you changed the domain context provided by the example with your own
> domain
>
> i.e. if your domain is "mycompany.org"
> > Set objUser = GetObject _
> >     ("LDAP://cn=user,ou=management,dc=mycompany,dc=org")
> > objUser.SetPassword "i5A2sjhe"
>
> Be sure User is placed in an existing OU called Management (example you
> provide)
>
> --
> Saludos
> Ramon Jiménez, PMP
> MCSE 2000/2003, CCA, ITIL
> MS MVP - Windows Server System - Infrastructure Architect
> "Oscar B." <Osc***@discussions.microsoft.com> wrote in message
> news:6F53B596-0F8E-4703-9E62-651BEA92F235@microsoft.com...
> > Hello, I need to asign a password to all users with a simple vbs.
> >
> > I tested a vbs that I find in Microsoft script, but he respond that had an
> > error in line 1.
> > Any idea??
> >
> > Set objUser = GetObject _
> >     ("LDAP://cn=user,ou=management,dc=fabrikam,dc=com")
> > objUser.SetPassword "i5A2sjhe"
> >
> >
> > Thaks!!
>
>
>
Author
3 Aug 2005 4:31 PM
James Whitlow
"Oscar B." <Osc***@discussions.microsoft.com> wrote in message
news:4604CBB5-107F-45CA-9CEF-8C98F3AA8F44@microsoft.com...
> Any idea that I append?
> It's posible change the password with "net user" command??

  Yes, you can use the following to change a domain user's password:

net user username newpassword /domain

  For example, if you have a domain user named "jdoe" and you want to change
their password to "Secret":

net user jdoe Secret /domain

  If you type 'net help user' from a command prompt, you should see:

NET USER
[username [password | *] [options]] [/DOMAIN]
         username {password | *} /ADD [options] [/DOMAIN]
         username [/DELETE] [/DOMAIN]

NET USER creates and modifies user accounts on computers. When used
without switches, it lists the user accounts for the computer. The
user account information is stored in the user accounts database.

This command works only on servers.


username     Is the name of the user account to add, delete, modify, or
             view. The name of the user account can have as many as
             20 characters.
password     Assigns or changes a password for the user's account.
             A password must satisfy the minimum length set with the
             /MINPWLEN option of the NET ACCOUNTS command. It can have as
             many as 14 characters.
*            Produces a prompt for the password. The password is not
             displayed when you type it at a password prompt.
/DOMAIN      Performs the operation on a domain controller of
             the current domain.
/ADD         Adds a user account to the user accounts database.
/DELETE      Removes a user account from the user accounts database.

Options      Are as follows:

   Options                    Description
   --------------------------------------------------------------------
   /ACTIVE:{YES | NO}         Activates or deactivates the account. If
                              the account is not active, the user cannot
                              access the server. The default is YES.
   /COMMENT:"text"            Provides a descriptive comment about the
                              user's account (maximum of 48 characters).
                              Enclose the text in quotation marks.
   /COUNTRYCODE:nnn           Uses the operating system country code to
                              implement the specified language files for a
                              user's help and error messages. A value of
                              0 signifies the default country code.
   /EXPIRES:{date | NEVER}    Causes the account to expire if date is
                              set. NEVER sets no time limit on the
                              account. An expiration date is in the
                              form mm/dd/yy or dd/mm/yy, depending on the
                              country code. Months can be a number,
                              spelled out, or abbreviated with three
                              letters. Year can be two or four numbers.
                              Use slashes(/) (no spaces) to separate
                              parts of the date.
   /FULLNAME:"name"           Is a user's full name (rather than a
                              username). Enclose the name in quotation
                              marks.
   /HOMEDIR:pathname          Sets the path for the user's home directory.
                              The path must exist.
   /PASSWORDCHG:{YES | NO}    Specifies whether users can change their
                              own password. The default is YES.
   /PASSWORDREQ:{YES | NO}    Specifies whether a user account must have
                              a password. The default is YES.
   /PROFILEPATH[:path]        Sets a path for the user's logon profile.
   /SCRIPTPATH:pathname       Is the location of the user's logon
                              script.
   /TIMES:{times | ALL}       Is the logon hours. TIMES is expressed as
                              day[-day][,day[-day]],time[-time][,time
                              [-time]], limited to 1-hour increments.
                              Days can be spelled out or abbreviated.
                              Hours can be 12- or 24-hour notation. For
                              12-hour notation, use am, pm, a.m., or
                              p.m. ALL means a user can always log on,
                              and a blank value means a user can never
                              log on. Separate day and time entries with
                              a comma, and separate multiple day and time
                              entries with a semicolon.
   /USERCOMMENT:"text"        Lets an administrator add or change the User
                              Comment for the account.
   /WORKSTATIONS:{computername[,...] | *}
                              Lists as many as eight computers from
                              which a user can log on to the network. If
                              /WORKSTATIONS has no list or if the list is *,
                              the user can log on from any computer.
Author
3 Aug 2005 5:52 PM
Oscar B.
Ok, it work correctly!! thanks

Show quote
"James Whitlow" wrote:

> "Oscar B." <Osc***@discussions.microsoft.com> wrote in message
> news:4604CBB5-107F-45CA-9CEF-8C98F3AA8F44@microsoft.com...
> > Any idea that I append?
> > It's posible change the password with "net user" command??
>
>   Yes, you can use the following to change a domain user's password:
>
> net user username newpassword /domain
>
>   For example, if you have a domain user named "jdoe" and you want to change
> their password to "Secret":
>
> net user jdoe Secret /domain
>
>   If you type 'net help user' from a command prompt, you should see:
>
> NET USER
> [username [password | *] [options]] [/DOMAIN]
>          username {password | *} /ADD [options] [/DOMAIN]
>          username [/DELETE] [/DOMAIN]
>
> NET USER creates and modifies user accounts on computers. When used
> without switches, it lists the user accounts for the computer. The
> user account information is stored in the user accounts database.
>
> This command works only on servers.
>
>
> username     Is the name of the user account to add, delete, modify, or
>              view. The name of the user account can have as many as
>              20 characters.
> password     Assigns or changes a password for the user's account.
>              A password must satisfy the minimum length set with the
>              /MINPWLEN option of the NET ACCOUNTS command. It can have as
>              many as 14 characters.
> *            Produces a prompt for the password. The password is not
>              displayed when you type it at a password prompt.
> /DOMAIN      Performs the operation on a domain controller of
>              the current domain.
> /ADD         Adds a user account to the user accounts database.
> /DELETE      Removes a user account from the user accounts database.
>
> Options      Are as follows:
>
>    Options                    Description
>    --------------------------------------------------------------------
>    /ACTIVE:{YES | NO}         Activates or deactivates the account. If
>                               the account is not active, the user cannot
>                               access the server. The default is YES.
>    /COMMENT:"text"            Provides a descriptive comment about the
>                               user's account (maximum of 48 characters).
>                               Enclose the text in quotation marks.
>    /COUNTRYCODE:nnn           Uses the operating system country code to
>                               implement the specified language files for a
>                               user's help and error messages. A value of
>                               0 signifies the default country code.
>    /EXPIRES:{date | NEVER}    Causes the account to expire if date is
>                               set. NEVER sets no time limit on the
>                               account. An expiration date is in the
>                               form mm/dd/yy or dd/mm/yy, depending on the
>                               country code. Months can be a number,
>                               spelled out, or abbreviated with three
>                               letters. Year can be two or four numbers.
>                               Use slashes(/) (no spaces) to separate
>                               parts of the date.
>    /FULLNAME:"name"           Is a user's full name (rather than a
>                               username). Enclose the name in quotation
>                               marks.
>    /HOMEDIR:pathname          Sets the path for the user's home directory.
>                               The path must exist.
>    /PASSWORDCHG:{YES | NO}    Specifies whether users can change their
>                               own password. The default is YES.
>    /PASSWORDREQ:{YES | NO}    Specifies whether a user account must have
>                               a password. The default is YES.
>    /PROFILEPATH[:path]        Sets a path for the user's logon profile.
>    /SCRIPTPATH:pathname       Is the location of the user's logon
>                               script.
>    /TIMES:{times | ALL}       Is the logon hours. TIMES is expressed as
>                               day[-day][,day[-day]],time[-time][,time
>                               [-time]], limited to 1-hour increments.
>                               Days can be spelled out or abbreviated.
>                               Hours can be 12- or 24-hour notation. For
>                               12-hour notation, use am, pm, a.m., or
>                               p.m. ALL means a user can always log on,
>                               and a blank value means a user can never
>                               log on. Separate day and time entries with
>                               a comma, and separate multiple day and time
>                               entries with a semicolon.
>    /USERCOMMENT:"text"        Lets an administrator add or change the User
>                               Comment for the account.
>    /WORKSTATIONS:{computername[,...] | *}
>                               Lists as many as eight computers from
>                               which a user can log on to the network. If
>                               /WORKSTATIONS has no list or if the list is *,
>                               the user can log on from any computer.
>
>
>

AddThis Social Bookmark Button