Forum Discussion
AndrewSAIF
May 22, 2020Iron Contributor
Adding multiple domains to RestrictSigninToPattern string
Hello, I am using the RestrictSigninToPattern policy. I recently received a request to add an additional domain to the policy. The example on the https://docs.microsoft.com/en-us/DeployEdge/...
mcnaugha
Sep 01, 2022Copper Contributor
This seems to work for me:
(?:.*@mydomain.com|.*@myschool.sch.uk|.*@other.org.uk|.*@hownowbrowncow.co.uk)
(?:.*@mydomain.com|.*@myschool.sch.uk|.*@other.org.uk|.*@hownowbrowncow.co.uk)
andrewmcn
Sep 05, 2022Copper Contributor
Just to add to this... I had to adapt this to incorporate support for the $ character in our admin usernames and also realised it's case sensitive by default. So, the format changed to this:
(?i:[[:ascii:]]*@mydomain.com|.*@myschool.sch.uk|.*@other.org.uk|[[:ascii:]]*@mytenant.onmicrosoft.com)
In case you didn't know, the "$" has special meaning in regex. So, if we use it then we need to cover it by some other means. So, I had to add in the [[:ascii:]] to get the $ character accepted. Then I realised it's also case sensitive by default. So, needed to add the little i after the ?
(?i:[[:ascii:]]*@mydomain.com|.*@myschool.sch.uk|.*@other.org.uk|[[:ascii:]]*@mytenant.onmicrosoft.com)
In case you didn't know, the "$" has special meaning in regex. So, if we use it then we need to cover it by some other means. So, I had to add in the [[:ascii:]] to get the $ character accepted. Then I realised it's also case sensitive by default. So, needed to add the little i after the ?