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 ========================================================================================================================================