Share all details about your problem, including any error messages you may have received.
We have an jdbc application that is decommisioned and the connection is also not working, now we want to disable all the identites that havs this application in IIQ,
I tried setIiqDisable method, but the changes are not reflecting in the ui level
you just want to show them as disabled in Identityiq or you want to disable those on the target system as well? the code which you have given here seems to be only disable in Identityiq but on the next aggregation it will start showing account as active as these are not disabled on target system.
You can prepare for all this accounts provisioning plan, that will work only if the application supports disable operation.
You can also define some Disable Provisioning Policy under Application configuration.
private static ProvisioningPlan prepareDisableADProvisioningPlan(Application app, Link link, Identity identity) {
ProvisioningPlan plan = new ProvisioningPlan();
ProvisioningPlan.AccountRequest acc = new ProvisioningPlan.AccountRequest();
acc.setApplication(app.getName());
acc.setOperation(ProvisioningPlan.AccountRequest.Operation.Disable);
acc.setNativeIdentity(link.getNativeIdentity());
plan.setIdentity(identity);
/* This code is depending on application - here Active Directory example
// this part can be skipped if you define Disable Provisioning Policy Form
acc.add(new ProvisioningPlan.AttributeRequest("msExchHideFromAddressLists", ProvisioningPlan.Operation.Set, true));
acc.add(new ProvisioningPlan.AttributeRequest("IIQDisabled", ProvisioningPlan.Operation.Set, true));
acc.add(new ProvisioningPlan.AttributeRequest("userAccountControl", ProvisioningPlan.Operation.Set, 514)); // Assuming 512 is the value for enabled account
plan.add(acc);*/
return plan;
}
And later on you have to run the provisioning plan
This code sample should do the trick. It gets all BaNCS links. It then creates a plan to disable the account and executes those plans. Please let me know if this works for you.
import sailpoint.api.Provisioner;
import sailpoint.object.Application;
import sailpoint.object.Filter;
import sailpoint.object.Link;
import sailpoint.object.ProvisioningPlan.AccountRequest;
import sailpoint.object.ProvisioningPlan;
import sailpoint.object.QueryOptions;
QueryOptions qo = new QueryOptions();
qo.add(Filter.eq("application.name", "BaNCS"));
List plans = new ArrayList();
Iterator it = context.search(Link.class, qo);
if(it != null) {
while(it.hasNext()) {
Link link = it.next();
ProvisioningPlan plan = new ProvisioningPlan();
plan.setIdentity(link.getIdentity());
ProvisioningPlan.AccountRequest accountRequest = new ProvisioningPlan.AccountRequest();
accountRequest.setApplication(link.getApplicationName());
accountRequest.setOperation(ProvisioningPlan.AccountRequest.Operation.Disable);
accountRequest.setNativeIdentity(link.getNativeIdentity());
plan.add(accountRequest);
plans.add(plan);
context.decache(link);
}
}
Provisioner provisioner = new Provisioner(context);
for(ProvisioningPlan plan : plans) {
provisioner.execute(plan);
}
return true;