Windows Server 2016目录服务ForestMode枚举-“未知" [英] Windows Server 2016 Directory Services ForestMode Enumeration - 'Unknown'

查看:254
本文介绍了Windows Server 2016目录服务ForestMode枚举-“未知"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

命名空间:  System.DirectoryServices.ActiveDirectory
操作系统-Windows Server 2016 RTM
角色-目录服务
问题类别-.Net Framework ForestMode枚举
.Net版本-.NET Framework 4.6.2
AD DS森林-xyz.com
操作系统-有问题的服务器在Windows Server 2016 RTM上运行
ForestMode-Windows2016Forest
问题-我试图通过独立服务器(尚不属于xyz.com域的一部分)枚举xyz.com林的森林模式,同时通过与xyz.com林的企业管理员进行身份验证来创建directorycontext对象.我希望"Windows2016Forest" 作为输出,但是显示为未知".有趣的是,当我在xyz.com的DC上运行Get-ADForest时,确实获得了所需的输出,这使我相信.Net不会为forestmode返回正确的值.而这只是在发生 对于Windows Server 2016服务器.
为什么会有这种差异?如果有解决方案,那是什么?我们何时可以通过.Net方式返回除正确值以外的值?

$ ForestContext =新对象System.DirectoryServices.ActiveDirectory.DirectoryContext('forest','xyz.com','user@xyz.com','Password')
$ ForestInfo = [System.DirectoryServices.ActiveDirectory] ​​:: GetForest($ forestcontext)
$ forest.ForestMode
未知"

问候,
塔伦·拉杰文什(Tarun Rajvanshi)


解决方案

您好Tarun Rajvanshi,

命名空间: System.DirectoryServices.ActiveDirectory
OS-Windows Server 2016 RTM
角色-目录服务
问题类别-.Net Framework ForestMode枚举
.Net版本-.NET Framework 4.6.2
AD DS森林-xyz.com

我已经对您的代码进行了测试,是的,我的测试结果与您的相同.

因为直到现在,Windows Server 2016仍已安装.Net 4.6作为OS中的功能.但是我们的命名空间 System.DirectoryServices.ActiveDirectory 不支持.net4.6.解决方法是卸载.Net framework 4.6.它将起作用.

<身体>
Windows2012R2Forest

[.NET Framework 4.5.1和更高版本中受支持] 解决方案

Hi Tarun Rajvanshi,

Namespace:   System.DirectoryServices.ActiveDirectory
OS - Windows Server 2016 RTM
Role - Directory Services
Issue Category - .Net Framework ForestMode Enumeration
.Net Version - .NET Framework 4.6.2
AD DS Forest - xyz.com

I've tested on your code, yes, my test result is the same as yours.

Because until now Windows Server 2016 is installed .Net 4.6 as a feature in OS. But our namespace System.DirectoryServices.ActiveDirectory is not support .net4.6. The workaround is uninstall .Net framework 4.6. It will works.  

Windows2012R2Forest

[Supported in the .NET Framework 4.5.1 and later versions] The Forest is operating in Windows Server 2012 R2 mode.


这篇关于Windows Server 2016目录服务ForestMode枚举-“未知"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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