# Modify AD Create Request in Before Create Rule

**URL:** <https://developer.sailpoint.com/discuss/t/modify-ad-create-request-in-before-create-rule/195247>\
**Category:** SHF Discussion and Questions\
**Tags:** request, rules, sailpoint-identity-security, identityiq, active-directory\
**Created:** [February 6, 2026, 11:34am UTC](https://developer.sailpoint.com/discuss/t/modify-ad-create-request-in-before-create-rule/195247 "2026-02-06T11:34:52Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![fayadm](https://avatars.discourse-cdn.com/v4/letter/f/35a633/32.png) [@fayadm](https://developer.sailpoint.com/discuss/u/fayadm)\
**Post date:** [February 6, 2026, 11:34am UTC](https://developer.sailpoint.com/discuss/t/modify-ad-create-request-in-before-create-rule/195247/1 "2026-02-06T11:34:52Z")

</div>

Hello, We are trying to manipulate attributes of an account that is to be created.  
The Before Create Rule is running successfully and is calculating the values as they should be calculated and the env:request variable is manipulated properly. This can be clearly seen in the logs I am getting.

The issue is that the account is still created using the original values. Is it not possible to manipulate a Create Request via a Before Create Rule?

```auto
    $cn = GetCnForNewAccount $givenName $lastName

    $dn = GetDnForNewAccount $cn $costCenter

    $sAMAccountName = GetSAMAccountName $givenName $lastName

    $upn = GetUserPrincipalName $givenName $lastName

    $mailNickname = GetMailNickname $givenName $lastName

function Update-Attr([string]$name, [string]$value) {
    if ($env:Request -match "name=`"$name`"") {
        # Update existing
        $env:Request = $env:Request -replace "(<AttributeRequest [^>]*?name=`"$name`" value=)`"[^`"]*`"", "`${1}`"$value`""
    } else {
        # Add new before the end of the request
        $newTag = "`n <AttributeRequest op=`"Add`" name=`"$name`" value=`"$value`" />"
        $env:Request = $env:Request -replace '</AccountRequest>', "$newTag`n</AccountRequest>"
    }
}

Update-Attr "sAMAccountName" $sAMAccountName
Update-Attr "displayName" $cn
Update-Attr "userPrincipalName" $upn
Update-Attr "mailNickname" $mailNickname

```

Above is the relevant code, but as I said, the logs show that the original request and the manipulated one have the same structure.

Eventhough the creation seems to use the old Request SailPoint is displaying this message. Eventhough the original Request and the manipulated XML have both all relevant values set properly

 ![image](https://global.discourse-cdn.com/sailpoint/original/3X/6/3/638876b9b84069c81ba1d383c73d557fb3c392ab.png)

---

<div class="post-metadata">

**Author:** ![j\_place](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/j_place/32/19181_2.png) [@j\_place](https://developer.sailpoint.com/discuss/u/j_place)\
**Post date:** [February 6, 2026, 12:11pm UTC](https://developer.sailpoint.com/discuss/t/modify-ad-create-request-in-before-create-rule/195247/2 "2026-02-06T12:11:10Z")

</div>

Hi @fayadm Why do you think that that error message is being caused by provisioning using the original request? Are you sure it is not because of another reason?

---

<div class="post-metadata">

**Author:** ![rpriya](https://avatars.discourse-cdn.com/v4/letter/r/bc79bd/32.png) [@rpriya](https://developer.sailpoint.com/discuss/u/rpriya)\
**Post date:** [February 6, 2026, 12:19pm UTC](https://developer.sailpoint.com/discuss/t/modify-ad-create-request-in-before-create-rule/195247/3 "2026-02-06T12:19:00Z")

</div>

Is there any specific thing being done in Before Create Rule which is not achievable by Create Account Provisioning Policy or Before Provisioning Rule?

---

<div class="post-metadata">

**Author:** ![gmilunich](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/gmilunich/32/8431_2.png) [@gmilunich](https://developer.sailpoint.com/discuss/u/gmilunich)\
**Post date:** [February 6, 2026, 1:52pm UTC](https://developer.sailpoint.com/discuss/t/modify-ad-create-request-in-before-create-rule/195247/4 "2026-02-06T13:52:39Z")

</div>

> [@fayadm](#):
>
> Eventhough the original Request and the manipulated XML have both all relevant values set properly
> 
> ![image](https://global.discourse-cdn.com/sailpoint/original/3X/6/3/638876b9b84069c81ba1d383c73d557fb3c392ab.png)

According to your provisioning message, the account was created properly, but some of it’s attributes were not.

Have you confirmed that the account was actually created?

If so, can you review the attributes on the account with the attributes sent in the Create Plan to determine which ones were not set/updated properly?

---

<div class="post-metadata">

**Author:** ![fayadm](https://avatars.discourse-cdn.com/v4/letter/f/35a633/32.png) [@fayadm](https://developer.sailpoint.com/discuss/u/fayadm)\
**Post date:** [February 6, 2026, 3:15pm UTC](https://developer.sailpoint.com/discuss/t/modify-ad-create-request-in-before-create-rule/195247/5 "2026-02-06T15:15:12Z")

</div>

I can, not be 100% sure but the logs surely confirm that the original Request is sent. i could see that accounts created before I uploaded the rule are containing all attributes.

My biggest issue is that I am not able to replace the original request with the one I modified.

---

<div class="post-metadata">

**Author:** ![fayadm](https://avatars.discourse-cdn.com/v4/letter/f/35a633/32.png) [@fayadm](https://developer.sailpoint.com/discuss/u/fayadm)\
**Post date:** [February 6, 2026, 3:17pm UTC](https://developer.sailpoint.com/discuss/t/modify-ad-create-request-in-before-create-rule/195247/6 "2026-02-06T15:17:42Z")

</div>

Yes, there are operations on different attributes that must be done, which is not possible to be done by Create Account Provisioning and we wanted to have the most possible control over the rule and be able to change it quickly, that is why we would rather choose it than a cloud before provisioning rule

---

<div class="post-metadata">

**Author:** ![fayadm](https://avatars.discourse-cdn.com/v4/letter/f/35a633/32.png) [@fayadm](https://developer.sailpoint.com/discuss/u/fayadm)\
**Post date:** [February 6, 2026, 3:21pm UTC](https://developer.sailpoint.com/discuss/t/modify-ad-create-request-in-before-create-rule/195247/7 "2026-02-06T15:21:04Z")

</div>

It seems like only the necessary ones are being set, that being: dn, cn, sAMAccountName

---

<div class="post-metadata">

**Author:** ![vkashat](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/vkashat/32/9721_2.png) [@vkashat](https://developer.sailpoint.com/discuss/u/vkashat)\
**Post date:** [February 6, 2026, 7:53pm UTC](https://developer.sailpoint.com/discuss/t/modify-ad-create-request-in-before-create-rule/195247/8 "2026-02-06T19:53:33Z")

</div>

Are you provisioning the “Domain Users” group during the creation process? We ran into something similar recently and that was the cause, once we removed that from the birthright role we stopped getting that error.

---

<div class="post-metadata">

**Author:** ![Peddapolu](https://avatars.discourse-cdn.com/v4/letter/p/b38774/32.png) [@Peddapolu](https://developer.sailpoint.com/discuss/u/Peddapolu)\
**Post date:** [February 8, 2026, 4:53am UTC](https://developer.sailpoint.com/discuss/t/modify-ad-create-request-in-before-create-rule/195247/9 "2026-02-08T04:53:36Z")

</div>

> [@fayadm](#):
>
> ```auto
> if ($env:Request -match "name=`"$name`"") {
> 
> ```

Hi @fayadm It looks like the `if` condition is not returning true. If this logic is inside the loop, it should update the record, but the error says to create an account, which means it is going to the else condition. You can print the logs in the script above and see where it went wrong.  
if ($env:Request -match “name=`”$name`“”) {

I hope this will help.

Thanks,

PVR.

---

<div class="post-metadata">

**Author:** ![fayadm](https://avatars.discourse-cdn.com/v4/letter/f/35a633/32.png) [@fayadm](https://developer.sailpoint.com/discuss/u/fayadm)\
**Post date:** [February 9, 2026, 8:22am UTC](https://developer.sailpoint.com/discuss/t/modify-ad-create-request-in-before-create-rule/195247/10 "2026-02-09T08:22:01Z")

</div>

No I am provisioning other memberships and this is also happening when I create an account after an access request.

---

<div class="post-metadata">

**Author:** ![fayadm](https://avatars.discourse-cdn.com/v4/letter/f/35a633/32.png) [@fayadm](https://developer.sailpoint.com/discuss/u/fayadm)\
**Post date:** [February 14, 2026, 1:38pm UTC](https://developer.sailpoint.com/discuss/t/modify-ad-create-request-in-before-create-rule/195247/11 "2026-02-14T13:38:46Z")

</div>

The issue was that I have given the whole country name to the attribute country code, which expects only 2 chars

---

<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:** [April 15, 2026, 1:39pm UTC](https://developer.sailpoint.com/discuss/t/modify-ad-create-request-in-before-create-rule/195247/12 "2026-04-15T13:39:10Z")

</div>

Closed on April 15, 2026, 1:39pm UTC

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