In 2018 the user dongill asked "Is it possible to do a email validation for “Known Guest” account creation in the sponsor portal?
We have a need to prevent sponsors creating guest accounts with their corporate email addresses?"
Jason Kunst crated a script to solve this:
The part Script will allow only the domains ("domain1","domain2","domain3") is functional.
But the part Script will allow all the other domains except the domains("domain1","domain2","domain3") isn't.
The user grabonlee has already pointed this out in the comments and Jason has asked him to open a new one thread.
Because I didn't find such a thread or anything else to solve this problem I asked this again.
How can I ristrict domains for the guest email adress?
Our ISE is version 3.0 Patch 4.
Solved! Go to Solution.
Try changing the line with the regex of Restrict the email address entered when creating a known account as below:
return /^(\w+\.?)+@(domain1|domain2|domain3)\.com$/.test( value );
return /^(\w+\.?)+@((?!(domain[1-3])).)*\.com$/.test( value );
Did you make any other changes to the script?
Do you get errors on the web console? What are the errors?
First at all... Why has anyone marked your post as "Accept as Solution"?
I reversed it.
Of course. Otherwise I couldn't said "The part Script will allow only the domains ("domain1","domain2","domain3") is functional." in my initial description...
- Did you make any other changes to the script?
The only thing I've changed was the entry for "var domains (line 5) and the alert output (line 13).
- Do you get errors on the web console? What are the errors?
I don't get any errors.
If you want people's help - especially with custom scripting / programming - you need to include the HTML+JS code you are using so people can easily try to use it, reproduce your problem, and potentially suggest a fix for the problem you are seeing.