# Generating unique ID value to IDN

**URL:** <https://developer.sailpoint.com/discuss/t/generating-unique-id-value-to-idn/15284>\
**Category:** SHF Discussion and Questions\
**Tags:** identity-security-cloud, provisioning\
**Created:** [July 28, 2023, 8:21pm UTC](https://developer.sailpoint.com/discuss/t/generating-unique-id-value-to-idn/15284 "2023-07-28T20:21:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ts\_fpatterson](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/ts_fpatterson/32/26704_2.png) [@ts\_fpatterson](https://developer.sailpoint.com/discuss/u/ts_fpatterson)\
**Post date:** [July 28, 2023, 8:21pm UTC](https://developer.sailpoint.com/discuss/t/generating-unique-id-value-to-idn/15284/1 "2023-07-28T20:21:53Z")

</div>

Use case:  
sAMAccountName can’t be reused and must be unique.  
HR contains sAMAccountName values for past and existing users.  
AD only has current users as they are deleted after 30 days.  
We have a transform that populates a IDN attribute for sAMAccountName.

How do we do a query to IDN to check the sAMAccountName to make sure it is unique, writing it to IDN and then using it to create the account in AD?

Many have said that you must use the account generator on the connector. But the connector doing the lookup, AD does not have all of the sAMAccountNames. We are needing to do the lookup to IDN.

---

<div class="post-metadata">

**Author:** ![iamnithesh](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/iamnithesh/32/42445_2.png) [@iamnithesh](https://developer.sailpoint.com/discuss/u/iamnithesh)\
**Post date:** [July 28, 2023, 8:34pm UTC](https://developer.sailpoint.com/discuss/t/generating-unique-id-value-to-idn/15284/2 "2023-07-28T20:34:41Z")

</div>

Would the new account in AD be created by means of Provisioning `Create Account` Operation? In such case, to check the new `sAMAccountName` (that was generated using some logic) is unique in IDN you may use `IdnRuleUtil.countIdentitiesBySearchableIdentityAttribute` in BeforeProvisioning rule.  
Please note that you will have to make `sAMAccountName` a searchable attribute using this API  
[https://developer.sailpoint.com/idn/api/beta/create-search-attribute-config](https://developer.sailpoint.com/idn/api/beta/create-search-attribute-config)

---

<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:** [September 26, 2023, 8:35pm UTC](https://developer.sailpoint.com/discuss/t/generating-unique-id-value-to-idn/15284/3 "2023-09-26T20:35:39Z")

</div>

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