标题: [转载代码] powershell 查看域的版本 [打印本页]
作者: xiaopingood 时间: 2012-12-24 17:17 标题: 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}
- }
复制代码
简单实用,很方便!
欢迎光临 批处理之家 (http://bbs.bathome.net/) |
Powered by Discuz! 7.2 |