Getting LDAP paths of Active Directory Computers with Powershell

Do you need to see LDAP paths of your all computers in Active Directory?

1
2
3
4
5
6
7
8
$Searcher = New-Object DirectoryServices.DirectorySearcher([ADSI]"")
$Searcher.Filter = "(objectClass=computer)"
$Computers = ($Searcher.Findall()) 
Foreach ($Computer in $Computers)
{
$Path=$Computer.Path
write-host $Path
}

LDAP names can save your life :) You can use LDAP names in your Powershell scripts to manage your computers.

Tags: , , , ,


You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

AddThis Social Bookmark Button

One Response to “Getting LDAP paths of Active Directory Computers with Powershell”

  1. [...] Yusuf Ozturk » Getting LDAP paths of Active Directory Computers … [...]

Leave a Reply