0 votes

I want to check if an alias exists in google via using a GAM command before user creation.

So far Create a "Before User Creation" Business Rule with the condition "If Script Return true" and the the Action "Cancel Operation"

for the script I have the following:

($usercheck = C:\GAM\gam.exe info alias %mail%) 2>&1> $null if ($usercheck -eq " Alias Email: %mail%") {[boolean]$usercheck} else {$usercheck = "" [boolean]$usercheck} When I run the above in PS, the return is the correct one, but does not seem to work once is on the Before User Createion Business Rule. Anybody doing something similar.

by (20 points)

1 Answer

0 votes
by (270k points)

Hello,

What exactly do you mean by does not seem to work? For your information, to specify whether a script condition in Adaxes is met, you need to use the $Contet.ConditionIsMet property. As such, the last line in your script should be as follows:

$Context.ConditionIsMet = $usercheck -eq " Alias Email: %mail%"

Related questions

0 votes
0 answers

I used this script from the repository https://www.adaxes.com/script-repository/check-if-number-of-unused-microsoft-365-licenses-is-below-limit-s594.htm I have amended to include ... count is below what I specify. Please can you advise what I am doing wrong.

asked Jan 31 by MikeBeattie (90 points)
0 votes
1 answer

Is it possible to transliterate the specified first and last name before creating an account so that the correct username, upn etc are formed based on the transliteration?

asked Nov 18, 2022 by Alvares (100 points)
0 votes
1 answer

I've tried the following script to adapt the UPN to the country, the step will be processed in "before user creation" but the UPN stays ... # Save changes $Context.TargetObject.Put("userPrincipalName", $userPrincipalName) $Context.TargetObject.SetInfo()

asked Oct 12, 2022 by boris (450 points)
0 votes
1 answer

Hi, Was wondering if there's a nice way to manually or automatically check if a username or an extension is in use before creating a user? What do other people do? ... in the results, deleting the user and starting again - but would rather the checks first.

asked Feb 25, 2016 by AdamFowlerIT (120 points)
0 votes
1 answer

Hi Team, We are using a set of form/business rules/custom commands for user creation that move user account to the right OU given the Office attribute value. I would ... , but can't find valuable information on the web site. Thanks in advance Regards Stephen

asked Dec 12, 2012 by sroux (800 points)
3,326 questions
3,026 answers
7,727 comments
544,678 users