Get list of users in C# code, who has Mailbox Access permissions to Particular User RRS feed

  • Question

  • Hi,

    I am using Exchange Server 2013. In my server, Full Mailbox access permissions of some users has granted to one particular user [ ex:].

    Now i need the list who has access permissions to in C# code.

    In the below code i am getting all users list of my server using Administrator account.

     SecureString password = new SecureString();
                  string str_password = "xxxxx";
                  string username = "";
                  foreach (char x in str_password) { password.AppendChar(x); }
                  PSCredential credential = new PSCredential(username, password);
                  WSManConnectionInfo connectionInfo = new WSManConnectionInfo(new Uri(""), "", credential);
                  Runspace runspace = RunspaceFactory.CreateRunspace(connectionInfo);
                  PowerShell powershell = PowerShell.Create();
                  PSCommand command = new PSCommand();
                  command.AddParameter("ResultSize", int.MaxValue);
                  powershell.Commands = command;
                  powershell.Runspace = runspace;
                  Collection<PSObject> usersList = powershell.Invoke();

     Now i need to access list of users who has mailbox permissions access , instead of all users.

    Please share your ideas

    Tuesday, July 8, 2014 6:50 AM


All replies