Account Expiration!

Account Expiration!

Post by c-mo » Tue, 07 Jun 2005 18:11:48


Hello......

how can I set the account expiration date to the date on which the
account created or changed or even the date on which the password last
set plus number of days?.

And how can I display the account expiration date and be readeable as a
good format. I'm using a C#.NET language.

Also how can I get the difference between the DateTime.Now and the
account expiration date; in order to know how much the limited time
before the account will be expired?

Thanks in advance...
 
 
 

1. changing account expiration date to Never

2. AccountExpirationDate Account Expiration script

I am struggling with a script that seems like it should be rather easy. I
have a script to change the account expiration date on a container of AD 2003
user accounts. The trouble is, I'd like to add logic to the script so it
will ignore any account with an expiration date set to "Never" and I can't
work this out.

My working script looks like this:

set objOU = GetObject("LDAP://ou=Student,ou=Users,dc=Domain,dc=COM")
objOU.Filter = Array("user")
For Each objUser in objOU
objUser.AccountExpirationDate = "03/01/2008"
objUser.SetInfo
Next

The script I'd like would flow something like this but I cannot get it to
work:

set objOU = GetObject("LDAP://ou=Student,ou=Users,dc=Domain,dc=COM")
objOU.Filter = Array("user")
For Each objUser in objOU
If IsNull(objUser.AccountExpirationDate) Then
'Wscript.Echo objUser.Name, "Account has no expiration date."
Else
objUser.AccountExpirationDate = "03/01/2008"
objUser.SetInfo
End If
Next

Thanks in advance for any insight into this that you could provide.

Chris

3. Account expiration list

4. Account Expiration Script - Notify Manager

5. user account expiration

6. Account expiration for Solaris 9 using LDAP

7. Account Expiration!

8. Change User Account Expiration to Never

9. Account Expiration Date

10. Account expiration and creation dates

11. Notifying users of account expiration

12. ISA's role in account expiration / password changes

13. Account Expiration Notice - Notify Manager

14. Membership Database - Account Expiration

15. Account expirations