Last post Dec 26, 2006 03:18 PM by jportelas
Nov 23, 2006 12:02 AM|MLeonard|LINK
We have extended our AD schema with some additional properties.
I am having an "issue" with accessing one of them.
Tried: Dim objUser As Object
and: Dim objUser As ActiveDs.IADsUser
objUser = GetObject(tmpADsPath) ' using LDAP
Tried "getting" into:
Dim WrkInt64 As System.Int64
and Dim WrkUInt64 As System.UInt64
and Dim WrkDtTm As DateTime
I need to read/get the current/old value:
Tried: Wrkxxxxxx = objUser.Get("customProp")
But either get "can't convert _comobject to xxxxxx" error
or a zero value
I can set/update the property fine with:
WrkInt64 = System.Convert.ToInt64(DDCDte.SelectedDate.ToFileTime)
objUser.Put("customProp", "" & WrkInt64 & "")
Using ADSI edit, can see the correct values have been set.
Also, the "objUser.Get("userAccountControl")" works fine.
What am I missing for the "Get" of the customProp ???
(This also brings up another Q...on this PUT I have to do ""& xxxx &""
for it to work(force quotes). But on a couple of the "normal" properties,
I can just do the variable(no quotes))
Nov 23, 2006 11:56 PM|MLeonard|LINK
Heres some additional information:
The property I'm having the problem with is defined as:
Name: Large Integer/Interval (INTEGER8)
Description: 64-bit integer
Used for properties: accountExpires, lastLogon, maxPwdAge, uSNCreated, uSNChanged
Did additional testing:
works OK- objUser.AccountExpirationDate -(so the builtin method converts properly)
returns zero- objUser.Get("accountExpires")
returns zero- objUser.Get("customProp")
works OK- objUser.Get("userAccountControl")
Which is defined as:
Name: Integer (Integer)
Description: 32-bit integer
Used for properties: userAccountControl, flags, groupType, primaryGroupID, rangeLower, rangeUpper
Did up an additional small test app using AD.Searcher and
I get back/can access the correct values.
So I don't think theres anything wrong with my property.
Something to do with using objUser.Get(x) and the "Large Integer/Interval" format.
Anyone have anything for a fix?
or I have to rewrite using Searcher?
Then would like assistance on how to change & save back to AD.
Dec 26, 2006 03:18 PM|jportelas|LINK
Did you find a solution for this?
Is that all the code you are using?