Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have an AD: drive, which should allow me to browse active directory from within Powershell. But when I try to use it, it will not let me navigate beyond the root. From what I have read the given commands should work, but they are failing.

PS AD:\> ls

Name                 ObjectClass          DistinguishedName
----                 -----------          -----------------
company              domainDNS            DC=company,DC=com
Configuration        configuration        CN=Configuration,DC=company,DC=com
Schema               dMD                  CN=Schema,CN=Configuration,DC=company,DC=com
ForestDnsZones       domainDNS            DC=ForestDnsZones,DC=company,DC=com
DomainDnsZones       domainDNS            DC=DomainDnsZones,DC=company,DC=com

PS AD:\> cd schema
Set-Location : Cannot find path 'AD:\schema' because it does not exist.
At line:1 char:3
+ cd <<<<  schema
    + CategoryInfo          : ObjectNotFound: (AD:\schema:String) [Set-Location], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetLocationCommand

PS AD:\> cd Schema
Set-Location : Cannot find path 'AD:\Schema' because it does not exist.
(duplicate of previous error)

PS AD:\> cd company
Set-Location : Cannot find path 'AD:\company' because it does not exist.
(duplicate of previous error)

PS AD:\> ls Schema
Get-ChildItem : Cannot find path '//RootDSE/Schema' because it does not exist.
(duplicate of previous error)

PS AD:\> cd ForestDnsZones
Set-Location : Cannot find path 'AD:\ForestDnsZones' because it does not exist.
(duplicate of previous error)
share|improve this question

2 Answers 2

up vote 6 down vote accepted

You need to use the Distinguished name. Try cd dc=company,dc=com. Note that tab completion works well here. So try cd dc=comp <tab>. It should expand to the whole DN

share|improve this answer

That's because you need to use the DistinguishedName, not the Name.

PS AD:\> cd "DC=Company,DC=Com"
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.