![]() ![]() The UserPrincipalName is a primary attribute in Active Directory so at the very least, practice on a few test users or even a test Domain so you know exactly what the outcome is going to be. Install-Module -Name Az -Scope CurrentUser -Repository PSGallery -Force. Run the following command from a PowerShell session: PowerShell. This method works the same on Windows, Linux, and macOS platforms. This is the recommended installation scope. Just for good measure, it’s always a good to take an export (backup) of the user’s current settings. Install the Az module for the current user only. ![]() ![]() This will allow us to see how to dynamically query AD users and modify their UPN without too much effort.Īs a reference point, we’ll use Get-ADUser and filter by Organizational Unit so we can scope the target base. Needing to be able to change a single user is great and all, however, what if we needed to change 1,000 users? 10,000 users in bulk? As an exercise, we’ll change the UPN for all users in a specific OU. ![]() Get-ADUser $User | Set-ADUser -UserPrincipalName " $domain"Ĭhange The UserPrincipalName For Bulk Users Get-ADUser $User | select Name, UserPrincipalName #Change UPN for a single user using Powershell Ok now that we got that out of the way, let’s set ourselves up for success and essentially do the same thing using Powershell. Under User Logon Name, click the drop down to specify the UPN suffix.Open Active Directory Users and Computers (ADUC).This article is primarily focused on doing it the “PowerShell” way, but sometimes it’s honestly a lot quicker to do it using the GUI if it’s just a one time thing. In order to get an idea of how the change the UserPrincipalName, let’s run through an example of changing a single user that way you’re not overwhelmed right out of the gate. ![]()
0 Comments
Leave a Reply. |