Closed
Description
Using the latest stable release.
Can't seem to get New-MgApplicationOwnerByRef working, I've tried a few solutions but this what i think should be working:
$body = @{
"UserId" = $user.Id
}
New-MgApplicationOwnerByRef -ApplicationId $adApp.Id -BodyParameter $body
Which returns the following error:
New-MgApplicationOwnerByRef : An unexpected 'EndOfInput' node was found when reading from the JSON reader. A 'StartObject' node was expected.
At somefile.ps1:359 char:9
+ New-MgApplicationOwnerByRef -ApplicationId $adApp.Id -BodyPar ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: ({ ApplicationId...ionJsonSchema }:<>f__AnonymousType0`2) [New-MgApplicationOwnerByRef_Create1], RestException`1
+ FullyQualifiedErrorId : Request_BadRequest,Microsoft.Graph.PowerShell.Cmdlets.NewMgApplicationOwnerByRef_Create1