Error using New-MgPolicyCrossTenantAccessPolicyPartner #3320
Labels
no-recent-activity
status:waiting-for-author-feedback
Issue that we've responded but needs author feedback to close
type:bug
A broken experience
Describe the bug
I am trying to create a new "Cross Tenant Access Policy Partner".
We have built scripting for this which we have been using for a bout a year now and on which we saw an unexpected failure starting some weeks ago. The script uses
New-MgPolicyCrossTenantAccessPolicyPartner
at its core. The error text mentionsInvalid property 'b2BDirectConnectInbound'
.It turns out that the example on your MS Learn page for this cmdlet gives the same error, so I will use that as example.
Expected behavior
A new partner configuration in a cross-tenant access policy is created.
How to reproduce
is expected to create a new partner configuration, but instead gives an error:
SDK Version
7.5.1
Latest version known to work for scenario above?
Unknown
Known Workarounds
None (create manually)
Debug output
Click to expand log
```Confirm
Are you sure you want to perform this action?
Performing the operation "New-MgPolicyCrossTenantAccessPolicyPartner_Create" on target "Call remote 'POST
/policies/crossTenantAccessPolicy/partners' operation".
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): a
DEBUG: ============================ HTTP REQUEST ============================
HTTP Method:
POST
Absolute Uri:
https://graph.microsoft.com/v1.0/policies/crossTenantAccessPolicy/partners
Headers:
FeatureFlag : 00000003
Cache-Control : no-store, no-cache
User-Agent : Mozilla/5.0,(Windows NT 10.0; Microsoft Windows 10.0.22631; en-NL),PowerShell/2025.0.0
SdkVersion : graph-powershell/2.27.0
client-request-id : 609d7952-b795-4417-a495-d9e32fe7db0b
Accept-Encoding : gzip,deflate,br
Body:
{
"tenantId": "3d0f5dec-5d3d-455c-8016-e2af1ae4d31a",
"b2BDirectConnectInbound": {
"applications": {
"accessType": "allowed",
"targets": [
{
"target": "Office365",
"targetType": "application"
}
]
}
},
"b2BDirectConnectOutbound": {
"usersAndGroups": {
"accessType": "blocked",
"targets": [
{
"target": "6f546279-4da5-4b53-a095-09ea0cef9971",
"targetType": "group"
}
]
}
}
}
DEBUG: ============================ HTTP RESPONSE ============================
Status Code:
BadRequest
Headers:
Cache-Control : no-cache
Vary : Accept-Encoding
Strict-Transport-Security : max-age=31536000
request-id : 7d9535da-4800-428f-a206-c62b7c9a72ae
client-request-id : 609d7952-b795-4417-a495-d9e32fe7db0b
x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"West Europe","Slice":"E","Ring":"5","ScaleUnit":"007","RoleInstance":"AM4PEPF0004390C"}}
x-ms-resource-unit : 1
Date : Tue, 13 May 2025 06:44:52 GMT
Body:
{
"error": {
"code": "Request_BadRequest",
"message": "Invalid property 'b2BDirectConnectInbound'.",
"innerError": {
"date": "2025-05-13T06:44:52",
"request-id": "7d9535da-4800-428f-a206-c62b7c9a72ae",
"client-request-id": "609d7952-b795-4417-a495-d9e32fe7db0b"
}
}
}
New-MgPolicyCrossTenantAccessPolicyPartner_Create: Invalid property 'b2BDirectConnectInbound'.
Status: 400 (BadRequest)
ErrorCode: Request_BadRequest
Date: 2025-05-13T06:44:52
Headers:
Cache-Control : no-cache
Vary : Accept-Encoding
Strict-Transport-Security : max-age=31536000
request-id : 7d9535da-4800-428f-a206-c62b7c9a72ae
client-request-id : 609d7952-b795-4417-a495-d9e32fe7db0b
x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"West Europe","Slice":"E","Ring":"5","ScaleUnit":"007","RoleInstance":"AM4PEPF0004390C"}}
x-ms-resource-unit : 1
Date : Tue, 13 May 2025 06:44:52 GMT
Recommendation: See service error codes: https://learn.microsoft.com/graph/errors
DEBUG: [CmdletEndProcessing]: - New-MgPolicyCrossTenantAccessPolicyPartner end processing.
The text was updated successfully, but these errors were encountered: