Unable to move bulk users from Skype for business On-Premise to SfB Online

Debmalya Panday 1 Reputation point
2021-02-20T10:36:26.41+00:00

I am trying to move bulk users from SfB On-Premise to SfB-Online using Move-CsUser PowerShell Cmdlet. Below is the code snippet:

$INP = Get-Content -Path <txt file path>

$SESSION = New-CsOnlineSession
Import-PsSession $SESSION -AllowClobber

foreach($USER in $INP)
{
Move-CsUser -Identity $USER -Target 'sipfed.online.lync.com' -ProxyPool 'ProxyPool_FQDN' -UseOAuth -Confirm:$False
}

It works fine for 15-20 users and moves them successfully to SfBOnline however, after that it prompts for Office admin credentials again saying "We couldn't sign you in. Please try again" and doesn't accept the credential anymore. Keeps prompting the same.

NOTE:
• I have followed almost all the possibilities from Technet with no luck.
• Disabled MFA from the global admin Office account - No luck.
• Tried using -UserList parameter to move bulk users - Same issue.

Skype for Business
Skype for Business
A Microsoft communications service that provides communications capabilities across presence, instant messaging, audio/video calling, and an online meeting experience that includes audio, video, and web conferencing.
602 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,354 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Sharon Zhao-MSFT 25,051 Reputation points Microsoft Vendor
    2021-02-22T06:30:36.607+00:00

    @Debmalya Panday ,

    Do you check if you could move users from Skype for Business on-premises to online properly in bulk in Skype for Business Control Panel?

    Could this script work again when you rerun it?

    If every time it can only work fine for 15-20 users, then shows error message, it must be related to your script itself. As we are mainly responsible for general issue of Skype for Business, your script related to development is not in our scope. So, it’s hard for us to provide effective help on script.

    Meanwhile, I found a slightly different script to move users as below. You could modify some parts of your script and check if it could work.

    $cred=Get-Credential  
    $url="https://admin1a.online.lync.com/HostedMigration/hostedmigrationService.svc"  
       
    Move-CsUser -Identity username@contoso.com -Target sipfed.online.lync.com -Credential $cred -HostedMigrationOverrideUrl $url  
    

    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

  2. Marcel de Vries 1 Reputation point
    2021-09-03T13:06:39.497+00:00

    Same issue. The reason it happens is because the move-csuser cmdlet in Skype for Business server logs into AzureAD separately for each user move. I think AzureAD blocks the consequent sign ins after 15-20 times. After a couple minutes it works again, but it's a pain for really big moves. I use basically the same method as OP, see below. I don't know how to get the cmdlet to login only once to AzureAD. Anyone has a suggestion? Is it hard coded in the move-csuser cmdlet in SfB server?

    $url="https://admin1e.online.lync.com/HostedMigration/hostedmigrationService.svc"
    Import-Csv "C:\Users\user\Desktop\MigrateToTeams\siplist.csv" -Header Identity | Foreach-Object {Move-CsUser -Identity $_.identity -Target sipfed.online.lync.com -MoveToTeams -HostedMigrationOverrideUrl $url -useoauth -BypassAudioConferencingCheck -confirm:$false -verbose}

    @Sharon Zhao-MSFT

    0 comments No comments