You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Confirm
Are you sure you want to perform this action?
Performing the operation "New-MgBetaDirectorySetting_CreateExpanded" on target "Call remote 'POST /settings' operation".
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): A
============================ HTTP REQUEST ============================
Describe the bug
Trying to create a new Password Rule Directory Settings :
This gives the error:
This code works since years.
Expected behavior
The directory setting should be created
How to reproduce
Run above code
SDK Version
Microsoft.Graph.Authentication 2.26.1 and Microsoft.Graph.Beta.Identity.DirectoryManagement 2.26.1
Latest version known to work for scenario above?
2.25.X
Known Workarounds
None known
Debug output
Click to expand log
``` [DBG]: PS D:\Repos\PFIBDO-ADM-CloudConfiguration> New-MgBetaDirectorySetting -DisplayName "Password Rule Settings" -TemplateId $SettingTemplate.Id -Values $Values -Debug [CmdletBeginProcessing]: - New-MgBetaDirectorySetting begin processing with parameterSet 'CreateExpanded'. [Authentication]: - AuthType: 'Delegated', TokenCredentialType: 'InteractiveBrowser', ContextScope: 'CurrentUser', AppName: 'Microsoft Graph Command Line Tools'. [Authentication]: - Scopes: [Application.ReadWrite.All, AppRoleAssignment.ReadWrite.All, AuditLog.Read.All, ChannelMessage.Send, Contacts.Read, CrossTenantInformation.ReadBasic.All, DelegatedPermissionGrant.ReadWrite.All, DeviceManagementApps.Read.All, DeviceManagementApps.ReadWrite.All, DeviceManagementConfiguration.Read.All, DeviceManagementConfiguration.ReadWrite.All, DeviceManagementManagedDevices.Read.All, DeviceManagementManagedDevices.ReadWrite.All, DeviceManagementRBAC.Read.All, DeviceManagementServiceConfig.Read.All, DeviceManagementServiceConfig.ReadWrite.All, Directory.AccessAsUser.All, Directory.Read.All, Directory.ReadWrite.All, Domain.ReadWrite.All, email, Group.ReadWrite.All, GroupMember.ReadWrite.All, openid, Organization.ReadWrite.All, OrganizationalBranding.ReadWrite.All, Policy.Read.All, Policy.ReadWrite.AuthenticationMethod, Policy.ReadWrite.Authorization, Policy.ReadWrite.ConditionalAccess, Policy.ReadWrite.CrossTenantAccess, Policy.ReadWrite.DeviceConfiguration, Policy.ReadWrite.PermissionGrant, profile, RoleAssignmentSchedule.ReadWrite.Directory, RoleEligibilitySchedule.Read.Directory, RoleEligibilitySchedule.ReadWrite.Directory, RoleManagement.Read.All, RoleManagement.ReadWrite.Directory, SharePointTenantSettings.ReadWrite.All, TeamMember.ReadWrite.All, TeamsApp.ReadWrite.All, TeamsAppInstallation.ReadWriteForTeam, TeamsAppInstallation.ReadWriteSelfForTeam, TeamSettings.ReadWrite.All, TeamsTab.ReadWrite.All, User.Read.All, User.ReadWrite.All, UserAuthenticationMethod.Read.All, UserAuthenticationMethod.ReadWrite.All, WindowsUpdates.ReadWrite.All].Confirm
Are you sure you want to perform this action?
Performing the operation "New-MgBetaDirectorySetting_CreateExpanded" on target "Call remote 'POST /settings' operation".
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): A
============================ HTTP REQUEST ============================
HTTP Method:
POST
Absolute Uri:
https://graph.microsoft.com/beta/settings
Headers:
FeatureFlag : 00000003
Cache-Control : no-store, no-cache
User-Agent : Mozilla/5.0,(Windows NT 10.0; Microsoft Windows 10.0.26100; de-CH),PowerShell/2025.0.0
SdkVersion : graph-powershell-beta/2.26.1
client-request-id : bdeb9ef0-fa7d-49f5-826a-7640057b3884
Accept-Encoding : gzip,deflate,br
Body:
{
"displayName": "Password Rule Settings",
"templateId": "5cf42378-d67d-4f36-ba46-e8b86229381d",
"values": [
{
"name": "BannedPasswordCheckOnPremisesMode",
"value": "Audit"
},
{
"name": "EnableBannedPasswordCheckOnPremises",
"value": true
},
{
"name": "EnableBannedPasswordCheck",
"value": true
},
{
"name": "LockoutDurationInSeconds",
"value": 60
},
{
"name": "LockoutThreshold",
"value": 10
},
{
"name": "BannedPasswordList",
"value": ""
}
]
}
============================ HTTP RESPONSE ============================
Status Code:
BadRequest
Headers:
Cache-Control : no-cache
Vary : Accept-Encoding
Strict-Transport-Security : max-age=31536000
request-id : 03f53341-d485-4054-beae-938f0cbca8a6
client-request-id : bdeb9ef0-fa7d-49f5-826a-7640057b3884
x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"Switzerland North","Slice":"E","Ring":"3","ScaleUnit":"001","RoleInstance":"ZRH2EPF000000E0"}}
x-ms-resource-unit : 1
Date : Fri, 28 Feb 2025 17:47:11 GMT
Body:
{
"error": {
"code": "Request_BadRequest",
"message": "Cannot convert the literal 'True' to the expected type 'Edm.String'.",
"innerError": {
"date": "2025-02-28T17:47:12",
"request-id": "03f53341-d485-4054-beae-938f0cbca8a6",
"client-request-id": "bdeb9ef0-fa7d-49f5-826a-7640057b3884"
}
}
}
New-MgBetaDirectorySetting_CreateExpanded: D:\WindowsPowerShell\Modules\Microsoft.Graph.Beta.Identity.DirectoryManagement\2.26.1\exports\ProxyCmdletDefinitions.ps1:104703:23
Line |
104703 | $scriptCmd = {& $wrappedCmd @PSBoundParameters}
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Cannot convert the literal 'True' to the expected type 'Edm.String'. Status: 400 (BadRequest) ErrorCode: Request_BadRequest Date: 2025-02-28T17:47:12
| Headers: Cache-Control : no-cache Vary : Accept-Encoding Strict-Transport-Security : max-age=31536000
| request-id : 03f53341-d485-4054-beae-938f0cbca8a6 client-request-id : bdeb9ef0-fa7d-49f5-826a-7640057b3884
| x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"Switzerland North","Slice":"E","Ring":"3","ScaleUnit":"001","RoleInstance":"ZRH2EPF000000E0"}}
| x-ms-resource-unit : 1 Date : Fri, 28 Feb 2025 17:47:11 GMT
Recommendation: See service error codes: https://learn.microsoft.com/graph/errors
The text was updated successfully, but these errors were encountered: