DESCRIPTION
This little function converts regular date (i.e. 04/01/1980) into integer8 value which is number of seconds since 1/1/1601. This number is used to set account Expiration date in AD. Provided by Alexi Vereschaga (av@quest.[[ars-script-wiki&mce_rdomain=dell.com:mailto:av@quest.com|]]com)
Note This code may use functions from the ARS Script Policy Best Practices. Please, follow the link to obtain instructions and code for those functions.
SCRIPT
'*********************************************************************************
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
' EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
' WARRANTIES OF MERCHANTBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
' IF YOU WANT THIS FUNCTIONALITY TO BE CONDITIONALLY SUPPORTED,
' PLEASE CONTACT QUEST PROFESSIONAL SERVICES.
'*********************************************************************************
'
' This code is published on the ActiveRoles Script Center:
' http://communities.quest.com/docs/DOC-9991
'
' This code may use functions from the ARS Script Policy Best Practices:
' http://communities.quest.com/docs/DOC-10016
'
' Please, follow the link to obtain instructions and code for those functions.
'*********************************************************************************
Function getInteger8Date(strDate)
strDateDiffSeconds = DateDiff("s",#1/1/1601#,strDate)
strDateDiffSeconds = strDateDiffSeconds + 172800 'For some reason need to add two days back...
strResult = Cstr(strDateDiffSeconds) & "0000000"
getInteger8Date = strResult
End Function
'***** END OF CODE ***************************************************************
COMPATIBILITY
Script compatible with the following version(s): <Not specified>