I'm following tutorial and succesfully run the convert from EntryId to EwsId, using either EWS or GraphAPI (result is the same).
But the problem is that while I can convert from EntryId to RestId and find it back with Graph, converting from EntryId to EwsId and then Binding gives the error "This protocol does not support ImmutableIds".
$64decoded = [System.BitConverter]::ToString([System.Convert]::FromBase64String($ItemId)).Replace("-", "")
write-host $64decoded
$HexId = new-object Microsoft.Exchange.WebServices.Data.AlternateId([Microsoft.Exchange.WebServices.Data.IdFormat]::HexEntryId, $64decoded, $email)
$Converted = $service.ConvertId($HexId, [Microsoft.Exchange.WebServices.Data.IdFormat]::EwsId)
$idObject = new-object Microsoft.Exchange.WebServices.Data.ItemId($Converted.UniqueId)
Or with Graph using the library:
$sourceID = ($sourceId -replace "\+","-") -replace "/","_"
$countToReplace = ($sourceID.ToCharArray() | ? {$_ -eq "="}).Count
$sourceID = $sourceID.TrimEnd("=") + $countToReplace
$body = @{
"inputIds"= @($sourceID)
"sourceIdType"= "entryId"
"targetIdType"= "$TargetFormat"
} | ConvertTo-Json
$ConvertResult = Invoke-MgTranslateUserExchangeId -UserId $UserId -BodyParameter $body
Definitely the result is not an EWSID, it looks like that:
- SourceId: AAAAAB2EAx########################################gAAKDC/7wAAA==
- TargetId: AAkALg#############################################i8zOVOAAAAAe9FwAA
What am I missing?
Thank you
EDIT:
Following exactly this blog commands, here are the output from the first line ID:
https://www.michev.info/blog/post/2744/converting-item-and-folder-ids-via-the-graph-api
As we can see, the EWSId does not look at all like a full EWS Id. I even specied IsArchive = $true on the $aiItem.

From what you posted in the result anything starting with AAkALg is a immutableId https://learn.microsoft.com/en-us/graph/outlook-immutable-id the "AAkALg" decodes to a Flag that tells Exchange this which is why it's the same on every request. You should be able to take that Id and then translate it to a ewsid eg
There where previously bugs in Invoke-MgTranslateUserExchangeId so i would probably try using Invoke-MgGraphRequest to see if you get a different result eg