Your error message doesn't say which cmdlet produced the error.
Start with something simple. Does this work?
$upn="firstname.LastName@domain.com"
Get-RemoteMailbox $UPN
If it does, try this:
$upn="firstname.LastName@domain.com"
$m = Get-RemoteMailbox $UPN
Enable-RemoteMailbox -Identity $m.distinguishename -Archive
I can find instances of this problem for SharePoint, but not for Exchange.