相关疑难解决方法(0)

术语"Get-ADUser"未被识别为cmdlet的名称

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

$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)}
Run Code Online (Sandbox Code Playgroud)

例外如下:任何人都可以帮我解决这个问题吗?

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
Run Code Online (Sandbox Code Playgroud)

powershell

88
推荐指数
6
解决办法
35万
查看次数

标签 统计

powershell ×1