Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 无法将AD模块加载到powershell脚本中_C#_Powershell_Module_Import Module - Fatal编程技术网

C# 无法将AD模块加载到powershell脚本中

C# 无法将AD模块加载到powershell脚本中,c#,powershell,module,import-module,C#,Powershell,Module,Import Module,我正在为我的公司开发一个程序,该程序需要对用户的用户名进行检查,这要求只有在程序打开时才安装广告模块。它在我的电脑上运行良好,但我是一名管理员,运行Windows 10。我的环境的其余部分是Windows 7 我的代码: Import-Module "\\FileServer\common\IT\Powershell\Modules\ActiveDirectory" 错误: Import-Module: Could not load file or assembly 'file://\\bmh

我正在为我的公司开发一个程序,该程序需要对用户的用户名进行检查,这要求只有在程序打开时才安装广告模块。它在我的电脑上运行良好,但我是一名管理员,运行Windows 10。我的环境的其余部分是Windows 7

我的代码:

Import-Module "\\FileServer\common\IT\Powershell\Modules\ActiveDirectory"
错误:

Import-Module: Could not load file or assembly 'file://\\bmh01-fs03\common\IT\Powershell\Modules\ActiveDirectory\Microsoft.ActiveDirectory.Management' or one of its dependencies. The ststem cannot find the file specified.

它是不是在广告模块中?为什么它在我的电脑上工作而不是在用户上工作?

ActiveDirectory模块是一个不可再分发的模块。它是远程服务器管理工具(RSAT)的一部分,您必须将其安装在客户端上


如果要避免这种依赖关系,可以使用
[ADSI]
提供程序查询Active Directory。

Active Directory模块是不可再发行的模块。它是远程服务器管理工具(RSAT)的一部分,您必须将其安装在客户端上


如果要避免此类依赖关系,可以使用
[ADSI]
提供程序查询Active Directory。

如果计算机上没有安装Active Directory模块,则需要下载适用于操作系统的正确远程服务器管理工具(RSAT)包。请参阅:我的理解是,
[adsi]
内容在win7系统上。它在我的上面。如果您只需要一个用户验证测试,则
[adsi]
调用otta即可处理该作业。如果您的计算机上未安装Active Directory模块,则需要下载适用于您的操作系统的正确远程服务器管理工具(RSAT)包。请参阅:我的理解是,
[adsi]
内容在win7系统上。它在我的上面。如果您只需要一个用户验证测试,那么
[adsi]
调用otta就可以处理该作业。