none
Set-userphoto with MFA enabled

    Question

  • Hi

    Has anyone had any success using the Set-userphoto command to upload photos for user accounts when the admin account is configured to use MFA? 

    This KB mentions changing the connection URI to include a /?proxymethod=rps but this isn't relevant when using the MFA aware Exchange online PowerShell addins. 

    https://support.microsoft.com/en-us/help/3062745/user-photos-aren-t-synced-from-the-on-premises-environment-to-exchange

    I've managed to upload small photos (<10 KB) using the Azure AD Connector but these are high enough resolution when used with Skype for Business so we need to upload some larger photos. The only method I've found so far is to use the set-userphoto cmdlet I get "Error on proxy comand" returned when I attempt to run the command. Everything I've read to date mentions using the /?proxymethod=rps value in the URI.


    Thanks

     

    Friday, July 14, 2017 4:04 PM

All replies

  • Hi

    Has anyone had any success using the Set-userphoto command to upload photos for user accounts when the admin account is configured to use MFA? 

    This KB mentions changing the connection URI to include a /?proxymethod=rps but this isn't relevant when using the MFA aware Exchange online PowerShell addins. 

    https://support.microsoft.com/en-us/help/3062745/user-photos-aren-t-synced-from-the-on-premises-environment-to-exchange

    I've managed to upload small photos (<10 KB) using the Azure AD Connector but these are high enough resolution when used with Skype for Business so we need to upload some larger photos. The only method I've found so far is to use the set-userphoto cmdlet I get "Error on proxy comand" returned when I attempt to run the command. Everything I've read to date mentions using the /?proxymethod=rps value in the URI.


    Thanks

     

    Interesting. Perhaps use another admin account not enabled for MFA in the mean time?

    Friday, July 14, 2017 6:34 PM
    Moderator
  • Hi

    Has anyone had any success using the Set-userphoto command to upload photos for user accounts when the admin account is configured to use MFA? 

    This KB mentions changing the connection URI to include a /?proxymethod=rps but this isn't relevant when using the MFA aware Exchange online PowerShell addins. 

    https://support.microsoft.com/en-us/help/3062745/user-photos-aren-t-synced-from-the-on-premises-environment-to-exchange

    I've managed to upload small photos (<10 KB) using the Azure AD Connector but these are high enough resolution when used with Skype for Business so we need to upload some larger photos. The only method I've found so far is to use the set-userphoto cmdlet I get "Error on proxy comand" returned when I attempt to run the command. Everything I've read to date mentions using the /?proxymethod=rps value in the URI.


    Thanks

     

    Interesting. Perhaps use another admin account not enabled for MFA in the mean time?

    Yes, certainly an option but it goes against our security principals. Perhaps I can limit the account to just the photo attributes. 

    Monday, July 17, 2017 7:07 AM
  • Did you ever figure this out?  I have the same issue.  Thanks!
    Friday, November 3, 2017 1:49 PM
  • Hi

    Has anyone had any success using the Set-userphoto command to upload photos for user accounts when the admin account is configured to use MFA? 

    This KB mentions changing the connection URI to include a /?proxymethod=rps but this isn't relevant when using the MFA aware Exchange online PowerShell addins. 

    https://support.microsoft.com/en-us/help/3062745/user-photos-aren-t-synced-from-the-on-premises-environment-to-exchange

    I've managed to upload small photos (<10 KB) using the Azure AD Connector but these are high enough resolution when used with Skype for Business so we need to upload some larger photos. The only method I've found so far is to use the set-userphoto cmdlet I get "Error on proxy comand" returned when I attempt to run the command. Everything I've read to date mentions using the /?proxymethod=rps value in the URI.


    Thanks

     

    I got a similar proxy issue when I had forgotten to start powershell / ISE as admin.  It doesn't have enough permissions with a non-admin session to create that kind of session.
    Tuesday, November 21, 2017 3:35 PM
  • Not sure if this is an issue still but I found by adding the ConnectionUri from MSOnline let me upload photos.  Run powershell as admin and use these lines.  I put them in a PS1 file and just run that to connect.  (These lines don't require the Exchange Online Powershell shortcut, just run normal powershell).

    Import-Module $((Get-ChildItem -Path $($env:LOCALAPPDATA+"\Apps\2.0\") -Filter Microsoft.Exchange.Management.ExoPowershellModule.dll -Recurse ).FullName|?{$_ -notmatch "_none_"}|select -First 1)
    $EXOSession = New-ExoPSSession -ConnectionUri https://outlook.office365.com/powershell-liveid/?proxymethod=rps
    Import-PSSession $EXOSession



    • Edited by JeffApex Tuesday, February 13, 2018 11:54 PM
    • Proposed as answer by ThomMck Thursday, July 12, 2018 8:26 PM
    Tuesday, February 13, 2018 11:51 PM
  • Hello This is the method,

    Login Exchange online --> Select Hybrid --> Use Exchange online Powershell Modules to login Exchange online MFA enabled admin account..

    But normally you access O365 via poweshell login it prompt MFA as well user name and PW.

    Wednesday, February 14, 2018 7:38 AM
  • I can confirm this worked for me too.

    We have all our mailboxes online but all admins must use MFA. The bit I was missing was where to add

    -ConnectionUri https://outlook.office365.com/powershell-liveid/?proxymethod=rps

    Thanks @JeffApex!


    Thom McKiernan (UK) @thommck | thommck.wordpress.com | MCSA | MCTS

    Thursday, July 12, 2018 8:27 PM