In the main login script I want to add the following:

Check the user account expiration date once he login, compare it with the current date and inform the user with the remaining month\day.

For the first part (finding the user account expiration date) I did the following

$usr ="attiahXm"

$domain = GetObject("WinNT://@domain")
$domain.filter = "user",""
for each $user in $domain
$AccountExpirationDate = $user.AccountExpirationDate
? $user.name+ ":AccountExpirationDate = "+$AccountExpirationDate
next

I got a few accounts only with empty date like.

admin:AccountExpirationDate =
Administrator:AccountExpirationDate =
backup:AccountExpirationDate =
Guest:AccountExpirationDate =

Thank you

[Razz]