Using Security Groups to Specify Domain

%3CLINGO-SUB%20id%3D%22lingo-sub-307510%22%20slang%3D%22en-US%22%3EUsing%20Security%20Groups%20to%20Specify%20Domain%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-307510%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3CBR%20%2F%3EI%20am%20wondering%20if%20there%20is%20a%20way%20to%20set%20this%20up%20but%20here%20is%20what%20I%20need%20to%20do%3A%3C%2FP%3E%3CP%3EContoso.com%20-%20Default%20Domain%20Name%3C%2FP%3E%3CP%3EContoso.org%20-%20Secondary%20Domain%20Name%3C%2FP%3E%3CP%3EA%20standard%20user%20should%20have%20contoso.com%20domain%20name%2C%20but%20I%20would%20like%20for%20that%20domain%20to%20change%20to%20contoso.org%20somain%20name%20on%20joining%20a%20security%20group.%3C%2FP%3E%3CP%3ESo%20if%20any%20user%20is%20added%20to%20the%20security%20group%20the%20user%20logon%20domain%20name%20will%20change%20to%20contoso.org.%3C%2FP%3E%3CP%3EIf%20possible%20would%20also%20like%20joining%20the%20security%20group%20remove%20the%20contoso.com%20domain%20name%20from%20the%20user.%3C%2FP%3E%3CP%3EBoth%20domains%20are%20under%20the%20same%20directory%20and%20the%20same%20tenant%20in%20Office365.%3C%2FP%3E%3CP%3EYou%20used%20to%20be%20able%20to%20do%20this%20is%20active%20directory%20and%20exchange%20management%20shell%2C%20but%20I%20cant%20find%20the%20feature%20or%20the%20instructions%20to%20do%20it.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETIA%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-307510%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAdmin%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%20Groups%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-307525%22%20slang%3D%22en-US%22%3ERe%3A%20Using%20Security%20Groups%20to%20Specify%20Domain%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-307525%22%20slang%3D%22en-US%22%3EThe%20users%20are%20through%20AzureAD%20and%20Office365%20only.%20I%20might%20be%20implementing%20and%20on-site%20server%20but%20this%20is%20a%20long%20way%20off%20at%20the%20moment.%20So%20is%20it%20the%20UPN%20I%20would%20have%20to%20setup%20to%20be%20changed%3F%20Could%20you%20possibly%20do%20an%20example%20for%20me%20please%20using%20the%20example%20domain%20names%3F%20TIA%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-307514%22%20slang%3D%22en-US%22%3ERe%3A%20Using%20Security%20Groups%20to%20Specify%20Domain%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-307514%22%20slang%3D%22en-US%22%3EThis%20have%20to%20be%20done%20by%20powershell%20and%20running%20that%20script%20on%20a%20scheduled%20basis%20on%20the%20scope%20of%20the%20security%20group!%3CBR%20%2F%3E%3CBR%20%2F%3ESome%20info%20about%20changing%20upn%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fwww.morgantechspace.com%2F2018%2F03%2Fhow-to-change-userprincipalname-of-office-365-user-powershell.html%3Fm%3D1%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.morgantechspace.com%2F2018%2F03%2Fhow-to-change-userprincipalname-of-office-365-user-powershell.html%3Fm%3D1%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3EYou%20also%20need%20to%20remove%20the%20old%20domains%3CBR%20%2F%3E%3CBR%20%2F%3EBtw%3A%20are%20you%20syncing%20these%20users%20with%20adconnect%3F%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

Hi,
I am wondering if there is a way to set this up but here is what I need to do:

Contoso.com - Default Domain Name

Contoso.org - Secondary Domain Name

A standard user should have contoso.com domain name, but I would like for that domain to change to contoso.org 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 contoso.org.

If possible would also like joining the security group remove the contoso.com 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.

 

TIA

2 Replies
Highlighted
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:

https://www.morgantechspace.com/2018/03/how-to-change-userprincipalname-of-office-365-user-powershel...

You also need to remove the old domains

Btw: are you syncing these users with adconnect?
Highlighted
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