Hi Metelitca,
I'm with Supriya, you shoud rather use the cmdlet as the first approach using EWS required Mailbox Access (please see the credentials in that script). For running the cmdlet via (remote) Powershell, you can use some code like
namespace Microsoft.Samples.PowerShell.Runspaces {
using System;
using System.Management.Automation;
using PowerShell = System.Management.Automation.PowerShell;
internal class getExchangeInfo {
private String username = "user@domain.com";
private static void Main(string[] args) {
... your code
}
private static getOutofOffice ()
using (PowerShell powershell = PowerShell.Create().AddCommand("get-mailboxautoreplyconfiguration " + username)) {
foreach (PSObject result in powershell.Invoke()) {
... do something with the result from ps ..
}
}
}
}
}
If you Need more Information about the Powershell wrapper in your C# code, please see
http://msdn.microsoft.com/en-us/library/ee706576(v=vs.85).aspx (These are the ones with Powershell) ; if you Need additional Information about get-mailboxautoreplyconfiguration, see
http://technet.microsoft.com/de-de/library/dd638081(v=exchg.150).aspx .
Your account by default required Recipient Management permissions if you Need to modify the OOF
Please let us know, if it worked.
Regards,
Martin