S
Sameh Ahmed
Hello there
I need to get the "PwdLastSet" of a user object to know when he last set his
password.
I am using DirectoryServices.DirectoryEntry to bind to the user object, but
it either gives "Argument 'Prompt' cannot be converted to type 'String'." or
when I use .tostring it returns "system._comobject"
I even tried to use this line but it also failed
dater.FromFileTimeUtc(entry.Properties("pwdlastset").Value) 'ast from
type '_ComObject' to type 'Long' is not valid.
I use the code below:
Dim entry As New DirectoryServices.DirectoryEntry
entry.Path = "LDAP://cn=sameh
ahmed,ou=infrastracture,ou=masreya,dc=masreya,dc=local"
MsgBox(entry.Properties("homedirectory").Item(0).ToString) 'works fine
MsgBox(entry.Properties("pwdlastset").Item(0).ToString) 'returns
"system._comobject"
MsgBox(entry.Properties("pwdlastset").Value.ToString) 'returns
"system._comobject"
MsgBox(entry.Properties("pwdlastset").Value) 'returns "system._comobject" '
"Argument 'Prompt' cannot be converted to type 'String'."
Any ideas?
Thanks in advance
Sameh
I need to get the "PwdLastSet" of a user object to know when he last set his
password.
I am using DirectoryServices.DirectoryEntry to bind to the user object, but
it either gives "Argument 'Prompt' cannot be converted to type 'String'." or
when I use .tostring it returns "system._comobject"
I even tried to use this line but it also failed
dater.FromFileTimeUtc(entry.Properties("pwdlastset").Value) 'ast from
type '_ComObject' to type 'Long' is not valid.
I use the code below:
Dim entry As New DirectoryServices.DirectoryEntry
entry.Path = "LDAP://cn=sameh
ahmed,ou=infrastracture,ou=masreya,dc=masreya,dc=local"
MsgBox(entry.Properties("homedirectory").Item(0).ToString) 'works fine
MsgBox(entry.Properties("pwdlastset").Item(0).ToString) 'returns
"system._comobject"
MsgBox(entry.Properties("pwdlastset").Value.ToString) 'returns
"system._comobject"
MsgBox(entry.Properties("pwdlastset").Value) 'returns "system._comobject" '
"Argument 'Prompt' cannot be converted to type 'String'."
Any ideas?
Thanks in advance
Sameh