“Get-QADUser”未被识别为cmdlet的名称

时间:2014-07-15 06:54:40

标签: powershell active-directory powershell-v3.0

我正在尝试使用某些过滤条件从AD中获取用户,但在执行Get-QADUser时#39;命令我收到以下错误。

Get-QADUser : The term 'Get-QADUser' 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.
At line:1 char:1
+ Get-QADUser
+ ~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Get-QADUser:String) [], CommandNotFoundExce 
   ption
    + FullyQualifiedErrorId : CommandNotFoundException

任何人都可以告诉我如何解决这个问题?

我使用以下参考链接

http://wiki.powergui.org/index.php/Get-QADUser

1 个答案:

答案 0 :(得分:2)

QAD cmdlets FAQ

  

为一个特定脚本加载QAD cmdlet:

     

在脚本的开头添加此行:

Add-PSSnapin Quest.ActiveRoles.ADManagement -ErrorAction Stop
     

使QAD cmdlet可用于特定计算机上的所有脚本:

     

打开PowerShell配置文件(例如,通过启动PowerGUI脚本编辑器并选择文件/打开当前用户配置文件)。将此行添加到配置文件代码:

Add-PSSnapin Quest.ActiveRoles.ADManagement -ErrorAction Stop

PS。原始任务文章推荐-ErrorAction SilentlyContinue,但我不同意这一点。

相关问题