Connecting Skype for Business with ChatBot - powershell

I am trying to deploy Bot on skype and facing this error,
Could anyone please suggest the solution for the same:
PS C:\WINDOWS\system32> $TenentAdminDomainId = Read-Host -Prompt 'Input your domain id in <user>#<domain>.com'
Input your domain id in <user>#<domain>.com: test2#botwork.onmicrosoft.com
PS C:\WINDOWS\system32> New-CsOnlineApplicationEndpoint -ApplicationId fc1d28c4-7ff2-41dd-9a1b-a5652949d051 -Name TestBotAP -Uri sip:$TenentAdminDomainId
Cmdlet invocation error
+ CategoryInfo : NotSpecified: (:) [New-CsOnlineApplicationEndpoint], CmdletInvocationException
+ FullyQualifiedErrorId : Error processing cmdlet request,Microsoft.Rtc.Management.Hosted.PlatformService.NewPlatformServiceAppEndpointConfigCmdlet
+ PSComputerName : adminin1.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 : adminin1.online.lync.com

From https://learn.microsoft.com/en-us/skype-sdk/skype-for-business-bot-framework/docs/bot-common-errors
FullyQualifiedErrorId : Could not get application endpoint or the Uri
is already present as a User in BVD
Delete the existing user account with the same sipuri in tenant, or
run the cmdlet using a sipuri that does not already exist in the
tenant.

Related

Creating computer objects without accessing ARS console

I want to create computer objects without accessing the ARS console
powershell.exe -command New-QADComputer -Name <Name of the new computer> -ParentContainer "<OU-Copied the distinguishedName of an earlier computer object from the AD>" -ObjectAttributes #{edsajoincomputertodomain='domain\userID'}
I am getting the below error while executing the above command.
New-QADComputer : Cannot convert 'System.Object[]' to the type 'ActiveRoles.ManagementShell.Data.IdentityParameter'
required by parameter 'ParentContainer'. Specified method is not supported.
At line:1 char:49
+ ... ntContainer <OU> ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [New-QADComputer], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgument,ActiveRoles.ManagementShell.Powershell.Cmdlets.NewComputerCmdlet
Note: We need to use the same credential which we used to add the computer object in AD to join the client computer to Domain.

AzureRM Add-AzureRmADGroupMember failing

I am trying to add a service principal from a Web App (Managed Service Identity) in to an Azure AD group and can't figure out why I am getting an error. I am using AzureRM 6.0.1. Any idea where I may be going wrong?
PowerShell Command:
Add-AzureRmADGroupMember -MemberObjectId 3cc2d09c-4fd4-4251-aa42-9ad6a0440606 -TargetGroupObjectId 2ca727c0-e2ec-46d4-9202-2144d83eb6b5 -PassThru
Error:
Add-AzureRmADGroupMember : The URI
'https://graph.windows.net//Microsoft.Azure.Commands.Common.Authentication.Abstractions.AzureTenant/directoryObj
ects/3cc2d09c-4fd4-4251-aa42-9ad6a0440606' is not valid since it is
not based on
'https://graph.windows.net/fdfed904-9e03-4e17-89c4-61053e0777be/'. At
line:2 char:2
+ Add-AzureRmADGroupMember -MemberObjectId 3cc9d09c-4fd4-4251-aa42-9ad ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Add-AzureRmADGroupMember], Exception
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.ActiveDirectory.AddAzureADGroupMemberCommand

Enable Skype for business channel for a chatbot

I am using one Azure account where I have the AD app linked with Skype for business subscription, and another Azure account where I have hosted the chatbot.
I am running the following powershell commands:
Import-PSSession (New-CsOnlineSession -Credential (Get-Credential))
and:
New-CsOnlineApplicationEndpoint -ApplicationId 561bae84-ea1c-4f75-a512-b84566779c2w -Name NameOfTheBot -Uri sip:username#yourdomain.com
With, of course, giving name and sip id.
I am getting following error in powershell:
Cmdlet invocation error
+ CategoryInfo : NotSpecified: (:) [New-CsOnlineApplicationEndpoint], CmdletInvocationException
+ FullyQualifiedErrorId : Error processing cmdlet request,Microsoft.Rtc.Management.Hosted.PlatformService.NewPlatf
ormServiceAppEndpointConfigCmdlet
+ PSComputerName : adminin1.online.lync.com
Could not find the application endpoint
+ CategoryInfo : InvalidOperation: (Microsoft.Rtc.M...cation endpoint:PlatformServiceCmdletException) [Ne
w-CsOnlineApplicationEndpoint], PlatformServiceException
+ FullyQualifiedErrorId : Could not get application endpoint or the Uri is already present as an User in BVD,Micro
soft.Rtc.Management.Hosted.PlatformService.NewPlatformServiceAppEndpointConfigCmdlet
+ PSComputerName : adminin1.online.lync.com
Should Skype for business and chatbot be linked with the same account?

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.

Error when using Connect-MsolService username and password

Why I get this error when trying to use this command Connect-MsolService
Connect-MsolService : The user name or password is incorrect. Verify your user name, and then type your
password again.
At line:1 char:1
+ Connect-MsolService
+ ~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [Connect-MsolService], MicrosoftOnlineException
+ FullyQualifiedErrorId : 0x80048821,Microsoft.Online.Administration.Automation.ConnectMsolService
The user that I am trying to login with is a global admin.
Did you add your credential object to the cmdlet, because it does not do native passthrough if your currently logged in user.
For example Connect-MSOLOnline -Credential (Get-credential)