Quantcast
Channel: Lync Server 2013 - Management, Planning, and Deployment forum
Viewing all articles
Browse latest Browse all 5984

Exception when remotely executing Export-CsArchivingData cmdlet from C# managed code

$
0
0

Hi,

Hopefully this is the right forum.

The issue is specifically about remotely executing Export-CsArchivingData cmdlet from C# managed code.

I use RunspacePool to connect to remote Lync server as described here:
http://msdn.microsoft.com/en-us/library/ee706598(v=vs.85).aspx


I can connect to remote Lync server and execute many Lync cmdlets (e.g. Get-CsUser, Get-CsSite, Get-CsPool, etc) and get the results just fine.
However, when it tries to execute Export-CsArchivingData cmdlet remotely, it throws the following exception:

System.AggregateException: One or more errors occurred. ---> System.Management.Automation.RemoteException: The term 'Export-CsArchivingData' 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.
   at System.Management.Automation.Runspaces.AsyncResult.EndInvoke()
   at System.Management.Automation.PowerShell.EndInvoke(IAsyncResult asyncResult)

Additional info:
1. I created a custom RBAC role and added Export-CsArchivingData to it. Then, assign this new role to the account that runs the application.
2. Using regular powershell (not Lync powershell) from the machine (that I run my app from) with Lync admin tool installed and ran with the account that has the custom RBAC role assigned, I can connect to remote Lync server and execute Export-CsArchivingData just fine.

3. Execute the app using the same above account (that has custom RBAC role) on two machines (one with Lync admin tool installed, one without) and connect to remote Lync server.
   Same behavior on both machine, I got the above the exception when executing Export-CsArchivingData and no problem when executing other Lync cmdlets mentioned above.
   Yes, even from a machine without Lync admin tool installed, I can execute other Lync cmdlets mentioned above.
  
At this point, I am not sure why I get the above exception when Export-CsArchivingData is executed from my app while I can connect to remote Lync server and call Export-CsArchivingData just fine via regular Powershell, both on the same machine.

Note: I do not call Import-Module Lync in C# managed code since it is not necessary so far for executing other Lync cmdlets remotely.

Any idea on what to look for?

Thanks in advance.


Viewing all articles
Browse latest Browse all 5984

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>