0 votes

Hi,

I'd like to implement a rule to ensure that telephoneNumber value is unique accross the domain for each user, either after creation or updates.
I tried to implement a business rule (powershell script) before user update, but the problem is that the telephoneNumber provided thru the %telephoneNumer% token is the old one (before change). How to get the new value in the script ?

Thanks

Stephen

by (800 points)

1 Answer

0 votes
by (18.0k points)

Hello,

At the moment it is possible validate AD object properties using a script only before creation of an object. For details, please see Checking EmployeeID

In a week, we are going to release a minor release that will allow validating object properties before updating objects in AD. As soon as the new version is released, I'll post here instructions on how to do what you need.

0

Thanks you.

I'll be patient :-)

0

Hello,

Yesterday we released Adaxes 2011.2 that allows you to validate user input using scripts.
To validate that the specified telephone number is unique in the directory, you need to create a Business Rule that will be triggered before creation of new users in AD. This Business Rule should execute the following PowerShell script:

Import-Module Adaxes
if ($Context.IsPropertyModified("telephoneNumber"))
{
    # Get the value specified by the user
    $value = $Context.GetModifiedPropertyValue("telephoneNumber");
    # Ensure that the specified phone number is unique
    if ((Get-AdmUser -Filter 'telephoneNumber -eq $value') -ne $NULL)
    {
        $Context.Cancel("A user with the specified telephone number already exists!");
        return;
    }
}

For more details, see Validate/Modify User Input Using a Script.

You can download Adaxes 2011.2 here.

Related questions

0 votes
1 answer

We want to check, if the number of a new team (group) is unique. The number is stored in the attribute "gidNumber". I have a business rule executing before creating ... $NULL) { $Context.Cancel("Ein Team mit dieser Team-Nummer existiert bereits!") return } }

asked Oct 13, 2020 by lohnag (160 points)
0 votes
1 answer

Hello, I have a web service that checks if a user is a member of a group. I am not concerned if they are a direct member or an indirect member of a group, but if the user is in the ... I pass it User A and Group 1. I am using ADSI, c# (.Net 4.0), and WCF.

asked Feb 23, 2014 by mbcalvin (140 points)
0 votes
0 answers

Say you have Manager A that has 30 users under them. Manager A leaves and Manager B takes the position. What is the best way to update all 30 users so their new manager is Manager B.

asked Jun 7, 2021 by Jmbrown04 (60 points)
0 votes
1 answer

So this works for us however we would like to add to check if the last group is at 3 users we would like to send a seperate email but would still like all the above to continue to happen the way it is.

asked Mar 2, 2022 by Keonip (160 points)
0 votes
1 answer

Hi, I need to run a schedule task only if a customattribute is not empty. Can I use ConditionIsMet?

asked Oct 7, 2021 by Simone.Vailati (430 points)
3,347 questions
3,048 answers
7,788 comments
545,036 users