Monday 21 February 2011

Quest Powershell Script For Active Directory

How to find group members for n number of groups
$groups=get-content groups.txtForeach($group in $groups){Get-QADGroupMember $groupGet-qadgroup $group}

Find memberof for n number of users with powershell

$users=get-content users.txtForeach($user in $users){get-Qadmemberof $userGet-qaduser $user}
Extract the known attr for "n" number of users
$users= get-content users.txtforeach ($user in $users) {Get-QADuser $user -SerializeValues}

Find the Canonical Name for n number of users

$users= get-content users.txt
foreach ($user in $users) {Get-QADuser $user -sizelimit 0 Format-table canonicalName}

Find the Dispaly Name for n number of users

$users= get-content users.txt
foreach ($user in $users) {Get-QADuser $user -sizelimit 0 Format-table displayname}

Find the Dispaly Name,Caninicalname and Samaccountname for n number of users

$users= get-content users.txt
foreach ($user in $users) {Get-QADuser $user -sizelimit 0 Format-table displayname,canonicalname,samaccountname}

1 comment: