2 ' This script uses WMI to get the name of the machine be used as the CN ' for the certificates for WCF security samples.
4 set wmi
= Getobject("winmgmts:")
5 wql
= "select * from win32_computersystem"
6 set results
= wmi
.execquery(wql
)
7 for each compsys
in results
8 'check if the machine is in the workgroup or domain
9 if compsys
.PartOfDomain
= 0 or compsys
.Domain
= compsys
.Workgroup
then
10 ' only get the name of the machine
11 WScript
.echo compsys
.name
13 ' get the fully qualified name of the machine
14 n
= compsys
.name
& "." & compsys
.domain