1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<code>Option</code> <code>Explicit</code>
<code>' Declare variables</code>
<code>Dim</code> <code>sDomain</code>
<code>Dim</code> <code>oDomain</code>
<code>Dim</code> <code>oComputer</code>
<code>' This string specifies the domain (change to suit your needs)</code>
<code>sDomain = </code><code>"LDAP://cn=Computers,dc=testone,dc=local"</code>
<code>' Open the domain specified by sDomain</code>
<code>Set</code> <code>oDomain = GetObject(sDomain)</code>
<code>' Iterate through each computer in the domain</code>
<code>For</code> <code>Each</code> <code>oComputer </code><code>In</code> <code>oDomain</code>
<code> </code><code>' Display name and GUID text on the screen</code>
<code> </code><code>WScript.Echo oComputer.Name & vbTab & oComputer.GUID</code>
<code>Next</code>
*注意修改 "LDAP://cn=Computers,dc=testone,dc=local"
将上述保存为ShowGUID.vbs,并在CMD中运行:
<code>cscript ShowGUID.vbs</code>
查看本机的GUID,在powershell或者CMD下执行:
<code>WMIC</code>
<code>csproduct list full</code>
<code></code>
本文转自 bannerpei 51CTO博客,原文链接:http://blog.51cto.com/281816327/1617721,如需转载请自行联系原作者