# Provisioning error

**URL:** <https://developer.sailpoint.com/discuss/t/provisioning-error/65205>\
**Category:** IIQ Discussion and Questions\
**Tags:** identityiq\
**Created:** [June 11, 2024, 11:27am UTC](https://developer.sailpoint.com/discuss/t/provisioning-error/65205 "2024-06-11T11:27:36Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![SecurityConsultant123](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@SecurityConsultant123](https://developer.sailpoint.com/discuss/u/SecurityConsultant123)\
**Post date:** [June 11, 2024, 11:27am UTC](https://developer.sailpoint.com/discuss/t/provisioning-error/65205/1 "2024-06-11T11:27:36Z")

</div>

### Which IIQ version are you inquiring about?

Version 8.4

### Share all details related to your problem, including any error messages you may have received.

Hello Team,  
I am trying to trigger the joiner life cycle event I am getting this error

`( Exception occurred while executing the RPCRequest: Errors returned from IQService. "A device attached to the system is not functioning. 00000523: SysErr: DSID-031A1242, problem 22 (Invalid argument), data 0 . HRESULT:[0x8007001F]" )`

If anyone knows the answer to this error please share the solution.  
Thank you

---

<div class="post-metadata">

**Author:** ![iamksatish](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/iamksatish/32/26217_2.png) [@iamksatish](https://developer.sailpoint.com/discuss/u/iamksatish)\
**Post date:** [June 11, 2024, 2:17pm UTC](https://developer.sailpoint.com/discuss/t/provisioning-error/65205/2 "2024-06-11T14:17:47Z")

</div>

@SecurityConsultant123

Did you check this already

[Exception during AD provisioning - “A Device Attached to the system is not functioning” - Compass (sailpoint.com)](https://community.sailpoint.com/t5/IdentityIQ-Wiki/Exception-during-AD-provisioning-quot-A-Device-Attached-to-the/ta-p/150116)

Most probably there is some attribute in your provisioning causing the violations at AD end.

Please do recheck once.

---

<div class="post-metadata">

**Author:** ![SecurityConsultant123](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@SecurityConsultant123](https://developer.sailpoint.com/discuss/u/SecurityConsultant123)\
**Post date:** [June 12, 2024, 5:35pm UTC](https://developer.sailpoint.com/discuss/t/provisioning-error/65205/3 "2024-06-12T17:35:50Z")

</div>

Ok Satish i am agree with your point. i am provisioning the user from hrms (JDBC) application to AD application so i am facing the same error. I have checked every script but again i am facing same error.  
Note: ( HRMS user data is masked and encrypted )  
Can you share me your input on this please

---

<div class="post-metadata">

**Author:** ![pravin\_ranjan](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/pravin_ranjan/32/6771_2.png) [@pravin\_ranjan](https://developer.sailpoint.com/discuss/u/pravin_ranjan)\
**Post date:** [June 12, 2024, 7:34pm UTC](https://developer.sailpoint.com/discuss/t/provisioning-error/65205/4 "2024-06-12T19:34:26Z")

</div>

@SecurityConsultant123 if possible then post your provisioning plan here.

---

<div class="post-metadata">

**Author:** ![SecurityConsultant123](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@SecurityConsultant123](https://developer.sailpoint.com/discuss/u/SecurityConsultant123)\
**Post date:** [June 25, 2024, 10:30am UTC](https://developer.sailpoint.com/discuss/t/provisioning-error/65205/5 "2024-06-25T10:30:12Z")

</div>

Hello Kumar Ranjan,  
This is the Provisioning plan i wrote for Joiner.

import sailpoint.object.Identity;  
import sailpoint.api.Provisioner;  
import sailpoint.object.ProvisioningPlan;  
import sailpoint.object.ProvisioningPlan.AccountRequest;  
import sailpoint.object.ProvisioningPlan.AccountRequest.Operation;  
import sailpoint.object.ProvisioningPlan.AttributeRequest;

```
    if(identityName!=null) {

    Identity identityObj=context.getObjectByName(Identity.class,identityName);

    System.out.println("Identity Name ------>>>>>"+identityObj);

    ProvisioningPlan plan = new ProvisioningPlan();

    System.out.println("Plan Name is AD Plan Create (Joiner)------>>>>>Plan: "+plan.toXml());

    if(identityObj!=null) {

    plan.setIdentity(identityObj);
    String userId = (String) identityObj.getAttribute("userId");
    String FinalDn= "cn="+userId+", ************************" ; 
    AccountRequest ADAccReq=new AccountRequest();

    ADAccReq.setApplication("ActiveDirectory");
    ADAccReq.setOperation(ProvisioningPlan.AccountRequest.Operation.Create);
    ADAccReq.setNativeIdentity(FinalDn);

    AttributeRequest AttrReq = new AttributeRequest("memberOf", ProvisioningPlan.Operation.Add,"CN= **********");
    ADAccReq.add(AttrReq);

    plan.add(ADAccReq);

    System.out.println("Plan :- "+ plan.toXml()); 
    /*
    Provisioner p=new Provisioner(context);
    p.compile(plan);
    p.execute();
    */
    } 
    return plan;
    }  

```

But now i am getting this error (Account created but some attribute are not updated property)

---

<div class="post-metadata">

**Author:** ![SecurityConsultant123](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@SecurityConsultant123](https://developer.sailpoint.com/discuss/u/SecurityConsultant123)\
**Post date:** [June 25, 2024, 10:33am UTC](https://developer.sailpoint.com/discuss/t/provisioning-error/65205/6 "2024-06-25T10:33:50Z")

</div>

I have auto populated all the values of identity with this script method ( identity.getAttribute(“Department”); ) why it is failed to get those values. if anyone knows the answer kindly drop your solution.

---

<div class="post-metadata">

**Author:** ![AdamVentum](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/adamventum/32/10508_2.png) [@AdamVentum](https://developer.sailpoint.com/discuss/u/AdamVentum)\
**Post date:** [June 25, 2024, 11:53am UTC](https://developer.sailpoint.com/discuss/t/provisioning-error/65205/7 "2024-06-25T11:53:33Z")

</div>

Hi and Hello,

Here are the changes made to your code.

1. **Added Debug Statements** :

- Added `System.out.println` statements to log the values of key attributes (`identityObj`, `userId`, `FinalDn`, `Department`). This will help identify where the issue might be.

1. **Checking and Logging Attributes** :

- Added logging for the `Department` value before adding it to the attribute request.

1. **Null Check for `identityObj`** :

- Added a check to ensure `identityObj` is not null, with an appropriate debug message.

1. **Final DN Construction** :

- Logged the value of `FinalDn` for debugging.

Here is the updated code with comments explaining the changes:

import sailpoint.object.Identity;  
import sailpoint.api.Provisioner;  
import sailpoint.object.ProvisioningPlan;  
import sailpoint.object.ProvisioningPlan.AccountRequest;  
import sailpoint.object.ProvisioningPlan.AccountRequest.Operation;  
import sailpoint.object.ProvisioningPlan.AttributeRequest;

if(identityName != null) {  
// Retrieve the identity object based on the name  
Identity identityObj = context.getObjectByName(Identity.class, identityName);  
System.out.println("Identity Name ------\>\>\>\>\> " + identityObj);

```
if(identityObj != null) {
    ProvisioningPlan plan = new ProvisioningPlan();
    plan.setIdentity(identityObj);

    // Retrieve the userId attribute from the identity object
    String userId = (String) identityObj.getAttribute("userId");
    System.out.println("User ID: " + userId);

    // Construct the final DN
    String FinalDn = "cn=" + userId + ", ************************";
    System.out.println("Final DN: " + FinalDn);

    // Create account request for Active Directory
    AccountRequest ADAccReq = new AccountRequest();
    ADAccReq.setApplication("ActiveDirectory");
    ADAccReq.setOperation(ProvisioningPlan.AccountRequest.Operation.Create);
    ADAccReq.setNativeIdentity(FinalDn);

    // Check and log the value of the department attribute
    String department = (String) identityObj.getAttribute("Department");
    System.out.println("Department: " + department);

    // Add attribute request for memberOf
    AttributeRequest AttrReq = new AttributeRequest("memberOf", ProvisioningPlan.Operation.Add, "CN= **********");
    ADAccReq.add(AttrReq);

    // Add more attributes if needed
    // ADAccReq.add(new AttributeRequest("anotherAttribute", ProvisioningPlan.Operation.Set, value));

    plan.add(ADAccReq);

    // Log the provisioning plan for debugging
    System.out.println("Plan :- " + plan.toXml());

    // Uncomment these lines to execute the plan
    /*
    Provisioner p = new Provisioner(context);
    p.compile(plan);
    p.execute();
    */

    return plan;
} else {
    System.out.println("Identity object is null.");
}

```

} else {  
System.out.println(“Identity name is null.”);  
}

return null;

These changes should help you identify where the issue lies with updating attributes in the provisioning process.

Regards,  
Adam

---

<div class="post-metadata">

**Author:** ![SecurityConsultant123](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@SecurityConsultant123](https://developer.sailpoint.com/discuss/u/SecurityConsultant123)\
**Post date:** [June 25, 2024, 11:56am UTC](https://developer.sailpoint.com/discuss/t/provisioning-error/65205/8 "2024-06-25T11:56:06Z")

</div>

Thank you Adam Waszak

---

<div class="post-metadata">

**Author:** ![AdamVentum](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/adamventum/32/10508_2.png) [@AdamVentum](https://developer.sailpoint.com/discuss/u/AdamVentum)\
**Post date:** [June 25, 2024, 12:18pm UTC](https://developer.sailpoint.com/discuss/t/provisioning-error/65205/9 "2024-06-25T12:18:56Z")

</div>

No problemo,  
Give update.

Regards,  
Adam

---

<div class="post-metadata">

**Author:** ![SecurityConsultant123](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@SecurityConsultant123](https://developer.sailpoint.com/discuss/u/SecurityConsultant123)\
**Post date:** [June 26, 2024, 4:52pm UTC](https://developer.sailpoint.com/discuss/t/provisioning-error/65205/10 "2024-06-26T16:52:53Z")

</div>

Still working on it i will update you once it is completed Adam thank for your support

regards  
Adam

---

<div class="post-metadata">

**Author:** ![pravin\_ranjan](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/pravin_ranjan/32/6771_2.png) [@pravin\_ranjan](https://developer.sailpoint.com/discuss/u/pravin_ranjan)\
**Post date:** [June 26, 2024, 5:09pm UTC](https://developer.sailpoint.com/discuss/t/provisioning-error/65205/11 "2024-06-26T17:09:22Z")

</div>

@SecurityConsultant123 pls try to execute like below

```auto
Provisioner p = new Provisioner(context);
    ProvisioningProject proj = p.compile(plan);
    p.execute(proj); 

```

Rest As Suggested by Adam, you can put some logs for troubleshooting for null values.

---

<div class="post-metadata">

**Author:** ![SecurityConsultant123](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@SecurityConsultant123](https://developer.sailpoint.com/discuss/u/SecurityConsultant123)\
**Post date:** [June 26, 2024, 5:12pm UTC](https://developer.sailpoint.com/discuss/t/provisioning-error/65205/12 "2024-06-26T17:12:46Z")

</div>

I appreciate your support @pravin_ranjan

I will check and will let you know

Thank you for your support

Regards,  
Security Consultant.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/sailpoint/original/2X/f/f2136700ed5e3703e0b85e02f6be799dacca7735.png) [@system](https://developer.sailpoint.com/discuss/u/system)\
**Post date:** [August 25, 2024, 5:13pm UTC](https://developer.sailpoint.com/discuss/t/provisioning-error/65205/13 "2024-08-25T17:13:16Z")

</div>

Closed on August 25, 2024, 5:13pm UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
