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 (294k 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
1 answer

Hi all, I have a condition during new user creation - Where the corporate email is entered into the email address field, but a custom drop-down for "Mailbox required?" is No. ... screen, and be able to save the result of this choice to a variable? Thanks all,

asked Oct 24 by dshortall (80 points)
0 votes
1 answer

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 (110 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 (550 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)
3,589 questions
3,278 answers
8,303 comments
548,115 users