Exchange 2013 error proxy on server

I am attempting to convert some shared mailboxes back to regular and then some to shared. I received this while running the following command

get-content c:\usernames.csv | foreach {set-mailbox -id $_ -type:shared }

Error on proxy command 'Set-Mailbox -Identity:'USERNAME' -Type:'Regular' -Confirm:$False -Force:$True' to server
servername FQDN: Server version 15.00.1130.0000, Proxy method RPS:
The operation couldn't be performed because object 'USER NAME' couldn't be found on 'FQDN AD SERVER'..
    + CategoryInfo          : NotSpecified: (:) [Set-Mailbox], CmdletProxyException
    + FullyQualifiedErrorId : Microsoft.Exchange.Configuration.CmdletProxyException,Microsoft.Exchange.Management.Reci
   pientTasks.SetMailbox
    + PSComputerName        : REMOTESERVERLOGGEDINTOPERFORMING THIS OPERATION
techdriveAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dan McFaddenSystems EngineerCommented:
You need to set the actual -ID in the command... you have set it to "$_"


set-mailbox -id $_ -type:shared

It would be safer to do something like this:

$userslist = Get-Content C:\usernames.csv
foreach($user in $userlist)
{
   set-mailbox -id $user -type:shared
}

Open in new window


Save the above code to a ps1 file and run it from the Exchange Admin PS Console.

Dan
Dan McFaddenSystems EngineerCommented:
If you want some console feedback, I've added a write-host to show which mailbox is being worked on.

$userlist = Get-Content C:\usernames.csv
foreach($user in $userlist)
{
   write-host "Working on Mailbox:  " $user
   set-mailbox -id $user -type:shared
}

Open in new window


PS:  please use this code, there is a typo in the first script I submitted.

Dan
techdriveAuthor Commented:
I wish it was that easy but that does not work. Even if I was to run the command set-mailbox -identity username -type:regular I still get the error. Believe me I wish it was syntax but its not.
Your Guide to Achieving IT Business Success

The IT Service Excellence Tool Kit has best practices to keep your clients happy and business booming. Inside, you’ll find everything you need to increase client satisfaction and retention, become more competitive, and increase your overall success.

Dan McFaddenSystems EngineerCommented:
Can you post some of the contents of your username.csv file?

Dan
techdriveAuthor Commented:
its just the following below in  CSV file. If I am on the server where the user resides this works. If I am on a remote server this does not work and produces the following message I provided earlier. The problem appears to be with the servers ability to proxua


info in the csv file..These are the aliases and like I said it works for some and others this works for.

userone
usertwo
userthree
userfour
Dan McFaddenSystems EngineerCommented:
This appears to be a known issue with a workaround.  Article is posted below.

Link:
- http://blog.skysoft-is.com/?p=270
- http://www.tachytelic.net/2013/10/office-365-convert-shared-mailbox-user-mailbox/?doing_wp_cron=1452870132.5674960613250732421875

Essentially you need to setup a PS Session and specific the target server.  You should be able to run this from any workstation.

As for working for some accounts and not others, do the accounts that the set-mailbox doesn't work for, actually exist?

Dan
Dan McFaddenSystems EngineerCommented:
On the users where the set-mailbox fails, if you run a "Get-ADUser" command... do you get a valid output with AD Object info?

Dan
techdriveAuthor Commented:
Yes I do get valid output.
techdriveAuthor Commented:
Here is the bad part. We are a large environment with over 300 servers. So I would have to run this command for each server correct?
Dan McFaddenSystems EngineerCommented:
No. You run it against the Exchange servers.  You users are in AD nit on each server.  Exchange requires AD to operate.

Run it from 1 exchange server and you should be down.  Unless you have multiple separate Exchange instances.

If you a DAG, run it on 1 if the servers in the DAG.

Dan
Dan McFaddenSystems EngineerCommented:
Down means done.  Sorry for typos... Using my mobile to answer.

Dan

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
techdriveAuthor Commented:
This is a multi-dag environment. I just ran this on a bunch of users using the code on the sites your provided and the only ones it hit was the users who were on the target server. So one thing is I do not have to logon to each server but I do have to remote powershell into them.
Dan McFaddenSystems EngineerCommented:
Ok, then you will have to run the script on a server in each DAG.

Dan
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Exchange

From novice to tech pro — start learning today.