AnsweredAssumed Answered

Disable SiteMinder Policy using Perl

Question asked by krshravan on Apr 11, 2016
Latest reply on Apr 12, 2016 by gresa05

Hi,

I have created SiteMinder domain and policy (under the same domain) but getting error when trying to disable the policy. I tried adding double quote, single quote but there was no luck. Could you please shed some light on what is causing the issue?

 

#Creating Connection to Policy Server

use Netegrity::PolicyMgtAPI;

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

if(!defined $policyapi)

{

die "\nFATAL: Unable to create Policy Server Connection \n";

}

print "Creating Policy Server Connection Session..... \n";

$mysession = $policyapi->CreateSession("siteminder","password","ipddress");

if(!defined $mysession)

{

die "\nFATAL: Unable to create Session \n";

}

#Create a Domain

print "\tCreating Domain \'raja-shravan-perl-test-domain\'...";

$domain = $mysession->CreateDomain("raja-shravan-perl-test-domain","raja-shravan-perl-test-domain");

if(!defined $domain) {

die "\nFATAL: Unable to create Domain \'raja-shravan-perl-test-domain\'\n";

}

# Create a Policy under the raja-shravan-perl-test-domain Domain

print "\tCreating Policy \'raja-shravan-perl-test-policy\'...";

$policy = $domain->CreatePolicy("rajashravan-perl-test-policy","raja-shravan-perl-test-policy","1","test");

if(!defined $policy) {

die "\nFATAL: Unable to create Policy \'raja-shravan-perl-test-policy\'\n";

}

 

#Disable Policy under the raja-perl-test-domain Domain

print "\tModifying Policy \'raja-perl-test-policy\'...";

if($policy == 'raja-perl-test-policy') {

$policy=$policy->IsEnabled(0);

print "\tPolicy \'raja-perl-test-policy\' has been modified...";

}

 

Creating Policy Server Connection Session.....

Can't call method "IsEnabled" on an undefined value at create-domain2.pl line 17.

        Modifying Policy 'raja-perl-test-policy'...

 

Thank you,

Raja Shravan

Outcomes