In attempting to answer this question I came up against something that has bugged me for a while, and I have not been able to find an answer for.
The following script block will list the names of all members of the local administrators group.
$group = [ADSI]"WinNT://./Administrators"
@($group.Invoke("Members")) | foreach {$_.GetType().InvokeMember("Name", 'GetProperty', $null, $_, $null)}
However it will list only the names, and no other properties.
I'm fairly sure that there are other properties of Members
that I could extract but I don't understand how I would go about identifying what those other properties are.
I don't necessarily need to know the additional properties of that item, this is more a question of how I would go about finding them.
(I apologise if this is all a bit vague, I'm very much self taught at all of this and I'm well aware that I might be barking up the wrong tree and/or making regular horrible mistakes.)
Best Answer
Please see available properties here:
http://msdn.microsoft.com/en-us/library/aa705950(v=VS.85).aspx
and a similar example to your question:
http://social.technet.microsoft.com/Forums/windowsserver/en-US/b4d51781-e304-45b1-a7b1-c21b62263540/adsi-local-group-enum-from-fancy-powershell-to-simple-foreach-rewrite?forum=winserverpowershell
Since you are already getting a list of members names for the group, to get the details of the members I would just requery again, except against the individual user instead of the group.