Using Security Groups to Specify Domain

New Contributor

I am wondering if there is a way to set this up but here is what I need to do: - Default Domain Name - Secondary Domain Name

A standard user should have domain name, but I would like for that domain to change to somain name on joining a security group.

So if any user is added to the security group the user logon domain name will change to

If possible would also like joining the security group remove the domain name from the user.

Both domains are under the same directory and the same tenant in Office365.

You used to be able to do this is active directory and exchange management shell, but I cant find the feature or the instructions to do it.



2 Replies
This have to be done by powershell and running that script on a scheduled basis on the scope of the security group!

Some info about changing upn:

You also need to remove the old domains

Btw: are you syncing these users with adconnect?
The users are through AzureAD and Office365 only. I might be implementing and on-site server but this is a long way off at the moment. So is it the UPN I would have to setup to be changed? Could you possibly do an example for me please using the example domain names? TIA