Click here to Skip to main content
16,011,743 members
Home / Discussions / C#
   

C#

 
GeneralRe: Open my website with FireFox navigator Pin
Shameel4-Aug-11 0:30
professionalShameel4-Aug-11 0:30 
GeneralRe: Open my website with FireFox navigator Pin
Pierre besquent4-Aug-11 0:41
Pierre besquent4-Aug-11 0:41 
QuestionDevComponents problem Pin
md_refay3-Aug-11 21:31
md_refay3-Aug-11 21:31 
AnswerRe: DevComponents problem Pin
eqtidar8-Aug-11 18:29
eqtidar8-Aug-11 18:29 
QuestionOpening a form to a different mdi container [modified] Pin
MAW303-Aug-11 15:50
MAW303-Aug-11 15:50 
AnswerRe: Opening a form to a different mdi container Pin
OriginalGriff3-Aug-11 21:48
mveOriginalGriff3-Aug-11 21:48 
AnswerRe: Opening a form to a different mdi container [modified] Pin
Shameel3-Aug-11 22:42
professionalShameel3-Aug-11 22:42 
QuestionHelp with wmi enumerator for exchange Pin
turbosupramk33-Aug-11 10:36
turbosupramk33-Aug-11 10:36 
I have a wmi enumerator, and I'm looking to build one for exchange wmi commands and I can't seem to get it to work. Below is my code.

As some background as to why, I am trying to query some things in exchange 2007 that are not stored in the registry and that I think are in the exchange database. An example of values I'm looking for are owa (Default Web Site) Properties inside of the EMC under server config --> client access --> owa (Default Web Site) Properties and the tabs underneath there.

Thanks for reading!



private void wmiExchangeEnumerator(string wmiSearchClass)
  {

      try
      {
          ManagementScope scope = null;
          ManagementObjectSearcher searcher = null;
          ConnectionOptions options = new ConnectionOptions();
          if (textBox4.Text != "")
          {

              string serverName = textBox4.Text;
              scope = new ManagementScope(GetStandardPath(serverName), options);

              scope.Path = new ManagementPath(@"\\" + serverName + @"\root\MicrosoftExchangeV2");
              scope.Options.Impersonation = ImpersonationLevel.Impersonate;
              scope.Connect();
              ObjectQuery query = new ObjectQuery("SELECT * FROM " + wmiSearchClass);
              searcher = new ManagementObjectSearcher(scope, query);


          }
          else
          {
              scope = new ManagementScope();
              scope.Path = new ManagementPath(@"\root\MicrosoftExchangeV2");
              scope.Options.Impersonation = ImpersonationLevel.Impersonate;
              scope.Connect();
              searcher = new ManagementObjectSearcher("SELECT * FROM " + wmiSearchClass);

          }



          ManagementObjectCollection results = searcher.Get();

          textBox5.Text += ("There are " + results.Count + " items in " + wmiSearchClass) + System.Environment.NewLine;
          int count = 0;
          foreach (ManagementObject result in results)
          {

              textBox5.Text += ("=============== " + wmiSearchClass + "[" + count + "] ===============") + System.Environment.NewLine;
              count++;
              PropertyDataCollection pdc = result.Properties;
              foreach (PropertyData pd in pdc)
              {
                  string name = pd.Name;
                  object obj = pd.Value;
                  if (obj != null)
                  {
                      string[] sa = obj as string[];
                      if (sa != null)
                      {
                          string ss = string.Join("\";\"", sa);

                          textBox5.Text += ("SA " + count.ToString() + ": " + name + " = string[] = \"" + ss + "\"") + System.Environment.NewLine;

                      }
                      else
                      {

                          textBox5.Text += (count.ToString() + ": " + name + " = \"" + obj.ToString() + "\"") + System.Environment.NewLine;

                      }
                  }
              }
          }

      }
      catch (Exception ex)
      {
          MessageBox.Show(ex.Message);

      }


  }

QuestionSearch Engine Pin
Software20073-Aug-11 8:55
Software20073-Aug-11 8:55 
AnswerRe: Search Engine Pin
jschell3-Aug-11 9:55
jschell3-Aug-11 9:55 
GeneralRe: Search Engine Pin
Software20073-Aug-11 9:59
Software20073-Aug-11 9:59 
GeneralRe: Search Engine Pin
Alan Balkany4-Aug-11 4:38
Alan Balkany4-Aug-11 4:38 
GeneralRe: Search Engine Pin
jschell4-Aug-11 8:10
jschell4-Aug-11 8:10 
GeneralRe: Search Engine Pin
Alan Balkany4-Aug-11 8:41
Alan Balkany4-Aug-11 8:41 
GeneralRe: Search Engine Pin
jschell5-Aug-11 11:38
jschell5-Aug-11 11:38 
GeneralRe: Search Engine Pin
jschell4-Aug-11 8:14
jschell4-Aug-11 8:14 
QuestionRepetitive calling of code in web application Pin
vanikanc3-Aug-11 4:37
vanikanc3-Aug-11 4:37 
AnswerRe: Repetitive calling of code in web application Pin
Matt Meyer3-Aug-11 4:56
Matt Meyer3-Aug-11 4:56 
AnswerRe: Repetitive calling of code in web application [modified] Pin
Keith Barrow3-Aug-11 5:24
professionalKeith Barrow3-Aug-11 5:24 
Questionlist collections Pin
Satish_S3-Aug-11 2:06
Satish_S3-Aug-11 2:06 
AnswerRe: list collections Pin
BobJanova3-Aug-11 2:17
BobJanova3-Aug-11 2:17 
AnswerREPOST Pin
Not Active3-Aug-11 2:26
mentorNot Active3-Aug-11 2:26 
GeneralRe: REPOST Pin
BobJanova3-Aug-11 2:28
BobJanova3-Aug-11 2:28 
AnswerRe: list collections Pin
PIEBALDconsult3-Aug-11 2:45
mvePIEBALDconsult3-Aug-11 2:45 
QuestionWorking With GridView Pin
md_refay3-Aug-11 1:13
md_refay3-Aug-11 1:13 

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.