从Windows 2012pipe理Exchange 2010

我们从单独的Windows 2008 R2服务器pipe理Exchange 2010,并最近将pipe理计算机升级到Windows 2012 R2。 EMC的工作正常,但我在壳上有限。 一旦它远程CAS服务器,它下降到PS版本2(按预期),但我不能再导入ActiveDirectory模块2012年的盒子,因为它需要版本3.这是坏的,因为我有几个脚本,使用AD作为以及Exchange模块。

是否可以/支持在Windows 2012上安装旧版本的RSAT? 或者至less得到旧的ActiveDirectory模块?

我知道这听起来像一个简单的问题,谷歌会回答,但我没有find它。 以为我会看到你们知道的:-)

编辑:
错误信息是在底部,但我相信这是没有帮助的。 问题似乎是模块想要版本3.如果我在本地运行PowerShell,它会成功导入。 只有当我远程进入交换服务器(并且下降到版本2)时,它才拒绝加载。

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" 

错误:

 [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 

我不相信您可以在2012年安装Windows 7/2008 R2 RSAT,但是如果您使用的是可以访问域控制器上的端点的帐户(或者安装了ADpipe理/ RSAT的任何其他服务器) ,并且PowerShell远程处理已启用,则可以使用隐式远程将这些cmdlet拉入您自己的会话中:

 $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 

如果您希望从单独的服务器运行脚本,而无需完全安装任何工具(因此可以pipe理任何Exchange环境),则可以使用Exchange执行相同的操作:

 $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 

这还有一个好处,就是不依赖升级Exchange来使用新版本的PowerShell(带有Exchange 2010的版本3+),但是隐式远程引用的所有对象都被反序列化了。