michelderooij / Invoke-Unarchive

Exchange script to move contents back from personal archives to primary mailboxes
https://eightwone.com/2021/08/14/unarchiving-mailbox-items/
MIT License
6 stars 1 forks source link

Credentials Required #1

Closed AlexYoung28 closed 2 years ago

AlexYoung28 commented 2 years ago

Hi, When i try to run this i’m getting

WARNING: Cannot bind to MsgFolderRoot: Exception calling “Bind” with “2” argument(s): “Credentials are required to make a service request.”

I’ve tried using $Credentials= Get-Credential but it doesnt seem to care i’ve applied that. It doesnt like me putting in -Credentials into the script with all the other bits.

.\Invoke-Unarchive.ps1 -Identity Alex@nsmit.biz -Impersonation -Server outlook.office365.com -Secret $mySecret -TenantId $tenantId -ClientId $clientId -Verbose

Am i doing something wrong?

michelderooij commented 2 years ago

Choose authentication method:

  1. When using Basic Authentication, Credentials is required and your tenant needs to have BasicAuth enabled.
  2. For Modern Auth, specifying TenantId, ClientId and one of Secret, CertificateThumbprint or CertificateFile (+optional CertificatePassword) is required for Modern Authentication/OAuth