In SharePoint, if you want to enumerate all the users in the Farm Administrators group, you can use the following script.
#Provide the URL of SharePoint Central Administration
$caURL = "http://sp2010:1000"
$CentralAdmin = new-Object Microsoft.SharePoint.SPSite($caURL)
$RootWeb = $centralAdmin.RootWeb
#Get all the Group Users... in our case it is "Farm Administrators"
$GroupUsers = $RootWeb.SiteGroups["Farm Administrators"]
foreach ($User in $GroupUsers.Users)
As a matter of fact, you can change the URL to any Web Application and get any Group information using the code above.
Hope this helps,
Quote of the day:
If I knew I was going to live this long, I'd have taken better care of myself. - Mickey Mantle