Dan*_*iel 3 powershell active-directory
我是 Powershell 和 AD 的新手。我在 PS 中使用 AD 模块时遇到了麻烦。使用任何命令都会出现以下错误:
Get-ADDomain : Unable to contact the server. This may be because this server does not exist, it is currently down, or it does not have the Active Directory Web Services
running.
At line:2 char:1
+ Get-ADDomain -Current LocalComputer
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (lon.intensive.int:ADDomain) [Get-ADDomain], ADServerDownException
+ FullyQualifiedErrorId : ActiveDirectoryServer:0,Microsoft.ActiveDirectory.Management.Commands.GetADDomain
Run Code Online (Sandbox Code Playgroud)
有趣的是我可以使用 ADExplorer 并查看域、用户及其所有属性。ADExplorer 与 Powershell 中的脚本有何不同?
您的域控制器是什么操作系统?AD cmdlet 必须连接到运行 Active Directory Web 服务的域控制器。这在 Windows 2008 R2 和更新的域控制器上是自动的,但在 Windows 2008 和 Windows 2003 上,您需要单独安装它。理想情况下,您已经摆脱了所有 Windows 2003 DC,因为它不再受支持。2008年也变得很老了。但是,如果您不能,那么您应该在所有下层 DC 上安装 ADWS,以便您可以使用 AD cmdlet。
您可以使用它来查找运行它的 DC。您可以在其余 AD cmdlet的参数中使用该调用的结果(或用于在脚本中设置一次)。但是如果这没有返回任何 DC,那么您需要安装 ADWS。Get-ADDomainController-Discover -Service ADWS-Server$PSDefaultParameterValues
| 归档时间: |
|
| 查看次数: |
17451 次 |
| 最近记录: |