The problem is i get an error when running the foll code...
NOTE: servername = name of server authenticating against...
Expand|Select|Wrap|Line Numbers
- public string GetMailboxSize()
- {
- try
- {
- System.Management.ManagementObjectSearcher searcher = new System.Management.ManagementObjectSearcher();
- searcher.Scope = new System.Management.ManagementScope("\\\\servername\\root\\MicrosoftExchangeV2");
- searcher.Query = new System.Management.ObjectQuery("Select * From Exchange_Mailbox");
- System.Management.ManagementObjectCollection results = searcher.Get();
- foreach (System.Management.ManagementObject mailbox in results)
- {
- mailboxsize = Convert.ToUInt64(mailbox.Properties["Size"].Value);
- //storagegroupname = mailbox.Properties["StorageGroupName"].Value.ToString();
- //storename = mailbox.Properties["StoreName"].Value.ToString();
- //mailboxdisplayname = mailbox.Properties["MailboxDisplayName"].Value.ToString();
- }
- return (Convert.ToString(mailboxsize));
- }
- catch (Exception x)
- {
- throw (x);
- }
- }
The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
Can anybody help me with regards to this problem...? Ihave turned off the firewall on my local machine....
Thanks...!!