title: Running powershell script in different OS
body: <p>I am trying to run the below mentioned command in Server 2012 &amp; it's pulling users from Administrators user group. But in Server 2008R2, it's pulling from entire domain </p>
  
  <pre><code>Get-WmiObject -Class Win32_GroupUser `
  | where{$_.GroupComponent -like "*Administrators*"} `
  |foreach { 
  $data = $_.PartComponent -split "\," 
  $data[1].Remove(0,5).Replace('"','') 
  } 
  </code></pre>