返回列表 发帖

[转载代码] powershell 查看域的版本

$a=[system.directoryservices.activedirectory.activedirectoryschema]::getcurrentschema()
$b=$a.getdirectoryentry()
switch($b.objectversion)
{
13 {"{0,25}" -f "Schema Version 13 : Windows 2000";break}
30 {"{0,25}" -f "Schema Version 30 : Windows 2003";break}
31 {"{0,25}" -f "Schema Version 31 : Windows 2003 R2";break}
44 {"{0,25}" -f "Schema Version 44 : Windows 2008";break}
47 {"{0,25}" -f "Schema Version 47 : Windows 2008 R2";break}
default {"{0,25} {1,2}" -f "Unknow Schema Version :",$($b.objectversion);break}
}COPY
简单实用,很方便!

返回列表