The “Hey, Scripting Guys!” blog has been retired. There are many useful posts in this blog, so we keep the blog here for historical reference. However, some information might be very outdated and many of the links might not work anymore.
New PowerShell content is being posted to the PowerShell Community blog where members of the community can create posts by submitting content in the GitHub repository.
Scripting Blog [archived]
Formerly known as the "Hey, Scripting Guy!" blog
Latest posts

Can I Get a List of All My User Accounts?

Hey, Scripting Guy! Is there any way to get a list of all the user accounts in Active Directory?-- CB, Fremont, CA Hey, CB. By far the quickest and easiest way to do this is to search Active Directory for all your user accounts. Here’s a sample script that searches the fabrikam.com domain; to search your own domain, just edit the LDAP connection string (‘LDAP://dc=fabrikam,dc=com’) as needed. For example, if your domain is named contoso.com, you’d change the connection string to ‘LDAP://dc=contoso,dc=com’. There’s too much going on in this script to explain it all here; if you’re interested in how and why this w...