# encoding: ascii
# api: powershell
# title: AD-GroupMembers_v1
# description: Use this cmdlet to retrieve the directory objects that are members of a certain group in Active Directory.
# version: 0.1
# type: function
# author: Angel-Keeper
# license: CC0
# function: AD-GroupMembers
# x-poshcode-id: 1738
# x-derived-from-id: 1739
# x-archived: 2011-01-02T20:11:21
#
# This cmdlet is part of the Quest ActiveRoles Server product.
#
function AD-GroupMembers() {
param (
$Domen,
$Group,
$User
)
if ($User){$Connection = Get-Credential -Credential $user}
if($Connection){$Member = Get-QADGroupMember -Service $Domen -Identity $Group -Credential $Connection -SizeLimit 0 -ErrorAction SilentlyContinue | Sort Name | Format-Table Name,NTAccountName,Sid,AccountIsDisabled -AutoSize}
else{$Member = Get-QADGroupMember -Service $Domen -Identity $Group -SizeLimit 0 -ErrorAction SilentlyContinue | Sort Name | Format-Table Name,NTAccountName,Sid,AccountIsDisabled -AutoSize}
$Member
}
