首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >术语“Get-ADUser”未被识别为cmdlet的名称

术语“Get-ADUser”未被识别为cmdlet的名称
EN

Stack Overflow用户
提问于 2013-07-09 20:46:13
回答 6查看 488.4K关注 0票数 109

我使用以下查询列出了Windows2008服务器中的用户,但失败了,并得到以下错误。

代码语言:javascript
运行
复制
$server='client-pc-1';$pwd= convertto-securestring 'password$' -asplaintext -
force;$cred=new-object  -typename System.Management.Automation.PSCredential -argumentlist 'Administrator',$pwd; invoke-command -computername $server -credential 
$cred -scriptblock {Get-ADUser -Filter (enabled -ne $true)}

这个例外是给below...Can的,有人能帮我解决这个问题吗?

代码语言:javascript
运行
复制
The term 'Get-ADUser' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct 
and try again.
    + CategoryInfo          : ObjectNotFound: (Get-ADUser:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
EN

回答 6

Stack Overflow用户

发布于 2013-07-09 20:50:25

如果存在ActiveDirectory模块,请添加

代码语言:javascript
运行
复制
import-module activedirectory

在你的代码之前。

要检查是否存在,请尝试:

代码语言:javascript
运行
复制
get-module -listavailable

windows server 2008 R2中默认存在ActiveDirectory模块,请按如下方式安装:

代码语言:javascript
运行
复制
Import-Module ServerManager
Add-WindowsFeature RSAT-AD-PowerShell

为了使其正常工作,您需要域中至少有一个域控制器作为windows 2008 R2,并且在其上安装了Active Directory Web服务(ADWS)。

对于Windows Server 2008,请阅读here how to install it

票数 140
EN

Stack Overflow用户

发布于 2017-07-10 20:25:45

代码语言:javascript
运行
复制
get-windowsfeature | where name -like RSAT-AD-PowerShell | Install-WindowsFeature
票数 13
EN

Stack Overflow用户

发布于 2014-08-20 01:01:06

如果你看不到Active Directory,那是因为你没有安装AD LS用户和计算机功能。转到Manage - Add Roles &Feature。在添加角色和功能向导的功能选项卡上,选择远程服务器管理工具,然后选择-角色管理工具-选择AD DS和DF LDS工具。

之后,您可以看到PS Active Directory包。

票数 7
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/17548523

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档