0 votes

We found this script for updating group membership by department: http://www.adaxes.com/script-repository ... t-s403.htm

However we would like it to be based off of jobCode instead. Also it is this is a department template, how would we create those?

by (3.2k points)

1 Answer

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

Hello,

You will need to update the following lines:

$departmentProperty = "department"

Replace department with the LDAP name of the property that will be used for the group names template.

$groupNameTemplate = "Department_{0}_"

Replace Department_{0}_ with the required template for group names.

Also you can update warnings depending on the property used for the group names template. For example:
Replace There is no group for department '$department' with There is no group for Job Code '$department'.

0

How do we specify the groupNameTemplates?

0

Hello,

The {0} placeholder in the template will be replaced with the value of the property specified by $departmentProperty. For example: if the template is JobCode_{0} and Job Code is ITStaff, the result will be JobCode_ ITStaff.

0

ok, maybe i mis understood the groupNameTemplate. We have anywhere from 3-33 groups for specific jobCodes. We would like to add and remove them based on the jobCode changing. Would this need to be accomplished through another way?

0

Hello,

Could you specify the relation between groups and Job Codes? Describe the process of adding users to groups in as much detail as you can.

0

We are looking for a way to add several AD groups to a user based on the jobCode being changed. For example:

When we change jobCode 01000 we want the following groups added to the account VPN Users, Internet group and PW group.

We looked at property patterns but did not see a way to add groups, everything else looks like it will change through the property pattern though.

0

Hello,

As a solution we suggest adding all the necessary jobCodes into one of extension attributes (e.g. extensionAttribute1) for each group. PowerShell script will add the user to all groups that have the corresponding jobCode in the extension attribute.

Alternatively, you can enter a list of groups for each jobCode into the script that we will write for you. This solution will require script update each time relations between groups and jobCodes change.

0

Thank you Support2 for the response, what would be the maximum extension attributes allowed? I can envision when i get started on this completed 500 different extension attributes for the various jobCodes we have in the company. There are some overlaps but we will still be north of 250 to start.

0

Hello,

The first 13 extension attributes have a length of 1024 characters, Extension Attributes 14 have 15 have lengths of 2048 characters.

The extension attribute of each group will not need to contain all the Job Codes. You will need to enter only Job Codes of users that should be added to the group.

0

I still don't get how the jobCodes would translate to the necessary groups associated with the jobCode. Do you have sample script i could look at?

0

Hello,

Sorry for the confusion.

You will need to enter the Job Codes to the extension attribute of each group manually.

0

Ok, so if i am reading this correctly. For every group we use we need to add the appropriate job Codes to an attribute on that specific group ID.

We were hoping to be able to add it to a property pattern instead however we dont see the option to add memberOf fields.

0

Hello,

Ok, so if i am reading this correctly. For every group we use we need to add the appropriate job Codes to an attribute on that specific group ID.

Yes, that is correct.

We were hoping to be able to add it to a property pattern instead however we dont see the option to add memberOf fields.

There is no possibility to achieve what you want using property patterns.

Related questions

0 votes
1 answer

Hello, I have 3 groups in my AD environment and want to show all the users that belong to each group. For example - Group 1 Group 2 Group 3 The existing report in the Adaxes ... -Usser D etc. Is there a way to create a report like this? Thank you in advance!

asked Nov 6, 2020 by sirslimjim (480 points)
0 votes
1 answer

Hello, is it possible to update a user attribute (extensionAttribute5) with the name of the group (Name), the user was just added to? Example: In Group A gets a new ... A should be written in the attribute extensionAttribute5 of User A. Can you please help me?

asked Jun 27, 2023 by lohnag (160 points)
0 votes
1 answer

Receive "Index operation failed; the array index evaluated to null. Stack trace: at <ScriptBlock>, <No file>: line 104>" and "Index operation failed; the ... $GroupName, $GroupDN." } } #foreach write-output "" Write-Output "" Stop-Transcript

asked Apr 14, 2022 by jbahou (20 points)
0 votes
1 answer

Update group membership based on one property values. I am trying to find a script that resembles "Update group membership based on two property value" but just for one value.

asked Apr 7, 2022 by lee_thomas (20 points)
0 votes
1 answer

Is it possible with Adaxes to update a distribution groups membership based on the users in an OU? I know this is exactly what a dynamic distribution group is for, but for certain reasons I need this to be a normal distribution group not dynamic.

asked Mar 16, 2015 by yobhod (150 points)
3,351 questions
3,052 answers
7,791 comments
545,091 users