Wednesday 28 April 2010

Find all enabled/disabled AD users

QuestWinsows PowerShell
Find all enabled AD usersget-qaduser -includeallproperties -ldapfilter "(!(userAccountControl:1.2.840.113556.1.4.803:=2))"
# Get Enabled users only
Get-QADUser -Enabled -SizeLimit 0
- or -
# Get Disabled users only
Get-QADUser -Disabled -SizeLimit 0

Tuesday 27 April 2010

How to find group membership for “n” number of users


How to find group membership for “n” number of users

Quest ActiveRoles Management Shell for Active Directory

1. How to find all users


Quest ActiveRoles Management Shell for Active Directory

Prereqisites :1: Windows XP, 2003, 2008
2: Powershell 1 or 2
3: DOT Net 3.5

*************************************
2.How to find all groups
Get-QADGroup

Monday 26 April 2010

How to find group members for n number of groups

$groups=get-content groups.txt
Foreach($group in $groups)
{

Get-QADGroupMember $group
Get-qadgroup $group

}

Find memberof for n number of users with powershell

$users=get-content users.txt
Foreach($user in $users)
{

get-Qadmemberof $user
Get-qaduser $user

}