locked
Moving users to O365 - logon failed RRS feed

  • Question

  • Not sure what I am doing wrong, but I cannot seem to move a S4b user from on-premise to O365.

    I am using powershell and I can establish the session to 0365 and run commands in the session, but whenever I try to move a user I get the following error.

    Move-CsUser : Failed to logon with given credentials. Make sure correct user name and password provided.

    If I log into the O365 admin portal with this account It is OK.  This is an AD synced account and is a Global admin on O365.  I am supplying creds via the Get-Credential cmdlet 

    We do have a SSO enabled with OneLogin and when we log in via the web we get redirected to OneLogin page for credentials.

    This account is a RTCUniversal admin in our on-prem AD as well.

    Any ideas would be appreciated.

    Tuesday, August 22, 2017 11:40 PM

All replies

  • UPDATE: I created an account in O365 that is cloud only (not AD synced) and made them a global admin. This account is able to move the user.  My AD synced account (which is also a global admin) still gets the login failure message when attempting to move a user.  I can run other commands in the skypeonlineconnector with the AD account so I don't think credentials are the issue.
    Wednesday, August 23, 2017 5:02 PM
  • Is MFA enabled on your synced account?  This may be getting in the way if so.

    Please remember, if you see a post that helped you please click "Vote" on the left side of the response, and if it answered your question please click "Mark As Answer". SWC Unified Communications This forum post is based upon my personal experience and does not necessarily reflect the opinion or view of Microsoft, SWC, their employees, or other MVPs.

    • Proposed as answer by Alice-Wang Thursday, August 24, 2017 6:49 AM
    Wednesday, August 23, 2017 5:34 PM
  • Hi Dave,

    I have seen similar situation, the issue caused by that when the PowerShell command, they don’t run as administrator, after run as administrator, the issue resolved, so please make sure you have run as administrator

    As a supplement, please refer to the following document check the steps migrating to SFB online
    https://technet.microsoft.com/en-us/library/jj204969.aspx


    Regards,

    Alice Wang


    Please remember to mark the replies as an answers if they help and unmark them if they provide no help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Thursday, August 24, 2017 7:49 AM
  • Thanks for idea. Unfortunately run as administrator didn't help. I have a work around in place using the O365 only account right now.

    I would not be surprised if this has something to do with OneLogin.  Whenever we log in via the web, it redirects us to our OneLogin page to complete authorization.  It does this based on our domain name in our UPN.  Although, I am able to run get-cs*** commands.


    Thursday, August 24, 2017 4:33 PM
  • I think you're right, it's likely an auth issue not a permissions issue.  MFA can get in the way but so can other third party auth scenarios.  

    This is AWFUL security, and I don't recommend it, but if you have to perform this task repeatedly and using that account is annoying, you can hardcode the creds into PowerShell.

    https://social.technet.microsoft.com/wiki/contents/articles/4546.working-with-passwords-secure-strings-and-credentials-in-windows-powershell.aspx

    $SecureStringAsPlainText="0838abdbbf435692838abdbbf435692838abdbbf435692838abdbbf435692838abdbbf4356922"

    $SecurePassword = $SecureStringAsPlainText  | ConvertTo-SecureString

    $Username = "tempadmin@domain.onmicrosoft.com"

    $Credentials = New-Object System.Management.Automation.PSCredential -ArgumentList $UserName, $SecurePassword

    Import-Module SkypeOnlineConnector

    $CSSession = New-CSOnlineSession -Credential $Credentials

    Import-PSSession $CSSession -AllowClobber



    Please remember, if you see a post that helped you please click "Vote" on the left side of the response, and if it answered your question please click "Mark As Answer". SWC Unified Communications This forum post is based upon my personal experience and does not necessarily reflect the opinion or view of Microsoft, SWC, their employees, or other MVPs.

    • Proposed as answer by Alice-Wang Friday, August 25, 2017 4:12 AM
    Thursday, August 24, 2017 5:26 PM