术语“Get-ADUser”未被识别为cmdlet的名称 [英] The term 'Get-ADUser' is not recognized as the name of a cmdlet

查看:1127
本文介绍了术语“Get-ADUser”未被识别为cmdlet的名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



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



Hi All,

I have used the following query to list the users in a windows 2008 server, but failed and got the below error.

$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)}





下面给出例外情况......





The exception is given below...

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





有谁能帮我解决这个问题?



谢谢&问候

Sebastian



Can anyone help me to solve this?

Thanks & Regards
Sebastian

推荐答案

server ='client-pc-1';
server='client-pc-1';


pwd = convertto-securestring'password
pwd= convertto-securestring 'password


' - asplaintext -
force;
' -asplaintext - force;


这篇关于术语“Get-ADUser”未被识别为cmdlet的名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆