0

在没有 RSAT 的服务器中安装 Active Directory

我能够在某些服务器中安装 Active Directory 模块,但在其他服务器中不能安装......

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Install-Module -AllowClobber -SkipPublisherCheck .\Microsoft.ActiveDirectory.Management.dll -ErrorAction Continue -Force
Install-Module -AllowClobber -SkipPublisherCheck .\Microsoft.ActiveDirectory.Management.resources.dll -ErrorAction Continue -Force

我不断收到此错误:

PackageManagement\Install-Package : No match was found for the specified 
search criteria and module name 
'D:\install\ADPoSh\Microsoft.ActiveDirectory.Management.resources.dll'. Try 
Get-PSRepository to see all available registered module repositories.
At C:\Program 
Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1772 
char:21
+ ...          $null = PackageManagement\Install-Package @PSBoundParameters
+                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Microsoft.Power....InstallPacka 
   ge:InstallPackage) [Install-Package], Exception
    + FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.Pac 
   kageManagement.Cmdlets.InstallPackage

我只是将 DLL 从具有 RSAT AD 模块和 C:\Windows\System32\WindowsPowerShell\v1.0\Modules\ActiveDirectory 的系统上的 WinSXS 文件夹复制到同一个文件夹中。我在这里想念什么?

4

1 回答 1

0

导入模块,而不是安装模块

哇,答案就像不使用 Install-Module一样简单,在 RSAT 功能安装之后只运行 Import-Module !:)

所以不是这个:

Get-WindowsFeature -Name RSAT-AD-PowerShell|Install-Windowsfeature
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Install-Module ActiveDirectory -Proxy proxy.verizon.com:80

但是这个:

Get-WindowsFeature -Name RSAT-AD-PowerShell|Install-Windowsfeature
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Import-Module ActiveDirectory -Proxy proxy.verizon.com:80

我的意思是,我想修复 repo,但是,嘿,AD 模块现在可以工作了……是的!

于 2021-08-30T17:39:25.893 回答