none
FIM client Management Policy Rule RRS feed

  • Question

  • Hello, 

    i try to use the fim client, but when i test this code to get MPR i have an error cannot cast RmResource to RmManagementPolicyRule

        String filtre = "/ManagementPolicyRule";
                        ///AuthenticationWorkflowDefinition
                      
    
                        foreach (RmManagementPolicyRule mprNew in client.Enumerate(filtre))
                            //foreach (RmResource mprNew in client.Enumerate("/ManagementPolicyRule[DisplayName='# MPR - Action - User Calculate location reference']"))
                        {
    
                            Console.WriteLine(mprNew.DisplayName);
                            Console.ReadLine();
                        }

    Any idea ? 

    Wednesday, September 10, 2014 2:28 PM

All replies

  • Not sure if this will work, but i've seen some of the code examples do casting like this: 

    foreach(RmResource res in client.Enumerate(filtre)) { RmManagementPolicyRule mprNew = res as RmManagementPolicyRule

    if(mprNew != null)

    //Code }

    Otherwise, could you set break points in the code and step into the client and find where the exception is thrown? 


    Thursday, September 11, 2014 12:25 AM