Hi Team,
The power shell command to set maximum devices per user is giving below error
code:
$pscredential = New-Object System.Management.Automation.PSCredential($userName, $userPassword)
Connect-MSOlService -Credential $pscredential
Set-MsolDeviceRegistrationServicePolicy -MaximumDevicesPerUser 1 -ErrorAction Stop
Error:
Failed to update maximum devices per user, Error:Microsoft.IdentityModel.Clients.ActiveDirectory.AdalException: user_interaction_required: One of two conditions was encountered: 1.
The PromptBehavior.Never flag was passed, but the constraint could not be honored, because user interaction was required. 2. An error occurred during a silent web authentication tha
t prevented the http authentication flow from completing in a short enough time frame
at Microsoft.IdentityModel.Clients.ActiveDirectory.Internal.Platform.WebUI.<AcquireAuthorizationAsync>d__20.MoveNext() in D:\a\1\s\src\Microsoft.IdentityModel.Clients.ActiveDirec
tory\Platforms\net45\WebUI.cs:line 102
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.IdentityModel.Clients.ActiveDirectory.Internal.Flows.AcquireTokenInteractiveHandler.<AcquireAuthorizationAsync>d__15.MoveNext() in D:\a\1\s\src\Microsoft.IdentityMod
el.Clients.ActiveDirectory\Internal\Flows\AcquireTokenInteractiveHandler.cs:line 178
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.IdentityModel.Clients.ActiveDirectory.Internal.Flows.AcquireTokenInteractiveHandler.<PreTokenRequestAsync>d__14.MoveNext() in D:\a\1\s\src\Microsoft.IdentityModel.Cl
ients.ActiveDirectory\Internal\Flows\AcquireTokenInteractiveHandler.cs:line 165
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.IdentityModel.Clients.ActiveDirectory.Internal.Flows.AcquireTokenHandlerBase.<RunAsync>d__60.MoveNext() in D:\a\1\s\src\Microsoft.IdentityModel.Clients.ActiveDirecto
ry\Internal\Flows\AcquireTokenHandlerBase.cs:line 241
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext.<AcquireTokenCommonAsync>d__42.MoveNext() in D:\a\1\s\src\Microsoft.IdentityModel.Clients.ActiveDirectory
\AuthenticationContext.cs:line 608
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext.<AcquireTokenAsync>d__34.MoveNext() in D:\a\1\s\src\Microsoft.IdentityModel.Clients.ActiveDirectory\Authe
nticationContext.cs:line 442
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Online.Administration.Automation.CommonFiles.AuthManager.GetAdrsAuthenticationHeader() in X:\bt\1225946\repo\src\dev\PowerShell.V1\modules\psmodule\CommonFiles\AuthM
anager.cs:line 244
at Microsoft.Online.Administration.Automation.SetDeviceRegistrationServicePolicy.ProcessRecord() in X:\bt\1225946\repo\src\dev\PowerShell.V1\modules\psmodule\Cmdlets\DeviceRegist
rationServiceCmdlets.cs:line 224
ErrorCode: user_interaction_required
It was working a week ago but now we are facing this error.
Kindly help on resolving this.