473,569 Members | 2,839 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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\Microsoft ExchangeV2, 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.Manageme nt.ConnectionOp tions objconn = new
System.Manageme nt.ConnectionOp tions();
objconn.Imperso nation =
System.Manageme nt.Impersonatio nLevel.Imperson ate;
objconn.EnableP rivileges = true;
string cServername = "servername ";
System.Manageme nt.ManagementSc ope exmangescope = new
System.Manageme nt.ManagementSc ope(@"\\" + cServername + @"\root
\MicrosoftExcha ngeV2",objconn) ;
System.Manageme nt.ObjectQuery objquery = new
System.Manageme nt.ObjectQuery( "SELECT * FROM Exchange_Mailbo x");
System.Manageme nt.ManagementOb jectSearcher objsearch = new
System.Manageme nt.ManagementOb jectSearcher(ex mangescope,objq uery);
System.Manageme nt.ManagementOb jectCollection queryCollection 1 =
objsearch.Get() ;
string strDisplay;
foreach( System.Manageme nt.ManagementOb ject instmailbox in
queryCollection 1 )
{
strDisplay = instmailbox["MailboxDisplay Name"].ToString() + " " +
instmailbox["size"].ToString();
System.Console. WriteLine(strDi splay);
}
Nov 20 '07 #1
0 1642

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

Similar topics

0
1267
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 mailbox mbox = mailbox.UnixMailbox(fp, email.message_from_file)
43
2599
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 User first hits Internet Explorer 6.0 on your browser.
0
1277
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 DirectoryEntry de = new DirectoryEntry(); DirectoryEntry ParentEntry = new DirectoryEntry(); CDOEXM.IMailboxStore Mailbox; ParentEntry.Username =...
0
1401
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 way to do, how do you?). Mailbox Rights are setup via Active Directory: User properties > Exchange Advanced > Mailbox Rights. This information does...
5
2032
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 a ASP Net Application or a Windows Service Application is not executed. Also if I do an impersonation to a local admin account before executing the...
2
5351
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 Exchange System Manager is running on the web server and Exchange SP2 has been installed. The web page uses ADSI code to create a user, and then CDO code...
5
4865
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 Exchange System Manager is running on the web server and Exchange SP2 has been installed. The IIS site is configured with Basic Authentication and users...
0
1124
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 connects just fine. (I guess the exact error would be irrelivant since the same account works fine with Admin rights) Is there any resource where I can...
7
10477
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 the application to not require admin rights (for modifying/creating excel and text files as well as modifying the registry)? And I was wondering if...
0
7612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7668
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7964
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6281
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5509
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2111
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1209
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.