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 a Windows 2008 R2 DC on which I try to run a PowerShell script that uses the AD module. The loading itself works, the output of Get-Module shows the ActiveDirectory module with its exported cmdlets. But there is a "small" error message saying that the Given key was not present in the dictionary after Import-Module. The error is no real exception, it's just the text displayed in red.

When I try to execute an AD function like Get-ADUser I finally get a real exception with the same message. When I execute Get-Item AD: I get an exception that the drive could not be found.

I have no idea how to fix this. Can anyone help?

Edit: Another server using RSAT behaves exactly like the DC when trying to load the AD module.

share|improve this question
    
Are you running PowerShell with an elevated command prompt (assuming UAC is on)? –  MDMarra Aug 2 '12 at 13:47
    
UAC is turned off in this testing environment. I'm working with the "Administrator" account. –  fero Aug 2 '12 at 13:50
    
interesting link with no real answers support.microsoft.com/kb/2670098 and for some wierd reason I still think its a permissions issue have you tried running the session as administrator I know you say uac is off but... –  tony roth Aug 2 '12 at 14:01
    
@tonyroth I already found that, too. But I'm not sure whether this would help me even if there was an answer. I get the error for the first time when I load the module, so I it could have a different cause. –  fero Aug 2 '12 at 14:06
    
@tonyroth Yes, I started the PowerShell prompt as an administrator. –  fero Aug 2 '12 at 14:18

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.