Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Change all users' UPN using powershell

Posted on 2008-10-29
4
Medium Priority
?
3,680 Views
Last Modified: 2012-06-18
Hello All,

I need to change UPN suffix for all of my users.  I know that I can change one user's UPN using powershell and the Set-mailbox command.  I'm trying to figure out the syntax to do all users.  I wish there was a parameter for just the SUFFIX of the UPN, but I haven't found anything on that.  So, to change all users, I exported them to a csv file and corrected the UPN in that file.  I was going to run the following command to change the UPN, but I'm getting complaints about the the syntax.  

Import-csv c:\users.csv | Set-Mailbox -Identity $_.identity -UserPrincipalName $_.upn

Can someone give me some guidance?  Thanks so much.
FlofromTO
0
Comment
Question by:martinichick
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 18

Expert Comment

by:BSonPosh
ID: 22833306
With the Quest tools you can do this

dl from here www.question.com/powershell


$users = Get-QADuser -size 0
foreach($user in $users)
{
   $UPN = "$($user.sAMAccountName)@new.upn"
   $user | Set-QADUser -UserPrincipalName $UPN
}

Open in new window

0
 
LVL 18

Accepted Solution

by:
BSonPosh earned 750 total points
ID: 22833317
Note... use this command to add the snapin after it is downloaded and installed
add-pssnapin Quest.ActiveRoles.ADManagement
0
 
LVL 1

Expert Comment

by:ntr2def
ID: 34666038
how would I go about setting the upn using a csv file but using the DN rather than the samaccountname as we have multiple domains
0
 

Expert Comment

by:OutdoorResearch
ID: 38096361
Link is broken.
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A couple of months ago we ran into an issue that necessitated re-creating our Edge Subscriptions. However, when we attempted to execute the command: New-EdgeSubscription -filename C:\NewEdgeSub_01.xml we received an error indicating that the LDAP se…
Are you an Exchange administrator employed with an organization? And, have you encountered a corrupt Exchange database due to which you are not able to open its EDB file. This article will explain all the steps to repair corrupt Exchange database.
In this video we show how to create an Address List in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Organization >> Ad…
The basic steps you have just learned will be implemented in this video. The basic steps are shown to configure an Exchange DAG in a live working Exchange Server Environment and manage the same (Exchange Server 2010 Software is used in a Windows Ser…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question