title: Powershell ADSI: Can I query the local Administrators group using a SID?
body: <p>I am in a multilanguage client environment. The local administrators are &quot;Administratoren&quot;, &quot;Administrators&quot;,&quot;Administradores&quot;,&quot;Administrateurs&quot; and so on.
  This works to get the group members using Invoke-Expression:</p>
  <pre><code>PS C:\&gt; Get-LocalGroupMember -SID &quot;S-1-5-32-544&quot;
  
  ObjectClass Name                 PrincipalSource
  ----------- ----                 ---------------
  Benutzer    PC-JOU\Administrator Local          
  Benutzer    PC-JOU\Jou           Local
  </code></pre>
  <p>Working example using the normal group name, for example on a German client WITHOUT needing Invoke-*:</p>
  <pre><code>PS C:\&gt; $ADSI = [ADSI]&quot;WinNT://IP-of-computer/Administratoren&quot;
  PS C:\&gt; $ADSI.Invoke(&quot;Members&quot;) | foreach {$_.GetType().InvokeMember(&quot;ADsPath&quot;, 'GetProperty', $null, $_, $null)}
  WinNT://PC-JOU/Administrator
  WinNT://PC-JOU/Jou
  </code></pre>
  <p>But I cannot get this to work with a SID to have this international:</p>
  <pre><code>PS C:\&gt; $ADSI = [ADSI]&quot;WinNT://IP-of-computer/S-1-5-32-544&quot;
  PS C:\&gt; $ADSI.Invoke(&quot;Members&quot;) | foreach {$_.GetType().InvokeMember(&quot;ADsPath&quot;, 'GetProperty', $null, $_, $null)}
  Ausnahme beim Abrufen des Elements &quot;Invoke&quot;: &quot;Der Gruppenname konnte nicht gefunden werden.&quot;
  In Zeile:1 Zeichen:1
  + $ADSI.Invoke(&quot;Members&quot;) | foreach {$_.GetType().InvokeMember(&quot;ADsPath ...
  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : NotSpecified: (:) [], ExtendedTypeSystemException
      + FullyQualifiedErrorId : CatchFromBaseGetMember
  </code></pre>
  <p>I got so far to see the propertyvalue of the sid:</p>
  <pre><code>PS C:\&gt; $ADSI.objectSid
  1
  2
  0
  0
  0
  0
  0
  5
  32
  0
  0
  0
  32
  2
  0
  0
  
  PS C:\&gt; $ADSI.objectSid.GetType()
  
  IsPublic IsSerial Name                                     BaseType                                                                                                                                          
  -------- -------- ----                                     --------                                                                                                                                          
  True     False    PropertyValueCollection                  System.Collections.CollectionBase                                                                                                                 
  </code></pre>
  <p>Any idea how I can get this to work, using [ADSI] with the SID value of the local admin? It would save me using Invoke-Expression method.</p>