Click here to Skip to main content
15,905,914 members
Home / Discussions / C#
   

C#

 
Questionhow to call the values from the databases Pin
S. Karthik - Hosur30-May-12 4:21
S. Karthik - Hosur30-May-12 4:21 
AnswerRe: how to call the values from the databases Pin
Dave Kreskowiak30-May-12 4:24
mveDave Kreskowiak30-May-12 4:24 
GeneralRe: how to call the values from the databases Pin
Paul Conrad1-Jun-12 14:48
professionalPaul Conrad1-Jun-12 14:48 
AnswerCross posted from QA Pin
Pete O'Hanlon30-May-12 4:40
mvePete O'Hanlon30-May-12 4:40 
QuestionMessage Removed Pin
30-May-12 4:05
S. Karthik - Hosur30-May-12 4:05 
AnswerRe: how to call the values from the databases Pin
Eddy Vluggen30-May-12 4:18
professionalEddy Vluggen30-May-12 4:18 
QuestionC#/.NET component/library Media file informations Pin
Istvan T30-May-12 1:38
Istvan T30-May-12 1:38 
Questionget the file path in web project when running unit test project Pin
siva45530-May-12 0:35
siva45530-May-12 0:35 
AnswerRe: get the file path in web project when running unit test project Pin
BobJanova30-May-12 0:49
BobJanova30-May-12 0:49 
AnswerRe: get the file path in web project when running unit test project Pin
AmitGajjar30-May-12 23:53
professionalAmitGajjar30-May-12 23:53 
QuestionHow to get the all unauthorized installed applications in my pc? Pin
Srinubabu Ravilla29-May-12 21:04
professionalSrinubabu Ravilla29-May-12 21:04 
AnswerRe: How to get the all unauthorized installed applications in my pc? Pin
OriginalGriff29-May-12 21:18
mveOriginalGriff29-May-12 21:18 
GeneralRe: How to get the all unauthorized installed applications in my pc? Pin
Srinubabu Ravilla30-May-12 18:31
professionalSrinubabu Ravilla30-May-12 18:31 
AnswerRe: How to get the all unauthorized installed applications in my pc? Pin
sina rahimzadeh29-May-12 22:42
sina rahimzadeh29-May-12 22:42 
SuggestionRe: How to get the all unauthorized installed applications in my pc? Pin
DaveyM6929-May-12 22:50
professionalDaveyM6929-May-12 22:50 
GeneralRe: How to get the all unauthorized installed applications in my pc? Pin
Sentenryu30-May-12 5:11
Sentenryu30-May-12 5:11 
AnswerRe: How to get the all unauthorized installed applications in my pc? Pin
Eddy Vluggen29-May-12 23:46
professionalEddy Vluggen29-May-12 23:46 
QuestionLinq To SQL vs Entity Framework Pin
Kevin Marois29-May-12 13:20
professionalKevin Marois29-May-12 13:20 
AnswerRe: Linq To SQL vs Entity Framework Pin
Abhinav S29-May-12 20:47
Abhinav S29-May-12 20:47 
AnswerRe: Linq To SQL vs Entity Framework Pin
BobJanova29-May-12 23:30
BobJanova29-May-12 23:30 
AnswerRe: Linq To SQL vs Entity Framework Pin
AmitGajjar30-May-12 23:45
professionalAmitGajjar30-May-12 23:45 
QuestionProblem with wmi and exchange Pin
turbosupramk329-May-12 11:35
turbosupramk329-May-12 11:35 
Hi,

Everything I've googled says this should work, but I get "invalid namespace" and was wondering if someone can help me get a baseline going so that I can build off of that?

I have the necessary references/includes, I just cannot get this to work for the life of me. Thanks for reading.


C#
string cServername = "[server]";

System.Management.ConnectionOptions objconn = new System.Management.ConnectionOptions();
            objconn.Impersonation = System.Management.ImpersonationLevel.Impersonate;
            objconn.EnablePrivileges = true;
            objconn.Username = "[user]";
            objconn.Password = "[pass]";
            objconn.Authority = "ntlmdomain:[domain]"; 
            
            
            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(exmangescope, 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);
            } 

AnswerRe: Problem with wmi and exchange Pin
Dave Kreskowiak29-May-12 18:15
mveDave Kreskowiak29-May-12 18:15 
GeneralRe: Problem with wmi and exchange Pin
turbosupramk330-May-12 3:39
turbosupramk330-May-12 3:39 
GeneralRe: Problem with wmi and exchange Pin
Dave Kreskowiak30-May-12 4:22
mveDave Kreskowiak30-May-12 4:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.