Quest Active Server Roles - Set AD Account to Expire using JavaScript onPostCreate using the policy creation script.

Set AD Account to Expire using JavaScript onPostCreate using the policy creation script.

' Set ACCOUNT To EXPIRE In 30 DAYS
Sub onPostCreate (Request)
If Request.Class <> "user" Then Exit Sub
' Get curent date and add 30 days to it
dateNow = Date
expirationDate = DateAdd("d",30,dateNow)
' Set the account expiration date
DirObj.AccountExpirationDate = expirationDate
DirObj.SetInfo
End Sub