How to read out the AD-property "createTimeStamp" (data type
GeneralizedTime) of an user object and convert to a readable string like
dd/mm/yyyy ?

Thanks for help

Re: Generalized Time by Richard

Richard
Mon Aug 25 10:40:48 CDT 2003

Ralf Pelzl wrote:

> How to read out the AD-property "createTimeStamp" (data type
> GeneralizedTime) of an user object and convert to a readable string like
> dd/mm/yyyy ?
>

Hi,

No conversion is required to display GeneralizedTime attributes. However,
createTimeStamp is an operational (constructed) attribute. The value is not
stored in AD, but is calculated as needed. You need to use the GetInfoEx
method to retrieve. For example:

Set objUser = GetObject("LDAP://cn=TestUser,ou=Sales,dc=MyDomain,dc=com")
objUser.GetInfoEx Array("createTimeStamp"), 0
dtmCreate = objUser.Get("createTimeStamp")
Wscript.Echo "User created: " & dtmCreate

--
Richard
Microsoft MVP Scripting and ADSI
HilltopLab web site - http://www.rlmueller.net
--