The script serves as an example of how to use ldap://RootDSE/ to connect to your AD without hard-coding domain names, and how to enumerate children of [adsi] objects.
The syntax above is intentionally verbose, so that you can see what's going on in the code. However, if you're one of those people that prefer a fluent pipeline, here you go.
- Backup DFS Namespaces Using PowerShell
- Translate Active Directory Name Formats Using PowerShell
- List Linux Users in Active Directory Using PowerShell
- Enable Trust for Delegation in Active Directory Using PowerShell
- TCP/IP Subnet Math with PowerShell - What AD Site is that Server in?
- List Sites and Subnets in Active Directory with PowerShell
- Find Disabled Users in Active Directory with PowerShell
- List Forest-wide Group Memberships with PowerShell
- Find Old Computer Accounts in AD with PowerShell
- List SPNs in Active Directory with PowerShell
- List Domain Controllers in Active Directory