Get-ADComputer 不适用于 Windows Server 2012 R2?

Get-ADComputers doesnt work on Windows Server 2012 R2?

我想在 Windows Server 2012 R2 的 PC 上 运行 一个脚本,但它停在 Get-ADComputer

它说它不是 Cmdlet,但同样的脚本在我的 Windows 10 上运行良好。

有人知道如何解决这个问题吗?

您是否导入了 ActiveDirectory 模块?

Import-Module activedirectory