Suddenly getting "Unable to get Lros Token." when running Powershell commands - powershell

So I've been using Powershell for a while with our Microsoft 365 environment with no major issues.
I'm specifically using the SkypeOnlineConnector to manage our Teams Direct Routing environment.
Today, suddenly out of no where, I've been encountering the following error when running the Grant-CsOnlineVoiceRoutingPolicy and Grant-CsTenantDialPlan commands:
PS C:\Users\shvlzz> Grant-CsOnlineVoiceRoutingPolicy -Identity $upn -PolicyName $null
Unable to get Lros Token.
+ CategoryInfo : NotSpecified: (CN=495c9e16-e17...au1001,DC=local:OCSADUserOrAppContact) [Grant-CsOnlineVoiceRoutingPolicy], LrosClie
ntErrorException
+ FullyQualifiedErrorId : GrantPolicy,Microsoft.Rtc.Management.Xds.GrantOnlineVoiceRoutingPolicyCmdlet
+ PSComputerName : adminau1.online.lync.com
PS C:\Users\shvlzz> Grant-CsTenantDialPlan -identity $upn -PolicyName $null
Unable to get Lros Token.
+ CategoryInfo : NotSpecified: (CN=495c9e16-e17...au1001,DC=local:OCSADUserOrAppContact) [Grant-CsOnlineVoiceRoutingPolicy], LrosClie
ntErrorException
+ FullyQualifiedErrorId : GrantPolicy,Microsoft.Rtc.Management.Xds.GrantOnlineVoiceRoutingPolicyCmdlet
+ PSComputerName : adminau1.online.lync.com
I've tried with a real PolicyName and it also fails with same error:
PS C:\Users\shvlzz> Grant-CsOnlineVoiceRoutingPolicy -Identity $upn -PolicyName "NZ-Unrestricted"
Unable to get Lros Token.
+ CategoryInfo : NotSpecified: (CN=495c9e16-e17...au1001,DC=local:OCSADUserOrAppContact) [Grant-CsOnlineVoiceRoutingPolicy], LrosClie
ntErrorException
+ FullyQualifiedErrorId : GrantPolicy,Microsoft.Rtc.Management.Xds.GrantOnlineVoiceRoutingPolicyCmdlet
+ PSComputerName : adminau1.online.lync.com
I've tried terminating and reestablishing the SkypeOnlineConnector session but the issue still occurs.
Get and Set commands are working properly.
I don't know what the error means so I can't properly troubleshoot to fix it.
I have tried Googling "Lros Token" but have come up emtpy. Even Google doesn't seem to know what it is.
Please help!

I'm getting the same error. I've raised a ticket with Microsoft support and waiting to see what they say.
I can confirm I was able to do the same changes via Admin Center and works as expected.

Happens for me also.
We've seen this across 9 Office 365 tenants.
We cannot grant CsClientPolicy, TeamsCallingPolicy, OnlineVoiceroutingPolicy.
E.g. Set-CsUser -EnterpriseVoiceEnabled works fine.
I'm filing a ticket with MS now.

Related

Grant-CsTeamsAppPermissionPolicy not working in microsoft teams powershell

I am trying to apply permission policy to a user via powershell but it is not working
PS C:\Users\PO30261> Grant-CsTeamsAppPermissionPolicy -PolicyName "HR App Policy" -Identity d72f6b50-ac75-470a-80b8-919ab8b3232e
Get-CsOnlineSession : Connecting to remote server api.interfaces.records.teams.microsoft.com failed with the following error message : The WinRM client cannot process the request. Basic
authentication is currently disabled in the client configuration. Change the client configuration and try the request again. For more information, see the about_Remote_Troubleshooting Help
topic.
At C:\Program Files\WindowsPowerShell\Modules\MicrosoftTeams\2.3.1\net472\SfBORemotePowershellModule.psm1:63 char:22
$remoteSession = & (Get-CsOnlineSessionCommand)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CategoryInfo : NotSpecified: (:) [Get-CsOnlineSession], PSRemotingTransportException
FullyQualifiedErrorId : PSRemotingTransportException,Microsoft.Teams.ConfigApi.Cmdlets.GetCsOnlineSession
Invoke-Command : Cannot validate argument on parameter 'Session'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
At C:\Program Files\WindowsPowerShell\Modules\MicrosoftTeams\2.3.1\net472\SfBORemotePowershellModule.psm1:19581 char:38
... -Session (Get-PSImplicitRemotingSession -CommandName 'Grant-CsTeam ...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CategoryInfo : InvalidData: (:) [Invoke-Command], ParentContainsErrorRecordException
FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.InvokeCommandCommand
Error shows that issue is not related to apply policy. Issue is with connecting to server "Basic authentication is currently disabled in the client configuration" so update module and try again. Update-Module MicrosoftTeams
Seems like a problem with powerShell version. Look at this discussion where community are following this issue, including me:
https://techcommunity.microsoft.com/t5/teams-developer/authenticating-with-an-access-token-connect-microsoftteams/m-p/2233794

powershell returned an error:(403) WebException using New-pnpList

I had my PS script running the other day and created a new list with a single field with no issues. Was able to view the list in the Site Contents lib.
Today, it's not working. I tried running the PS code below and then resorted to running the new-pnplist code at the command line...got the same error which is shown below.
I'm using the Global admin account. Using version 3.13.19 SharePointPNPPowerShellOnline. Executed the commands from Powershell ISE which is what I did the other day when it worked. And, I was able to connect successfully using the Connect-sposervice command.
Error:
new-pnplist -Template GenericList -Title 'TestPNP2'
new-pnplist : The remote server returned an error: (403) Forbidden.
At line:1 char:1
+ new-pnplist -Template GenericList -Title $ListName
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (:) [New-PnPList], WebException
+ FullyQualifiedErrorId : EXCEPTION,SharePointPnP.PowerShell.Commands.Lists.NewList
Code:
$TargetListURL="https://<my sharepoint.com>/sites/CKCDemo"
$ListName="TESTPNP2"
Connect-PnPOnline -url $TargetListURL -CurrentCredentials
New-PnPList -Template GenericList -Title $ListName
Add-PnPField -List $ListName -DisplayName "MyTEST" -InternalName "MyTEST" -Type Text -AddToDefaultView
Get-PnPList`
Make sure you have enough permission to create a list in this site. You could try to go to the site directly, check whether you could create a list through ui.
Note: A global admin will not automatically have access to individual sites unless explicitly granted.

How to connect a bot to Skype for business

I am currently working with the Microsoft Bot Framework and am trying to connect my bot to the new Skype for business channel.
I've followed the instructions:
Download and install the Skype for Business Online Connector module
Open Windows PowerShell as Administrator and run the following:
Import-PSSession (New-CsOnlineSession -Credential (Get-Credential))
Enter your Admin credentials
Run the following cmdlet:
New-CsOnlineApplicationEndpoint -ApplicationId botid -Name NameOfTheBot -Uri sip:username#yourdomain
I got our tenant admin to enter his credentials and also to create a domain account for the bot with an Office 365 licence. (I tried first to register bot without an Office 365 licence assigned).
When the bot account had an office 365 licence and tried to call the New-CsOnlineApplicationEndpoint I got the following error:
Cmdlet invocation error
+ CategoryInfo : NotSpecified: (:) [New-CsOnlineApplicationEndpoint], CmdletInvocationException
+ FullyQualifiedErrorId : Error processing cmdlet request,Microsoft.Rtc.Management.Hosted.PlatformService.NewPlatformServiceAppEndpointConfigCmdlet
+ PSComputerName : admin1e.online.lync.com
Could not find the application endpoint
+ CategoryInfo : InvalidOperation: (Microsoft.Rtc.M...cation endpoint:PlatformServiceCmdletException) [New-CsOnlineApplicationEndpoint], PlatformServiceException
+ FullyQualifiedErrorId : Could not get application endpoint or the Uri is already present as an User in BVD,Microsoft.Rtc.Management.Hosted.PlatformService.NewPlatformServiceAppEndpointConfigCmdlet
+ PSComputerName : admin1e.online.lync.com
Without the Office 365 licence I got the following error:
Cmdlet invocation error
+ CategoryInfo : NotSpecified: (:) [New-CsOnlineApplicationEndpoint], CmdletInvocationException
+ FullyQualifiedErrorId : Error processing cmdlet request,Microsoft.Rtc.Management.Hosted.PlatformService.NewPlatformServiceAppEndpointConfigCmdlet
+ PSComputerName : admin1e.online.lync.com
Exception of type 'Microsoft.Rtc.Management.Hosted.PlatformService.ProvisioningLibrary.ApplicationEndpointProvisioningException' was thrown.
+ CategoryInfo : InvalidOperation: (Microsoft.Rtc.M...on' was thrown.:PlatformServiceCmdletException) [New-CsOnlineApplicationEndpoint], ApplicationEndpointProvisioningException
+ FullyQualifiedErrorId : Exception of type 'Microsoft.Rtc.Management.Hosted.PlatformService.ProvisioningLibrary.ApplicationEndpointProvisioningException' was thrown.,Microsoft.Rtc.Management.Hosted.PlatformService.NewPlatformServiceAppEndpointConfigCmdlet
+ PSComputerName : admin1e.online.lync.com
I've also followed some of the more generic info around the Skype for Business connector as detailed here: https://msdn.microsoft.com/en-us/skype/trusted-application-api/docs/trustedapplicationendpoint
I've also tried to use a new account as mentioned in this issue but got the same error: Unable to connect bot to Skype For Business Online
You need to target the domain:
sip:botname#company.onmicrosoft.com
It appears it will not work if you target your custom domains.

adding a mailbox in powershell, permission denied

I am trying to add one single mailbox on exchange 2013 via powershell and getting and 'access denied' error.
PS C:\Software> Enable-Mailbox -Identity AreallyTest
Enable-Mailbox : Unable to generate the e-mail address. Unable to load address module 'X:\Exchange\Mailbox\address\SMTP\AMD64\inproxy.dll' for address type
'SMTP'. Additional message: 'Access is denied'.
At line:1 char:1
+ Enable-Mailbox -Identity AreallyTest
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Enable-Mailbox], RusException
+ FullyQualifiedErrorId : [Server=EXCH01,RequestId=cfea9121-4f0a-41f4-84e9 -2489f3228410,TimeStamp=10/13/2014 8:06:33 AM] [FailureCategory=Cmdlet-Rus Exception] 593F2A65,Microsoft.Exchange.Management.RecipientTasks.EnableMaiLbox
The user does exist.
How I get around this?
Windows domain naming is where you are in error.
Add the NetBios domain as a prefix like this:
Enable-Mailbox -Identity domain\AreallyTest
you have to run the command in an elevated console (run as admin)

Error when executing Get-AzureStorageAccount in azure powershell

Here is the error
PS C:\Windows\system32> Get-AzureStorageAccount
Get-AzureStorageAccount : Value cannot be null.
Parameter name: resource
At line:1 char:1
+ Get-AzureStorageAccount
+ ~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-AzureStorageAccount], AadAuthenticationFailedException
+ FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.Utilities.Common.Authentication.AadAuthenticationFailedException,Microsoft.WindowsAzure.Commands.ServiceManagement.StorageServices.GetAzureStorageAccountCommand
I am getting the same error on
Get-AzureLocation,
Get-AzureWebsite
I have imported my settings file and Get-AzureSubscription works just fine and provides me all the correct information.
This solved my issue, got this from Microsoft support forum.
As far as my research goes on this, the issue can be related to cache of some account. If just adding does not work, I suggest that you remove and add the subscription again:
This article will give you information on this:
http://msdn.microsoft.com/en-us/library/dn495268.aspx