473,401 Members | 2,146 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

get Mailbox usage using WMI without Admin rights

I am using Exchange 2003(Exchange Hosting), C#.

I am trying to get Mailbox usage using WMI

But I follows the coding below, still cannot get the Mailbox usage.
Even though, I predefined the username and password.
Often gets "Access denied" while running the code.
I have tried to add the user to the \root\MicrosoftExchangeV2, and the
delegate control, but still cannot.
Is there anything I missing to add?
Or other methods that can access the mailbox usage?
Thanks in advanced

System.Management.ConnectionOptions objconn = new
System.Management.ConnectionOptions();
objconn.Impersonation =
System.Management.ImpersonationLevel.Impersonate;
objconn.EnablePrivileges = true;
string cServername = "servername";
System.Management.ManagementScope exmangescope = new
System.Management.ManagementScope(@"\\" + cServername + @"\root
\MicrosoftExchangeV2",objconn);
System.Management.ObjectQuery objquery = new
System.Management.ObjectQuery("SELECT * FROM Exchange_Mailbox");
System.Management.ManagementObjectSearcher objsearch = new
System.Management.ManagementObjectSearcher(exmange scope,objquery);
System.Management.ManagementObjectCollection queryCollection1 =
objsearch.Get();
string strDisplay;
foreach( System.Management.ManagementObject instmailbox in
queryCollection1 )
{
strDisplay = instmailbox["MailboxDisplayName"].ToString() + " " +
instmailbox["size"].ToString();
System.Console.WriteLine(strDisplay);
}
Nov 20 '07 #1
0 1631

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: David Stockwell | last post by:
Hi, After looking at http://docs.python.org/lib/module-mailbox.html I am a bit confused. The bottom of the page refers to some shortcut usage for getting a mail box import email import...
43
by: nospam | last post by:
I got three (3) files (1) Untitled.aspx (2) Untitled.aspx.1.cs (3) Untitled.aspx.2.cs These three files must be used together to make file #1, Untitled.aspx, page work via J.I.T. when the...
0
by: Ouaes Jamali | last post by:
I am using C# and ASP.Net to create users and mailboxes. I can create an user without any problems but the code Blows up when i try to create a mailbox. Here is the code snippet is am using ...
0
by: TM | last post by:
Hello all - I'm hoping you will be able to shed some light on this little dilemma ;) I would like to know how to retrieve Mailbox Rights information from DirectoryServices (or if this isn't the...
5
by: Markus Hopfenspirger | last post by:
Hello, I want to call a Command like winpop add username@domainname /createuser: password From a normal .Net Windows Application this is working without a problem. The same code called from...
2
by: Michael | last post by:
Hello, I've created an ASP web page where users in our organization can create Active Directory computer accounts. The web page is running on a Server 2003 SP1 IIS 6 installation. The...
5
by: Michael | last post by:
Hello, I've created an ASP web page where users in our organization can create Active Directory computer accounts. The web page is running on a Server 2003 SP1 IIS 6 installation. The...
0
by: Hughe Jass | last post by:
I currently have a user that's using DB2 without Admin rights to his local computer (XP SP2) and he gets an error message while trying to connect to a server. When I give him admin rights, he...
7
by: buzzluck68 | last post by:
Hello, I have an in house application that we developed, but everyone who needs to use the program are not allowed to be local admins on their PCs. I was wondering if there was a way to code...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.