none
Move user to Skype Online: Index was outside the bounds of the array.

    Question

  • So, I've setup Skype For Business Server with Hybrid config, and everything looks fine.
    However, when I select a user and choose Move selected user to Skype for Business Online, I get this error:

    Index was outside the bounds of the array.

    When I try this PowerShell command, it gives the same error:
    Move-CsUser -Identity <username> -Target sipfed.online.lync.com -Credential $creds -HostedMigrationOverrideUrl https://admin0e.online.lync.com/HostedMigration/hostedmigrationservice.svc

    Move-CsUser : Index was outside the bounds of the array.
    At line:1 char:1
    + Move-CsUser -Identity <username> -Target sipfed.online.lync.com -Credent ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ~~~
        + CategoryInfo          : InvalidOperation: (CN=username..=domain,DC=local:OCSADUser) [Move-CsUser], IndexOutOfRangeException
        + FullyQualifiedErrorId : MoveError,Microsoft.Rtc.Management.AD.Cmdlets.Mo
       veOcsUserCmdlet

    I can't seem to find a single hit on these forums or Google with this error, except for a SQL Server update, but everything is fully up-to-date.

    Regards,
    Marcel

    Tuesday, December 06, 2016 12:48 PM

All replies

  • Fixed it, can't believe this one:

    - Run appwiz.cpl
    - click Microsoft SQL Server 2012 Native Client > click Repair

    Problem solved.

    Tuesday, December 06, 2016 12:59 PM
  • How on earth did you work that out??

    Didn't work for me but will see if Microsoft Update reveals any updates and try those.

    Tuesday, December 06, 2016 5:44 PM
  • Fixed it, can't believe this one:

    - Run appwiz.cpl
    - click Microsoft SQL Server 2012 Native Client > click Repair

    Problem solved.

    Hi MpDay,

    Welcome to our forum.

    Thanks for sharing. We would like to let you make your reply as answer so that someone who has similar issue could find this thread as soon as possible.


    Best Regards,
    Jim Xu
    TechNet Community Support


    Please remember to mark the replies as answers if they helped.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.
    Wednesday, December 07, 2016 6:02 AM
    Moderator
  • This solution did not work for me either. Did you have to log out or restart?
    Wednesday, December 07, 2016 8:32 PM
  • This error persists in my environment following a repair of the SQL 2012 Native Client.


    Jason Hindson

    Wednesday, December 07, 2016 8:59 PM
  • Hi Guys,

    we solved this by checking we had permissions to SQL. The account didn't have SQL admin permissions. We added that and we could move the users fine. Maybe you should check that?

    Dave


    David Hood www.consilium-uk.com

    Friday, December 16, 2016 12:06 PM
  • This error does not appear to be SQL related. To what SQL instance(s) did you grant permissions? This command is to be run from an SfB Online remote session, so I don't think SQL connectivity is required, as I can run this command from a workstation with SfBO tools installed. I'm not seeing the SQL connection here.

    Jason Hindson

    Friday, December 16, 2016 5:31 PM
  • OK mine works now.

    The account that is running the command (i.e. the one logged into the on premises server - or client in your case) 

    a) needs to have sysadmin permissions on the Lync/SfB CMS SQL and

    b) needs to be the same user in the get-credential command

    HTH

    Rick

    Thursday, December 22, 2016 11:34 AM
  • In my case it was due to O365 Licencing -> Skype for Business option was not enabled for this user.

    Check in verbose, the last message before the error is validating

    ------Shell logs----------------------------

    ......

    VERBOSE: Retrieving web ticket URL.
    VERBOSE: Retrieving live id token.
    VERBOSE: Initializing source external move endpoint

    VERBOSE: Validating user [sip:user@contoso.com] online, for on premises to online move.
    Move-CsUser : Index was outside the bounds of the array

    • Proposed as answer by rdegl Thursday, December 29, 2016 7:50 AM
    Thursday, December 29, 2016 7:49 AM
  • We typically see this error shortly after licensing is applied and/or after the Skype for Business on-prem account is created.  If enough time passes, without making any additional changes, Move-CsUser will succeed.  It seems as though it works better if the Skype for Business on-prem account has existed for a while prior to trying Move-CsUser.  Perhaps this needs an ADsync to run with O365 before it will complete successfully.

    I've opened Premier Support tickets with Microsoft regarding this and have been told it is a "transient error", but really have no idea how to get around the error other than waiting.

    • Proposed as answer by EMHooverson Friday, March 31, 2017 3:24 PM
    Friday, March 31, 2017 3:24 PM
  • Hi,
    I got the same error. In my case nothing do with Sql Server. Below troubleshooting solves me.
    1) First verify users to be moved have assigned online license or not. if not make sure user's are assigned license.
    2) Make sure your users are proper while moving online.
    3) Make sure you have proper -HostedMigrationOverrideUrl  mentioned. [Mentioning wrongly this value also cause error], some times this attribute is optional. So you can skip in case if it works for you.

    4) Still if you have issues, you can move one user and see if it works. Try from both powershell and server control panel and then you may narrow down the issue.

    Hope it helps.

    Thanks,

    Ravi

    Saturday, April 01, 2017 12:28 AM
  • I'm still getting this error despite trying all the fixes in this thread.

    Is there anything else I can try? I've also tried patching the Windows 2012R2 Server, Skype for Business Server and SQL 2012/2014 to the latest version on all my S4B servers.


    Wednesday, April 19, 2017 2:51 PM
  • Hi Adam, is it not working for all users or just some?
    Wednesday, April 19, 2017 2:54 PM
  • Hi Rick,

    Thanks for the reply - it's not working for any of the users I've tried to migrate (still to have a successful migration yet) however I haven't tried every user in our pool yet.

    All the users I have tried to migrate have a AAD sync'd account with a Skype for Business license

    Wednesday, April 19, 2017 3:16 PM
  • What user are you using when you do the get-credential? Is it an on prem or onmicrosoft account? It needs to be on prem (see my post regarding SQL permissions).

    Do other commands against SfBO work OK?

    Wednesday, April 19, 2017 3:29 PM
  • I'm using an on prem user account, its a domain admin and csadministrator and have sysadmin on all the SQL instances on the Front End server - We have recently updated our Lync 2013 infrastructure to Skype for Business 2015 and deployed a hybrid set up.

    Other commands seem to work fine using these credentials - is there a particular command I can use to test?


    Wednesday, April 19, 2017 3:58 PM
  • Can only do a summary of all the items in this thread, less the ones you've already covered:

    1. Are you logged into the server with that on prem account as well as using it for Get-Credential?

    2. Have the users definitely got E1/E3 with Skype for Business Online ticked?

    3. Have you tried it in the SfB Control Panel as well as PowerShell?

    4. Have you tried the -verbose switch that rdegl suggests above? Exactly what error do you see?

    5. Have you tried in PS with and without the -HostedMigrationOverrideUrl switch? (The value in the original poster's command might not be exactly correct if you're in a different region to him, that looks right for Europe.)

    6. Are the users enabled in AD and on prem Skype/Lync (I saw this at a customer when some users had been disabled in AD but were still enabled in on prem Lync)?

    Apart from all these checks I'm not sure I'll be able to give more help without seeing the environment.

    Wednesday, April 19, 2017 4:18 PM
  • In my case we had to update Azure AD Connect to the latest version and then run Refresh Directory Schema" from Azure AD Connector Wizard". Also we had one DNS record (sip.domain.com) that needed to be updated too, as it was improperly pointing to Online instead of on-prem. Ensure your DNS records are pointing to your on-prem environment as appropriate. 

    Jason Hindson

    Wednesday, April 19, 2017 4:35 PM
  • 1. I've tried it both with the on prem account (which is a domain admin and CsAdmistrator) as well as the online only global admin account for Office 365. Both give errors, but only the global admin for 365 gives the 'Index was outside the bounds of the array'. The on prem gives 'Failed to connect live id servers'. 

    2. Users definitely have E1 (education) Skype for Business licenses ticked.

    3. Both the control panel and the shell give the same error.

    4. This is the error we get with -verbose:

    VERBOSE: Validating parameters for move operation.
    VERBOSE: Calculating new server information for user [sipfed.online.lync.com].
    VERBOSE: Moving user [*sip:user@domain.com*] across deployments.
    VERBOSE: Initializing source external move endpoint.
    VERBOSE: Creating target external move endpoint.
    VERBOSE: Validating the hosted migration override URL provided:
    [https://admin0e.online.lync.com/HostedMigration/hostedmigrationservice.svc].
    VERBOSE: Retrieving web ticket URL.
    VERBOSE: Retrieving live id token.
    VERBOSE: Initializing source external move endpoint.
    VERBOSE: Validating user [*sip:user@domain.com*] online, for on premises
     to online move.
    Move-CsUser : Index was outside the bounds of the array.

    5. Tried with both https://admin0e.online.lync.com and https://admin0a.online.lync.com but get the 'index array' error still. Also get this error with the switch completely removed.

    6. Users are enabled in AD and on prem S4B. User AD account is a linked master account for a mailbox in Exchange host in a resource forest which has a 'disabled' account in that forest's AD associated with it. Believe this is standard practice though so don't think it would make much difference. This resource forest is the SIP domain.

    We're currently running a refresh of the directory schema from Azure AD Connect (version 1.1.281). It's going to take a bit of time so will see if that makes any difference when it finishes!

    Thanks for all the suggestions.



    Thursday, April 20, 2017 8:52 AM
  • #1 is your issue. You must use the on prem account and it must also be an O365 admin. (As has been stated already!)

    Try that.

    Thursday, April 20, 2017 8:54 AM
  • Ok thanks - I'll give that a try. This domain where the on prem account is located is not sync'd to 365 as it only contains disabled accounts for the linked masters as its used as a resource forest for Exchange/S4B for many other domains.

    I will sync this accout to 365 and give it  global admin rights so it has full access to on prem and 365. Wasn't aware this was the case as with a resource forest its not a given that any accounts from there will be sync'd.

    Thursday, April 20, 2017 9:06 AM
  • As I put on 22/12:

    The account that is running the command (i.e. the one logged into the on premises server - or client [where you are running the commands]) 

    a) needs to have sysadmin permissions on the Lync/SfB CMS SQL and

    b) needs to be the same user in the get-credential command

    You didn't have b) 

    Thursday, April 20, 2017 9:15 AM
  • I've sync'd the on prem account to 365 and gave it Global Administrator privileges. Unfortunately I'm still getting this error when I try to migrate a users to Skype for Business Online using the same account to log into the S4B admin console or in the Get-credential.

    We've also updated the AAD connect application to 1.1.486.


    Friday, April 21, 2017 1:54 PM
  • Sorry to hear you're still having issues.

    Regarding it being a Resource Forest -- have you reviewed this? https://technet.microsoft.com/en-us/library/mt603995.aspx -- there are some special things to do with AADConnect.

    Friday, April 21, 2017 2:18 PM
  • You may try below option

    https://tsoorad.blogspot.com/2017/03/reverse-o365-sfbo-migration-failure.html


    Jayakumar K

    Friday, April 21, 2017 2:33 PM
  • If none of the above has worked for you, one gotcha I've come across on multiple deployments. Make sure that you re-run AAD setup again after you run the following against all cloud based users:

    Enable-CsUser -Identity "<username>" -SipAddress sip:<username>@<domain> HostingProviderProxyFqdn "sipfed.online.lync.com"

    If you don't, you may not be syncing the additional attributes to Azure AD. When you try to move the user, the value for hostingproviderproxyFQDN is not "sipfed.online.lync.com", and the move request will fail with error "Index was outside the bounds of the array".

    Hope this helps.

    Damien

    dmunified.com

    Saturday, May 20, 2017 12:43 AM
  • Hello,

    in my case,when i ran get-cshostingprovider command, the AutodiscoverURL was emtpy.

    After I run:

    Set-CsHostingProvider -Identity lynconline -AutodiscoverUrl https://webdir.online.lync.com/Autodiscover/AutodiscoverService.svc/root

    The user move went without problem.

    Hope it helps

    Sunday, June 25, 2017 4:41 PM