1

We have been managing Exchange 2010 from a separate Windows 2008 R2 server and recently upgraded the management machine to Windows 2012 R2. The EMC works fine but I am somewhat limited in the shell. Once it remotes to the CAS server, it drops to PS version 2 (as expected) but then I can no longer import the ActiveDirectory module on the 2012 box because it demands version 3. This is bad because I have several scripts that use AD as well as Exchange modules.

Is it possible/supported to install the older version of the RSAT on Windows 2012? Or at least get the older ActiveDirectory module?

I know that this sounds like a simple question that google would answer but I'm not finding it. Thought I'd see what you guys know :-)

Edit:
The error message is on the bottom but I believe this is not helpful. The problem seems to be that the module wants version 3. It imports successfully if I run powershell locally. Only when I remote into the exchange server (and it drops to version 2) does it refuse to load.

PS C:\> cat (Get-Module -Name ActiveDirectory).Path | select -First 10
@{
GUID="{43c15630-959c-49e4-a977-758c5cc93408}"
Author="Microsoft Corporation"
CompanyName="Microsoft Corporation"
ModuleVersion="1.0.0.0"
PowerShellVersion="3.0"
CLRVersion="4.0"
Copyright="© Microsoft Corporation. All rights reserved."
NestedModules="Microsoft.ActiveDirectory.Management"
RequiredAssemblies="Microsoft.ActiveDirectory.Management"

Error:

[PS] C:\>Import-Module ActiveDirectory
Import-Module : The 'C:\Windows\system32\WindowsPowerShell\v1.0\Modules\ActiveDirectory\ActiveDirectory.psd1' 
module cannot be imported because its manifest contains one or more members
that are not valid. The valid manifest members are ('ModuleToProcess', 
blah, blah, blah... 'CmdletsToExport'). Remove the members that are not
valid ('HelpInfoUri'), then try to import the module again.
At line:1 char:14
+ Import-Module <<<<  ActiveDirectory
  + CategoryInfo          : InvalidData: 
    (C:\Windows\syst...eDirectory.psd1:String) [Import-Module], 
    InvalidOperationException
+ FullyQualifiedErrorId : Modules_InvalidManifestMember,
  Microsoft.PowerShell.Commands.ImportModuleCommand
  • Could you add the specific error message to your question? – dbr Apr 10 '15 at 21:50
  • I know you can't install the old RSAT on windows 8 so my guess is you can't put it on 2012 either. – Todd Wilcox Apr 14 '15 at 1:27
0

I don't believe you can install the Windows 7/2008 R2 RSAT on 2012, but if you're using an account that has access to an endpoint on a domain controller (or really any other server with the AD management/RSAT installed), and PowerShell remoting is enabled, you could use implicit remoting to pull those cmdlets into your own session:

$SessionParameters = @{
    ComputerName = <server with AD management tools installed>
    Name = 'Microsoft.ActiveDirectory'
    Authentication = 'Kerberos'
    ErrorAction = 'Stop'
}
$Session = New-PSSession @SessionParameters

$InvokeProperties = @{
    ScriptBlock = { $env:ADPS_LoadDefaultDrive = 0; Import-Module -Name 'ActiveDirectory' }
    Session = $Session
    ErrorAction = 'Stop'
}
Invoke-Command @InvokeProperties

$ImportProperties = @{
    Session = $Session
    Module = 'ActiveDirectory'
    ErrorAction = 'Stop'
}
[void]Import-PSSession @ImportProperties

$Session

You can do the same thing with Exchange if you wanted to run scripts from a separate server without having any tools installed altogether (and therefore would be able to manage any Exchange environment):

$SessionParameters = @{
    ConnectionURI = "http://<Exchange server>/PowerShell"
    ConfigurationName = 'Microsoft.Exchange'
    Authentication = 'Kerberos'
    ErrorAction = 'Stop'
}
$Session = New-PSSession @SessionParameters

$ImportParameters = @{
    Session = $Session
    ErrorAction = 'Stop'
}
[void]Import-PSSession @ImportParameters

$Session

This also has the added benefit of not being dependent on upgrading Exchange to use a new version of PowerShell (version 3+ with Exchange 2010 comes to mind), but with the con that all objects referenced by implicit remoting are deserialized.

  • Awesome! I'll have to update a lot of scripts but at least I'll be able to use them. Thanks – bob Apr 14 '15 at 13:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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