0 votes

We have a need to set a group that is not domain users as the primary group. Is there an action we can do on a selected user to check the group we want as the primary group to that selected group?

by (3.2k points)

1 Answer

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

Hello,

You can do this by modifying the Primary Group ID property of a user. For this purpose you can create a Custom Command that will update the property with the Primary Group Token of the required group. To get the token and create the Custom Command:

  1. Launch Adaxes Administration Console.
  2. Navigate to and select the group.
  3. Enable showing Advanced Properties. For details, see http://www.adaxes.com/help/?HowDoI.Mana ... rties.html.
  4. Copy the value of the Primary Group Token property.
  5. Right-click your Adaxes service node, navigate to New and click Custom Command.
  6. On step 2 of the Create Custom Command wizard, select User Object type and click Next.
  7. Click Add Action.
  8. Select Add the User to a group and click Select Group.
  9. Select the group the token of which you copied and click OK twice.
  10. Double-click Always.
  11. Select If is a member of <Group>.
  12. Select if is not and click Select Group.
  13. Select the group the token of which you copied and click OK twice.
  14. Click Add action to a new set.
  15. Select Update the User and click Add.
  16. In the Property to modify drop-down list, select Primary Group ID.
  17. Paste the Primary Group Token into the New value field and click OK twice.
  18. Click Next and finish creating the Custom Command.
0

If i read the solution properly, we would have to have a specific group set in the Custom Command, is that correct? If so, we would like to have solution that we can add any group to an account and make it the primary group as you can with ADuC or ADaC.

0

Hello,

The solution will include a Home Page action and a Business Rule triggering After Updating a User. The action will be used to specify a group that will be made primary for the user in the Assistant property. The Business Rule will run a script to add the user to the specified group, make it primary for the user and clear the Assistant property in the user account.

i. Creating the Home Page Action.

  1. Launch Adaxes Web Interface Customization Tool.
  2. Select the interface type and click Configure Home Page Actions on the General tab.
  3. Click Add and select Modify User action.
  4. On step 2 of the wizard, define the conditions for selecting the user to be modified and click Next.
  5. Select Use customized form and click Customize Form.
  6. Delete all the sections except for one (e.g. General).
  7. Delete all the properties from the section and click Add below Section fields.
  8. Double-click the Assistant property.
  9. Select Show only the following object types.
  10. Select Security Groups and click OK three times.

ii. Creating the Business Rule triggering After Updating a User

  1. Launch Adaxes Administration Console.

  2. Right-click your Adaxes service node, navigate to New and click Business Rule.

  3. On step 2 of the Create Business Rule wizard, select User Object type.

  4. Select After Updating a User and click Next.

  5. Click Add Action and select Run a program or PowerShell script.

  6. Paste the script below into the Script field.

     $group = $Context.BindToObjectByDN("%assistant%")
     $groupToken = $group.Get("primaryGroupToken")
    
     if ("%primaryGroupID%" -eq $groupToken)
     {
         return
     }
    
     if (-not($group.IsMember($Context.TargetObject.AdsPath)))
     {
         $group.Add($Context.TargetObject.AdsPath)
     }
    
     $Context.TargetObject.Put("primaryGroupID", $groupToken)
     $Context.TargetObject.Put("secretary", $NULL)
     $Context.TargetObject.SetInfo()
  7. Enter a short description and click OK.

  8. Right-click the action and click Add Condition.

  9. Select If <property> changed.

  10. Select If Assistant has changed and click OK.

  11. Right-click the action and click Add Condition again.

  12. Select If <property><relation><value>.

  13. Select If Assistant is not empty and click OK.

  14. Click Next and finish creating the Business Rule. You should have something like the following:

Related questions

0 votes
1 answer

I have a need to remove certain users from "Domain Users" and set their primary group to a custom one. I can't seem to find anyway in Adaxes to set a primary group. ... 't remove the user from their primary group. Running on 2011.1 trial version at the moment.

asked Apr 26, 2011 by Rojs (90 points)
0 votes
1 answer

I need set, or verify, that all of my users have the same primary email alias suffix. Several years ago, we rebranded to a new internet presence. All users yhave both ... really a very great answer. Looking for automation, and we are an Adaxes supported shop.

asked May 14, 2021 by IanMcLaws (20 points)
0 votes
1 answer

Hi, we need to create some form (or custom command?) so managers of distribution groups can add/remove/change alias address. Primary and secondary. Distribution groups are ... contains list of current aliases with possibility to edit them... Thank you Sebela

asked Nov 18, 2019 by KIT (520 points)
0 votes
1 answer

Hi, I came across this in the SDK for setting the OU in a Business Rule before object creation $destOU = $Context.Action.TargetContainer if ($destOU.AdsPath.Contains("Marketing ... OU before creation, rather than create it then move, is there a way? Thanks,

asked Apr 25, 2014 by dazbo (390 points)
0 votes
1 answer

We have the following script we need fixed to run within Adaxes to add true/false value to a customattribute for use in building dynamic distribution lists. $users = ... } else { Set-Mailbox -Identity $user.Name -CustomAttribute8 "Individual contributor" } }

asked Jul 13 by willy-wally (3.2k points)
2,803 questions
2,535 answers
6,605 comments
62,199 users