Home

ERROR: The term 'Get-CsPowerShellEndpoint >> azure function

%3CLINGO-SUB%20id%3D%22lingo-sub-572444%22%20slang%3D%22en-US%22%3EERROR%3A%20The%20term%20'Get-CsPowerShellEndpoint%20%26gt%3B%26gt%3B%20azure%20function%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-572444%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20creating%20a%20azure%20function%20to%20connect%20to%20teams%20online%20and%20update%20configuration%20in%20Teams%20administrative%20portal.%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20added%20modules%20skypeonlineconnector%20and%20lynconline%20connector%20references%3C%2FP%3E%3CP%3EPowershell%20is%20working%20correctly%20on%20local%20machine%20when%20i%20login%20with%20get-credentials%20and%20do%20not%20use%20-credentials%20switch.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBut%20when%20we%20try%20to%20run%20the%20powershell%20in%20azure%20function%20v2%20%26gt%3B%26gt%3B%20Powershell%20framework%20.%20It%20is%20erroring%20out%20with%20below%20error.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EImport-Module%20'D%3A%5CHome%5Csite%5Cwwwroot%5CHttpTrigger1%5Cmodules%5CSkypeOnlineConnectorStartup.psm1'%3CBR%20%2F%3EWrite-Host%20%22Import%20statement%20completed%22%3CBR%20%2F%3E%24username%20%3D%20%22admin%40xxx.OnMicrosoft.com%22%3CBR%20%2F%3E%24Password%20%3D%20%22xxxx%22%3CBR%20%2F%3E%24SecurePassword%20%3D%20%24Password%20%7C%20ConvertTo-SecureString%20-AsPlainText%20-Force%3CBR%20%2F%3E%24Credentials%20%3D%20New-Object%20-TypeName%20System.Management.Automation.PSCredential%20-argumentlist%20%24UserName%2C%20%24SecurePassword%3C%2FP%3E%3CP%3EWrite-Host%20%22Credentials%20statement%20completed%22%3CBR%20%2F%3E%24sfboSession%20%3D%20New-CsOnlineSession%20-Credential%20%24Credentials%3CBR%20%2F%3EImport-PSSession%20%24sfboSession%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EError%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CDIV%20class%3D%22log-content%20error-content%22%3E2019-05-16T05%3A38%3A53.094%20%5BError%5D%20ERROR%3A%20The%20term%20'Get-CsPowerShellEndpoint'%20is%20not%20recognized%20as%20the%20name%20of%20a%20cmdlet%2C%20function%2C%20script%20file%2C%20or%20operable%20program.%20Check%20the%20spelling%20of%20the%20name%2C%20or%20if%20a%20path%20was%20included%2C%20verify%20that%20the%20path%20is%20correct%20and%20try%20again.%20Microsoft.Azure.WebJobs.Script.Rpc.RpcException%20%3A%20Result%3A%20ERROR%3A%20The%20term%20'Get-CsPowerShellEndpoint'%20is%20not%20recognized%20as%20the%20name%20of%20a%20cmdlet%2C%20function%2C%20script%20file%2C%20or%20operable%20program.%20Check%20the%20spelling%20of%20the%20name%2C%20or%20if%20a%20path%20was%20included%2C%20verify%20that%20the%20path%20is%20correct%20and%20try%20again.%20Exception%3A%20The%20term%20'Get-CsPowerShellEndpoint'%20is%20not%20recognized%20as%20the%20name%20of%20a%20cmdlet%2C%20function%2C%20script%20file%2C%20or%20operable%20program.%20Check%20the%20spelling%20of%20the%20name%2C%20or%20if%20a%20path%20was%20included%2C%20verify%20that%20the%20path%20is%20correct%20and%20try%20again.%20Stack%3A%20at%20System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext%20funcContext%2C%20Exception%20exception)%20at%20System.Management.Automation.Interpreter.ActionCallInstruction%602.Run(InterpretedFrame%20frame)%20at%20System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame%20frame)%20at%20System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame%20frame)%20at%20System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame%20frame)%20at%20System.Management.Automation.Interpreter.LightLambda.RunVoid1%5BT0%5D(T0%20arg0)%20at%20System.Management.Automation.PSScriptCmdlet.RunClause(Action%601%20clause%2C%20Object%20dollarUnderbar%2C%20Object%20inputToProcess)%20at%20System.Management.Automation.PSScriptCmdlet.DoEndProcessing()%20at%20System.Management.Automation.CommandProcessorBase.Complete()%3C%2FDIV%3E%3CDIV%20class%3D%22log-content%20error-content%22%3E2019-05-16T05%3A38%3A53.283%20%5BError%5D%20ERROR%3A%20Cannot%20validate%20argument%20on%20parameter%20'Session'.%20The%20argument%20is%20null.%20Provide%20a%20valid%20value%20for%20the%20argument%2C%20and%20then%20try%20running%20the%20command%20again.%20Microsoft.Azure.WebJobs.Script.Rpc.RpcException%20%3A%20Result%3A%20ERROR%3A%20Cannot%20validate%20argument%20on%20parameter%20'Session'.%20The%20argument%20is%20null.%20Provide%20a%20valid%20value%20for%20the%20argument%2C%20and%20then%20try%20running%20the%20command%20again.%20Exception%3A%20Cannot%20validate%20argument%20on%20parameter%20'Session'.%20The%20argument%20is%20null.%20Provide%20a%20valid%20value%20for%20the%20argument%2C%20and%20then%20try%20running%20the%20command%20again.%20Stack%3A%20at%20System.Management.Automation.ParameterBinderController.BindPositionalParametersInSet(UInt32%20validParameterSets%2C%20Dictionary%602%20nextPositionalParameters%2C%20CommandParameterInternal%20argument%2C%20ParameterBindingFlags%20flags%2C%20ParameterBindingException%26amp%3B%20bindingException)%20at%20System.Management.Automation.ParameterBinderController.BindPositionalParameters(Collection%601%20unboundArguments%2C%20UInt32%20validParameterSets%2C%20UInt32%20defaultParameterSet%2C%20ParameterBindingException%26amp%3B%20outgoingBindingException)%20at%20System.Management.Automation.CmdletParameterBinderController.BindCommandLineParametersNoValidation(Collection%601%20arguments)%20at%20System.Management.Automation.CmdletParameterBinderController.BindCommandLineParameters(Collection%601%20arguments)%20at%20System.Management.Automation.CommandProcessor.BindCommandLineParameters()%20at%20System.Management.Automation.CommandProcessor.Prepare(IDictionary%20psDefaultParameterValues)%20at%20System.Management.Automation.CommandProcessorBase.DoPrepare(IDictionary%20psDefaultParameterValues)%20at%20System.Management.Automation.Internal.PipelineProcessor.Start(Boolean%20incomingStream)%20at%20System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object%20input)%20---%20End%20of%20stack%20trace%20from%20previous%20location%20where%20exception%20was%20thrown%20---%20at%20System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object%20input)%20at%20System.Management.Automation.PipelineOps.InvokePipeline(Object%20input%2C%20Boolean%20ignoreInput%2C%20CommandParameterInternal%5B%5D%5B%5D%20pipeElements%2C%20CommandBaseAst%5B%5D%20pipeElementAsts%2C%20CommandRedirection%5B%5D%5B%5D%20commandRedirections%2C%20FunctionContext%20funcContext)%20at%20System.Management.Automation.Interpreter.ActionCallInstruction%606.Run(InterpretedFrame%20frame)%20at%20System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame%20frame)%3C%2FDIV%3E%3CDIV%20class%3D%22log-content%20error-content%22%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%20class%3D%22log-content%20error-content%22%3EThanks%20in%20advance%26nbsp%3B%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-572444%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-629050%22%20slang%3D%22en-US%22%3ERe%3A%20ERROR%3A%20The%20term%20'Get-CsPowerShellEndpoint%20%26gt%3B%26gt%3B%20azure%20function%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-629050%22%20slang%3D%22en-US%22%3EAdmins%20can%20you%20help%20please%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-636579%22%20slang%3D%22en-US%22%3ERe%3A%20ERROR%3A%20The%20term%20'Get-CsPowerShellEndpoint%20%26gt%3B%26gt%3B%20azure%20function%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-636579%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F42008%22%20target%3D%22_blank%22%3E%40Kanwar%20Jot%20Singh%3C%2FA%3E%26nbsp%3B-%20we%20are%20looking%20into%20it.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-636617%22%20slang%3D%22en-US%22%3ERe%3A%20ERROR%3A%20The%20term%20'Get-CsPowerShellEndpoint%20%26gt%3B%26gt%3B%20azure%20function%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-636617%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F322587%22%20target%3D%22_blank%22%3E%40Abhijit_MSFT%3C%2FA%3E%26nbsp%3B.%20Let%20me%20know%20if%20you%20need%20any%20more%20information.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-643480%22%20slang%3D%22en-US%22%3ERe%3A%20ERROR%3A%20The%20term%20'Get-CsPowerShellEndpoint%20%26gt%3B%26gt%3B%20azure%20function%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-643480%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F42008%22%20target%3D%22_blank%22%3E%40Kanwar%20Jot%20Singh%3C%2FA%3E%26nbsp%3B-%26nbsp%3B%20you%20are%20facing%20this%20error%20because%26nbsp%3B%3CSPAN%20style%3D%22font-family%3A%20inherit%3B%22%3ESkype%20Online%20Connector%20doesn't%20support%20azure%20functions%20right%20now.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CDIV%3E%0A%3CDL%3E%0A%3CDD%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3C%2FDD%3E%0A%3C%2FDL%3E%0A%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-651164%22%20slang%3D%22en-US%22%3ERe%3A%20ERROR%3A%20The%20term%20'Get-CsPowerShellEndpoint%20%26gt%3B%26gt%3B%20azure%20function%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-651164%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F322587%22%20target%3D%22_blank%22%3E%40Abhijit_MSFT%3C%2FA%3E%26nbsp%3Bfor%20confirming%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20we%20can%20not%20connect%20to%20Skype%2FTeams%20in%20azure%20functions%20or%20otherways%20in%20azure.%20We%20wanted%20to%20automate%20a%20process.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Kanwar Jot Singh
Contributor

I am creating a azure function to connect to teams online and update configuration in Teams administrative portal. 

I have added modules skypeonlineconnector and lynconline connector references

Powershell is working correctly on local machine when i login with get-credentials and do not use -credentials switch. 

 

But when we try to run the powershell in azure function v2 >> Powershell framework . It is erroring out with below error. 

 

 

 

Import-Module 'D:\Home\site\wwwroot\HttpTrigger1\modules\SkypeOnlineConnectorStartup.psm1'
Write-Host "Import statement completed"
$username = "admin@xxx.OnMicrosoft.com"
$Password = "xxxx"
$SecurePassword = $Password | ConvertTo-SecureString -AsPlainText -Force
$Credentials = New-Object -TypeName System.Management.Automation.PSCredential -argumentlist $UserName, $SecurePassword

Write-Host "Credentials statement completed"
$sfboSession = New-CsOnlineSession -Credential $Credentials
Import-PSSession $sfboSession

 

Error 

 

 

2019-05-16T05:38:53.094 [Error] ERROR: The term 'Get-CsPowerShellEndpoint' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. Microsoft.Azure.WebJobs.Script.Rpc.RpcException : Result: ERROR: The term 'Get-CsPowerShellEndpoint' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. Exception: The term 'Get-CsPowerShellEndpoint' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. Stack: at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception) at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0) at System.Management.Automation.PSScriptCmdlet.RunClause(Action`1 clause, Object dollarUnderbar, Object inputToProcess) at System.Management.Automation.PSScriptCmdlet.DoEndProcessing() at System.Management.Automation.CommandProcessorBase.Complete()
2019-05-16T05:38:53.283 [Error] ERROR: Cannot validate argument on parameter 'Session'. The argument is null. Provide a valid value for the argument, and then try running the command again. Microsoft.Azure.WebJobs.Script.Rpc.RpcException : Result: ERROR: Cannot validate argument on parameter 'Session'. The argument is null. Provide a valid value for the argument, and then try running the command again. Exception: Cannot validate argument on parameter 'Session'. The argument is null. Provide a valid value for the argument, and then try running the command again. Stack: at System.Management.Automation.ParameterBinderController.BindPositionalParametersInSet(UInt32 validParameterSets, Dictionary`2 nextPositionalParameters, CommandParameterInternal argument, ParameterBindingFlags flags, ParameterBindingException& bindingException) at System.Management.Automation.ParameterBinderController.BindPositionalParameters(Collection`1 unboundArguments, UInt32 validParameterSets, UInt32 defaultParameterSet, ParameterBindingException& outgoingBindingException) at System.Management.Automation.CmdletParameterBinderController.BindCommandLineParametersNoValidation(Collection`1 arguments) at System.Management.Automation.CmdletParameterBinderController.BindCommandLineParameters(Collection`1 arguments) at System.Management.Automation.CommandProcessor.BindCommandLineParameters() at System.Management.Automation.CommandProcessor.Prepare(IDictionary psDefaultParameterValues) at System.Management.Automation.CommandProcessorBase.DoPrepare(IDictionary psDefaultParameterValues) at System.Management.Automation.Internal.PipelineProcessor.Start(Boolean incomingStream) at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input) --- End of stack trace from previous location where exception was thrown --- at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input) at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext) at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
 
Thanks in advance 
5 Replies
Highlighted
Admins can you help please

Thanks @Abhijit_MSFT . Let me know if you need any more information.

 

 

@Kanwar Jot Singh -  you are facing this error because Skype Online Connector doesn't support azure functions right now.

 

Thanks @Abhijit_MSFT for confirming 

So we can not connect to Skype/Teams in azure functions or otherways in azure. We wanted to automate a process.

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
46 Replies
Extentions Synchronization
Deleted in Discussions on
3 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
30 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies
Security Community Webinars
Valon_Kolica in Security, Privacy & Compliance on
13 Replies