You are using the Active Directory CMDLets coming with Windows Server 2008 R2 and Windows 7 Remote Administration tools to interrogate Active Directory Objects. When you print results of the Get-ADObjects CMDLets you get the output:
The given key was not present in the dictionary.
When launching Active Directory Administrative Center the Domain Controller chosen appears to be down. When you click on the domain controller you receive the error message “Failed to access the object. Check data availability or access permissions”:
When selecting “Change Domain Controller” you receive the error Message “Failed to retrieve Domain Controller information”:
The Powersehll CmdLet wants to format the attributes for output and it has a special handling for a number of attributes. This for example includes linked attributes. To track this correctly, the Powershell CmdLet retrieves a list of interesting attributes from the Active Directory.
It then checks this list against the list of attributes retrieved for the Aggregate Schema. The problem occurs when the query returns an attribute that is not in the Aggregate schema.
This can happen for Defunct Attributes that are still returned by the Powerhell query, which are not present in the Aggregate Schema.
When you create a Log of the AD Web Service, you see the schema query as:
ParseEnumerate: [timestamp] [b] filter=(&(objectClass=attributeSchema)(|(attributeSyntax=184.108.40.206)(linkID=*)(systemFlags:1.2.840.1135220.127.116.113:=4))), scope=Subtree, baseObject=CN=Schema,CN=Configuration,DC=<forestroot>
Retrieve the List of attributes the powershell CmdLet asks for, execute on a DC:
Ldifde /s %computername% /d CN=Schema,CN=Configuration,DC=<forestroot> /r "(&(objectClass=attributeSchema)(|(attributeSyntax=18.104.22.168)(linkID=*)(systemFlags:1.2.840.113522.214.171.1243:=4)))" /f powershell-query.txt
Then export the same list, this time without the attributes that are defunct:
Ldifde /s %computername% /d CN=Schema,CN=Configuration,DC=<forestroot>/r "(&((!(isdefunct=TRUE))(objectClass=attributeSchema))(|(attributeSyntax=126.96.36.199)(linkID=*)(systemFlags:1.2.840.1135188.8.131.523:=4)))" /f powershell-query-without-defunct.txt
Compare powershell-query.txt with powershell-query-without-defunct.txt using a tool like WinDiff from from the Platform SDK. It would show the extra attributes quite nicely.
The schema attribute should have a property that makes it match the original filter, like it's storing a Sid, is a constructed attribute (would be unusual), but the most common cause should be that a defunct attribute still has a linkID set.
To resolve the problem, you should delete the linkID attribute from the defunct attribute.