小编Kid*_*mba的帖子

Import-Module:未加载指定的模块"activedirectory",因为在任何模块目录中都找不到有效的模块文件

我在Server 2008 SP2(64位)上执行导入模块ActiveDirectory时遇到问题.

  • 已安装.NET Framework 3.5 SP1
  • 我下载了Windows6.0-KB968934-x86.msu(适用于ADWS)
  • 此文件未安装说"更新不适用于我的系统"
  • 做一些研究(http://anti-american.rssing.com/chan-2091246/all_p15.html)我在KB文章969166中安装了修补程序并安装了上述更新.
  • 重新启动后,我注意到在服务中,Active Directory Web服务正在运行
  • 我打开了一个管理PS提示符并执行了一个Import-Module ActiveDirectory,但......

......我明白了:

Import-Module : The specified module 'activedirectory' was not loaded because no valid     module file was found in any module directory.
At line:1 char:14
+ import-module <<<<  activedirectory
    + CategoryInfo          : ResourceUnavailable: (activedirectory:String) [Import-    Module], FileNotFoundException
    + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand
Run Code Online (Sandbox Code Playgroud)

如果有任何帮助,这里是PSModule Path,模块和版本中的一些信息:

PS C:\Windows\system32> $env:PSModulePath
C:\Users\ischmd\Documents\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules\

PS C:\Windows\system32> Get-Module -ListAvailable

ModuleType Name                      ExportedCommands
---------- ----                      ----------------
Manifest   BitsTransfer              {}
Manifest   PSDiagnostics             {}

PS …
Run Code Online (Sandbox Code Playgroud)

active-directory powershell-2.0 windows-server-2008

25
推荐指数
4
解决办法
12万
查看次数

Powershell 字节数组到 INT

我有一个带有两个值的字节数组:07DE(十六进制)。

我需要做的是以某种方式连接07DE并从该十六进制值中获取十进制值。在这种情况下,它是2014

我的代码:

# This line gives 11 bytes worth of information
[Byte[]] $hexbyte2 = $obj.OIDValueB

# All I need are the first two bytes (the values in this case are 07 and DE in HEX)
[Byte[]] $year = $hexbyte2[0], $hexbyte2[1]
Run Code Online (Sandbox Code Playgroud)

我如何组合这些来制作07DE并将其转换为 int 以获取2014

arrays powershell byte type-conversion

3
推荐指数
1
解决办法
9855
查看次数