I have been through 20 sites trying to understand this, but I just don't get it... How do you change System.__ComObjects. I use the [ADSI] accelerator a lot and when it comes to converting Active Dirctory Large Integer/Interval values to Int64, I just don't understand how it is suppose to work.
For example:
We have a custom schema attribute for our computer objects named ms-Mcs-AdmPwdExpirationTime. I know from looking in the Schema that the object is a Large Integer/Interval format. I know it is convertible to int64, because when I use the [ADSIsearcher] accelerator it is converted for me. Knowing that it can be converted I started looking at the object to see if I could convert the attribute I get back when I use the [ADSI] accelerator. Keep in mind that I don't have a problem to resolve, I have a lack of understanding I am trying to over come...
First I tried get-member:
TypeName: System.__ComObject
| Name | MemberType | Definition |
| ---- | ---------- | ---------- |
| CreateObjRef | Method | System.Runtime.Remoting.ObjRef CreateObjRef(type ... |
| Equals | Method | bool Equals(System.Object obj) |
| GetHashCode | Method | int GetHashCode() |
| GetLifetimeService | Method | System.Object GetLifetimeService() |
| GetType | Method | type GetType() |
| InitializeLifetimeService | Method | System.Object InitializeLifetimeService() |
| ToString | Method | string ToString() |
Nothing here seemed exceptionally helpful to converting the object, so I tried GetType():
| IsPublic | IsSerial | Name | BaseType |
| -------- | -------- | ---- | -------- |
| TRUE | FALSE | __ComObject | System.MarshalByRefObject |
I also tried looking at the PSObject
BaseObject : System.__ComObject
Members : {System.Object GetLifetimeService(), System.Object
InitializeLifetimeService(), System.Runtime.Remoting.ObjRef
CreateObjRef(type requestedType), string ToString()...}
Properties : {}
Methods : {System.Object GetLifetimeService(), System.Object
InitializeLifetimeService(), System.Runtime.Remoting.ObjRef
CreateObjRef(type requestedType), string ToString()...}
ImmediateBaseObject : System.__ComObject
TypeNames : {System.__ComObject, System.MarshalByRefObject, System.Object}
I see absolutely no hint on how I should convert this... I know what this object is, and I know what I need it to be. How should I be looking at Com objects to determine how to convert them to other data types (Large Integer/Interval to Int64 for example)?