How can i set the date, when a user acount expire

Discussion in 'Scripting' started by gildner, Jan 22, 2005.

  1. gildner

    gildner Guest

    Hello, is my first qustion and i have a bad english, sorry!

    I have a script to create new user and this new user should expire to a date
    which i have in text like ""?

    gildner, Jan 22, 2005
    1. Advertisements

  2. gildner

    Jeremy Sun Guest

    batch file

    net user <username> /expires:1/1/2006 /domain
    Jeremy Sun, Jan 24, 2005
    1. Advertisements

  3. gildner

    gildner Guest

    Thanks for your answer.

    Can i set the expire in a vbscript
    gildner, Jan 24, 2005
  4. Hi

    Take a look at the "AccountExpirationDate" property:

    sDate = "10.10.2006"
    objUser.AccountExpirationDate = CDate(sDate)
    Torgeir Bakken \(MVP\), Jan 24, 2005
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.