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 (90 points)

1 Answer

0 votes
by (220k 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 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 4 days ago by will.chc.join (70 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 by jcrook (60 points)
0 votes
1 answer

Hi Is there any possibility to add groups to "Operations" Panel, especially custom commands, in the WebGUI on the user like we can ... Custom Commands Offboarding Offboarding Initiation Offboarding Initiation Fasttrack Notifications Update Mobile Contract

asked Jul 30, 2021 by m.car (80 points)
0 votes
1 answer

Hi there, i've a custom command with multiple powershell scripts (for clearance reasons). If for example the frist script produces an error i Write an Error but the next ... tried with an simple exit 1; I only Write-Errors on issues. Kind regards, Constantin

asked Jul 23, 2021 by Constey (190 points)
2,738 questions
2,473 answers
6,471 comments
1,359,355 users