Setting account expiriation time date the script

T

Tomasz Onyszko

I have Windows 2000 AD domain and for user account creation I'm using my
own script creating users with ADSI. Tis script is working OK but I
have a problem with setting usera acoount expiration date with it. Below
is a fragment of my code:

<code>
Set usr = UserOU.Create("user", "CN=" & strLogonName)

With usr
(...)
.AccountExpirationDate = strExDate
.SetInfo
(...)
End With
</code>

where strExDate is date string in following format: mm/dd/yyyy.

As You can see I use AccountExpirationDate function to set this date.

This works almost correct - te problem is that date set in directory is
different (earlier) then this which is given as function attribute. For
example, when I put 7/31/2004 the dat in account attribute is 7/30/2004
(this is just example). Does anyone know this problem and solution ?? :)


I know that I can put value directly in user attribute but I want to
avoid counting value to put in this attribute - or maybe someone has
code for counting value to put in the account expire date property for
given date?
 
T

Tomasz Onyszko

Tomasz said:
I have Windows 2000 AD domain and for user account creation I'm using my
own script creating users with ADSI. Tis script is working OK but I
have a problem with setting usera acoount expiration date with it. Below
is a fragment of my code:

OK, I know what's going on now :)) the problem was solved (or just
don't exist)
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Top