0 votes

I'm currently writing an "After User Creation" rule and I have a PowerShell script that adds the newly created, on-premises synced user to a handful of cloud-only Entra ID groups used for group based licensing. The problem I'm having is that the script keeps saying the user isn't found when I run the command using sAMAccountName or SID but it works fine if I go and find the Entra ID specific SID number for the user. The problem is that the Entra specific SID doesn't appear to be an option in the value references for my script.

So, how can I add an on-premises synced user to a cloud only group in an "After User Creation" rule using PowerShell?

image.png image.png

I should note that using the regular actions (outside of PowerShell) work fine in this scenario, it is only the powershell cmdlet that fails. I need to use PowerShell for the additional condtional flexibility.

ago by (60 points)

1 Answer

0 votes
ago by (294k points)

Hello,

If the built-in Add to group action works fine, you already have the pre-create function enabled for Microsoft Entra accounts. In this case, the script should also work fine. Make sure to set the -Server parameter to cloud domain, e.g. company.onmicrosoft.com. Should the issue persist, please, send the full script you are using without hiding anything at support@adaxes.com.

0

I think I figured it out, the script is working when I actually run the business rule but does not work when I run the script from the script editor.

Thank you for your help.

Related questions

0 votes
1 answer

Hi all, How can I add a user directly to an Entra ID group? I understand it might be possible via CLI e.g. Add-AzureADGroupMember - But is there a built-in GUI method via Business Rules? Thanks, David

asked Oct 2 by dshortall (80 points)
0 votes
1 answer

is this available yet, will it be available at all. any news on an update for Adaxes, the last one was over a year ago.

asked 6 days ago by i*windows (300 points)
0 votes
1 answer

The rule runs but since the first name and last name are passed as parameters, I only get the sequential # as a userID without the initials.

asked Oct 24 by curtisa (290 points)
0 votes
1 answer

I have tried it using the Custom Commands Action "Add the user to a group", which only allows me to add the user to one group at a time, and can't use the multiple DNs that the ... I can't get it to work. Could you assist me in finding the best way to do this?

asked Jan 16 by dominik.stawny (280 points)
0 votes
1 answer

I added the Password last set field to the Admin view but when I click on edit it allows the admin user to change the value. Adaxes correclty handel Bad Password time and Bad password ... last set, so I guest there is a way but I can not find it. Thanks you

asked Dec 19, 2019 by tomlaf (60 points)
3,585 questions
3,274 answers
8,296 comments
548,044 users