Get a Quick Count of Users in Each OU

You never know when you need odd little tidbits of information out of Active Directory. Here’s a quick script you can run using the Active Directory Module for PowerShell to get a count of users in each of your OUs. Just replace “ou=Employees,dc=domain,dc=com” with the CN path to OU you use for all user accounts.   $BaseOU = “ou=Employees,dc=domain,dc=com” $DNs = (Get-ADOrganizationalUnit -Filter * –SearchBase […]

Read Me 4 Comments

Get a list of your Group Policy Objects using PowerShell

I use this cmdlet for periodic auditing of Group Policies: Get-GPO -All | select DisplayName, ID, Description, CreationTime, ModificationTime | Export-Csv c:\temp\GPOs.csv -NoTypeInformation This produces a CSV file with the following information: Default Domain Policy xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Created with AD installation 9/1/2009 15:31 12/12/2012 19:05 Another Group Policy xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Description for GPO 2 10/3/2009 17:45 10/4/2009 9:23 Policy Three xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Description for GPO 3 4/16/2010 20:01 […]

Read Me 3 Comments