Getting error when trying to run a powershell scripts, that connects to lync online, from c#

I am trying to run a powershell script from c#. The script basically gets lync online users list. When the script is run independently, i mean from powershell itself, then it runs without a hitch but then the same script is run from c# then I am getting the below exception...

========================================================================================================================================
     Error occured at 5/20/2015 11:56 AM :


Message        : Object reference not set to an instance of an object.
Data           : {}
InnerException : 
TargetSite     : Void .ctor(IDCRLMode)
StackTrace     :    at Microsoft.Rtc.Admin.Authentication.ManagedIdcrl..ctor(IDC
                 RLMode mode)
                    at Microsoft.Rtc.Admin.Authentication.ManagedIdcrl..ctor()
                    at Microsoft.Rtc.Management.LyncOnlineConnector.GetWebTicket
                 Cmdlet.CreateAndInitializeManagedIdcrl()
                    at Microsoft.Rtc.Management.LyncOnlineConnector.GetWebTicket
                 Cmdlet.get_ManagedIdcrl()
                    at Microsoft.Rtc.Management.LyncOnlineConnector.GetWebTicket
                 Cmdlet.GetLiveIdToken(String remoteFqdn, Int32 port, 
                 PSCredential creds)
                    at Microsoft.Rtc.Management.LyncOnlineConnector.GetWebTicket
                 Cmdlet.ConnectToWebTicketService(String fqdn, Int32 port, 
                 PSCredential creds)
                    at Microsoft.Rtc.Management.LyncOnlineConnector.GetWebTicket
                 Cmdlet.BeginProcessing()
                    at System.Management.Automation.Cmdlet.DoBeginProcessing()
                    at 
                 System.Management.Automation.CommandProcessorBase.DoBegin()
HelpLink       : 
Source         : Microsoft.Rtc.Admin.AuthenticationHelper
HResult        : -2147467261



========================================================================================================================================

May 20th, 2015 2:39am

Hi,

Since this issue is related to Lync Online, I think you should ask for advice from the Office 365 Community forum:

http://community.office365.com/en-us/f/default.aspx

Regards,

Melon Chen
TechNet Community Su

Free Windows Admin Tool Kit Click here and download it now
May 21st, 2015 4:34am

I have already tried out that forum Office 356 forum and I was asked to seek help in msdn forum... Wondering from where should i get my questions answered..:(
May 22nd, 2015 1:53am

Hi,

The current forum is TechNet, not MSDN. Generally we don't provide suggestions about coding issues in TechNet forums as far as I can tell - either does Office 365 Community as far as I know.

Please try to post the question in the appropriate MSDN forum:

https://social.msdn.microsoft.com/Forums/en-us/home

Regards,

Melon Chen
TechNet Community Su

Free Windows Admin Tool Kit Click here and download it now
June 9th, 2015 9:46pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics