Community
cancel
Showing results for 
Search instead for 
Did you mean: 
53 Views

GetEndpointReference not working

The GetEndpointReference function in WSManClient.cs (C#) will not work for CIM objects of certain types. For example, I'm trying to get/set the active system defense policy. I can use Enumerate(typeof(AMT_NetworkPortSystemDefensePolicy)), which will return up to 2 CIM objects (one for wired and one for wireless). However, if I try using GetEndpointReference on one of these objects, I get this error: "Unable to cast object of type 'MOF_CLASSES.EndpointReferenceType' to type 'System.String'." This is a problem since I can't update/delete a specific instance withoutits EPR. So if I wanted to change the active policy on the wired interface, I wouldn't be able to do so.

AMT_NetworkPortSystemDefensePolicy has Antecedent and Dependent as its fields (both of type EndpointReference). Since the fieldcontanis an object andnot a value that canbe converted to a string, GetEndpointReference fails. Is there a solution to this problem? Or is there another way to do what I'm trying to do?

0 Kudos
1 Reply
Gael_H_Intel
Moderator
53 Views

The GetEndpointReference function in WSManClient.cs (C#) will not work for CIM objects of certain types. For example, I'm trying to get/set the active system defense policy. I can use Enumerate(typeof(AMT_NetworkPortSystemDefensePolicy)), which will return up to 2 CIM objects (one for wired and one for wireless). However, if I try using GetEndpointReference on one of these objects, I get this error: "Unable to cast object of type 'MOF_CLASSES.EndpointReferenceType' to type 'System.String'." This is a problem since I can't update/delete a specific instance withoutits EPR. So if I wanted to change the active policy on the wired interface, I wouldn't be able to do so.

AMT_NetworkPortSystemDefensePolicy has Antecedent and Dependent as its fields (both of type EndpointReference). Since the fieldcontanis an object andnot a value that canbe converted to a string, GetEndpointReference fails. Is there a solution to this problem? Or is there another way to do what I'm trying to do?


Hello Stephen,
This looks potentially like a bug in the SDK in handling nested ERPs. We are contacting our development team to investigate further.

Reply