title: How to enumerate all of the Properties of a System._comobject
body: <p>I have the following code to generate a list of members of the local administrators group on a machine:</p>
  
  <pre><code>    param([string]$server)
      $localGroupArray =@() 
  
      $groupName = 'Administrators'
      $Group = [ADSI]"WinNT://$Server/$groupName,group" 
      $Members = @($Group.psbase.Invoke("Members"))
      [Array]$class = $members | Foreach {$_.GetType().InvokeMember("Class", 'GetProperty', $null, $_, $null)}
      [Array]$MemberNames = $Members |  ForEach-Object {$_.GetType().InvokeMember("Name", 'GetProperty', $null, $_, $null)}
  </code></pre>
  
  <p>This works as expected but I need to know more information about the object such as domain if it is a domain group.  So I would like to list all of properties that I can query using InvokeMember but I been unable to find a good solution.</p>
  
  <p>Normal ways such as using Get-Member do not work since this is a system._comobject. The following is the output of Get_member on the Comobject:</p>
  
  <pre><code>   Name                      MemberType Definition
     ----                      ---------- ----------
     CreateObjRef              Method     System.Runtime.Remoting.ObjRef                      CreateObjRef(type requestedType)
      Equals                    Method     bool Equals(System.Object obj)
      GetHashCode               Method     int GetHashCode()
      GetLifetimeService        Method     System.Object GetLifetimeService()
      GetType                   Method     type GetType()
      InitializeLifetimeService Method     System.ObjectInitializeLifetimeService()
      ToString                  Method     string ToString() 
  </code></pre>
  
  <p>I have also tried seeing if I could find a c# solution and was able to find this link:  <a href="https://stackoverflow.com/questions/25772156/how-return-the-type-of-a-system-comobject-in-system-type-in-c-sharp">How return the type of a System.__COMObject in System.Type in C#</a></p>
  
  <p>However, the program I wrote did not get any PropertyDescription when I try to run GetProperties on the comobect.  I can also post the c# code if needed but I felt it was a little off topic since I am posting only with the Powershell tag.</p>