Recently experienced an issue where a client has a hybrid Lync 2013 on premise deployment integrated with Office 365 Lync Online. Some of the users are able to be moved successfully from Lync Online to On Premise with the following commands:
Import-Module LyncOnlineConnector
$cred = Get-Credential
$CSSession = New-CsOnlineSession -Credential $cred
Import-PSSession $CSsession -AllowClobber
Move-CsUser -Identity <username>@domain.com -Target "<fe-pool>.domain.com" -Credential $cred -HostedMigrationOverrideURL <URL>
The users that could not be moved had the following errors:
Enable-CsUser : Cannot move legacy user in enable operation. Use the Move user
cmdlet instead.
At line:1 char:14
+ enable-csuser <<<< -identity domain.local\dtrott -registrarpool lyncpool01.ccs.in
t -sipaddresstype samaccountname -sipdomain domain.com
+ CategoryInfo : InvalidOperation: (:) [Enable-CsUser], InvalidOp
erationException
+ FullyQualifiedErrorId : ProcessRecord,Microsoft.Rtc.Management.AD.Cmdlet
s.EnableOcsUserCmdlet
Move-CsUser : Cannot move users from pools running earlier versions. Use Move-CsLegacyUser cmdlet instead.
At line:1 char:2
+ Move-CsUser -Identity <NAME> -Target <FEPool.domain.com> -Credential $ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (CN=OCSADUser) [Move-CsUser], LegacyPoo
lException
+ FullyQualifiedErrorId : MoveError,Microsoft.Rtc.Management.AD.Cmdlets.MoveOcsUserCmdlet
The root cause was improperly set AD attributes. This ARTICLE by Terence Luk describes the fix, which is summarized below:
Open up adsiedit.msc, navigate to the user's object, open the properties, and removing or setting the following attributes to "<not set>" and "0":
- msRTCSIP-ArchivingEnabled
- msRTCSIP-FederationEnabled
- msRTCSIP-InternetAccessEnabled
- msRTCSIP-OptionFlags
- msRTCSIP-PrimaryHomeServer
- msRTCSIP-PrimaryUserAddress
- msRTCSIP-UserEnabled
Here's an example of a user who still had legacy OCS attributes populated for their account:
Here's an example of a user account that had the legacy OCS attributes removed: