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.)