Haiku #10
The grass is always
Greener in that other pool.
Move-CsUser
According to statistics, the average American moves once every 5 years. As a point of comparison, and counting apartments lived in while going to college, one of the authors of this article estimates that he has lived in 19 different residences in his lifetime. Considering the fact that he isn't 95 years old – not yet, anyway – that means he actually moves more than once every 5 years. In turn, that means he moves more often than the average American.
Note. Which ought to show his co-workers, and co-author, who all consider him to be well below average.
We don't have any statistics showing how often Microsoft Lync Server users move from one Registrar pool to another, although we'd be willing to bet that most users never need to change Registrar pools. Be that as it may, there will likely be times when you have no choice but to switch users from one pool to another. For example, maybe you're decommissioning a pool and need to move all those user accounts elsewhere before taking the pool down. Conversely, a pool might be getting a bit too big, meaning you'll have to create a new pool and move some of the existing users to those new digs. Or maybe – well, it doesn't really matter why you're going to move your users, what really matters is how you're going to move those users. And when it comes to moving users, we suggest you rely on the Move-CsUser cmdlet.
Note. Yes, that's mainly because Move-CsUser provides a fast and easy way to move user accounts. On top of that, however, we did mention Move-CsUser in today's haiku, which would have left us looking pretty silly if we didn't recommend the cmdlet as a good way to move users.
OK, so how do you move a user using the Move-CsUser cmdlet? Why, like this, of course:
Move-CsUser -Identity "Pilar Ackerman" -Target "atl-cs-001.litwareinc.com"
As you can see, there's nothing too terribly hard about all this. We simply call the cmdlet, taking care to: 1) specify the Identity of the user account to be moved; and, 2) specify the Registrar pool (Target) we want the account moved to. That's pretty much all there is to it.
Of course, if you want to really have some fun, you can also use Move-CsUser to move multiple users, all at the same time. Remember that one scenario we posed, the one where you're decommissioning a pool and need to move all the existing user accounts to a different pool? Well, here's a command that moves all the users from the pool atl-cs-001.litwareinc.com to the pool redmond-cs-001.litwareinc.com:
Get-CsUser –Filter {RegistrarPool –eq "atl-cs-001.litwareinc.com"} | Move-CsUser -Identity "Pilar Ackerman" -Target "redmond-cs-001.litwareinc.com"
All we're doing with that command is calling the Get-CsUser cmdlet, along with the Filter parameter, to return all the user accounts that have a RegistrarPool property equal to atl-cs-001.litwareinc.com. We then pipe that entire collection of users to Move-CsUser, which proceeds to switch all the accounts in that collection to the pool redmond-cs-001.litwareinc.com.
You know, now that we see how much fun this really is, we'll probably be moving user accounts way more often than just once every 5 years.
Incidentally, Move-CsUser is also the cmdlet to use if you ever need to move a user from a Microsoft Lync Server 2010 Registrar pool back to an Office Communications Server pool. And yes, come to think of it, that would be a bit like playing for the New York Yankees and then being moved to their Triple A farm team in Scranton/Wilkes Barre.
Or, even worse, being moved to the Seattle Mariners.
Note. Speaking of the Seattle Mariners, they announced today that they have re-signed pitcher Eric Bedard for the upcoming season. Over the past 3 years, Bedard has been paid around $16 million, and has won a grand total of 11 games. To put that in perspective, that's only 11 more wins than the authors of today's article have had in the past 3 seasons.
And they didn't make anywhere near $16 million. (There isn't as much money in writing Lync Server PowerShell haikus as you might think.)
Oh, and if you need to move a user from Office Communications Server to Microsoft Lync Server (yes: the big leagues!) then don't use Move-CsUser; instead, use the Move-CsLegacyUser cmdlet. But because we haven't written a Move-CsLegacyUser haiku yet, we won't even mention that.
Update: As it turns out, we now have written a Move-CsLegacyUser haiku.