Layer7 Access Management

Expand all | Collapse all

Delete BULK Unused Trusted Hosts

Jump to Best Answer
  • 1.  Delete BULK Unused Trusted Hosts

    Posted 07-27-2017 11:16 AM

    I would like to delete unused TrustedHosts from policy store. I have identified the Unused Trusted Hosts by checking the logs. It is in range of 5000 with random naming standard. WAMUI giving option of only deleting 10 at a time. XPSExplorer giving option to delete 1 at a time by using XID or Name. 


    Anybody has any thoughts on how can i achieve the objective of deleting 500 to 1000 at a time. Any guidance will be a great help. 


    Thanks & Regards,


  • 2.  Re: Delete BULK Unused Trusted Hosts
    Best Answer

    Posted 07-30-2017 07:56 PM
      |   view attached

    Hi Sanjay,


    Your best bet would be to use CA SSO SmPolicyAPI to perform this :


    CA SiteMinder SDK r12.52sp1 



    public SmApiResult deleteTrustedHost(java.lang.String szTrustedHostName)                               throws SmApiException
    Description copied from interface: SmPolicyApi
    Deletes a Trusted Host object.


    Specified by:
    deleteTrustedHost in interface SmPolicyApi
    szTrustedHostName - The Trusted Host object to delete.
    The result of the request.

    If you aren't already familiar with using SDK. Then I would recommend installing CA SSO SDK, then inside samples folder you will find policyapi samples.

    I have also attached the sample class for your quick reference. 




  • 3.  Re: Delete BULK Unused Trusted Hosts

    Posted 07-31-2017 08:24 AM

    Thank You Ujwol, I will take a look at it.

  • 4.  Re: Delete BULK Unused Trusted Hosts

    Posted 07-31-2017 10:40 AM

    You can also use PERL API 

    Sample perl that deletes the TRUSTED host jsdksample-trustedhost

     You can use perl API to read in a file list of each trusted one at a time, delete in a loop until EOF


    #Initialize the Policy Management API

    use Netegrity::PolicyMgtAPI;

    $MyTHName        = 'jsdksample-trustedhost';

    $adminName          = 'siteminder';

    $adminPwd           = '***********';

    $policyapi = Netegrity::PolicyMgtAPI->New();

     print "Step 1. Log in the admin and create an API session.\n";

    $session = $policyapi->CreateSession("$adminName", "$adminPwd");

    print "Step 2. Deleting TrustedHost. \n";


    print "$MyTHName \n\n";