0 votes

Hey Support,

i hope you can help me with this and how to build it in Adaxes. I want to have a one click action, like a custom command, in the web interface that does the following things:

  • Remove user from (static) group A
  • Add user to (static) group B
  • Update the members dynamic groups C & D

Thanks for your assistance,

Markus

by (130 points)

1 Answer

0 votes
by (294k points)
selected by
Best answer

Hello Markus,

It can be done using a custom command configured for the User object type. The command will have two built-in actions for adding/removing the user from groups and a PowerShell script to force membership update of rule-based groups. The command will look like the below: image.png Here is the script for forcing group membership update. In the script, the $groupDNs variable specifies distinguished names (DNs) of the rule-based groups whose membership update should be forced. For information on how to get an object DN, see https://adaxes.com/sdk/HowDoI.GetDnOfObject.

$groupDNs = @("CN=group1,OU=Groups,DC=domain,DC=com", "CN=group2,OU=Groups,DC=domain,DC=com") # TODO: modify me

foreach($dn in $groupDNs)
{
    $group = $Context.BindToObjectByDN($dn)
    $group.Put("adm-GroupMembershipUpdateNow", $True)
    $group.SetInfo()
}

Related questions

0 votes
1 answer

Would it be possible to update this script to modify three or more attributes based off one? ex. when updating departmentnumber "0666" we want the following attributes to update ... and dept number). http://www.adaxes.com/script-repository ... e-s379.htm

asked Mar 7, 2017 by willy-wally (3.2k points)
0 votes
1 answer

Hi, I'm trying to add an custom command under Actions. While I'm able to add them under UI editor, it is not visible when a user logs into self-service portal. However, other default actions are visible when I toggle them in UI editor.

asked Feb 5 by Renugopal (120 points)
0 votes
1 answer

Hi The Custom Commands edil Box Send more symbols. If type the symbols $ the will output '$ How can I fix it? Input Output

asked May 31, 2022 by will.chc.join (90 points)
0 votes
1 answer

Hi. I am create a Custom Commands. The Custom Commands will run a powshell by user. Is it possible for me to require the user to verify the passwordagain when performing these Custom Commands?

asked May 20, 2022 by will.chc.join (90 points)
0 votes
1 answer

For a custom command, I need to perform some actions, then reboot a computer, then perform some more. How can we handle the reboot so the actions continue once the computer is back up and ready? Thanks

asked May 17, 2022 by jcrook (100 points)
3,589 questions
3,278 answers
8,303 comments
548,107 users