It seems an eternity ago (May 2007) that I put up a post describing how to determine which domain-joined servers are running Virtual Server in your domain(s). Well that same functionality is present in Hyper-V, only the SCP or "Service Connection Point" in Active Directory is different - "Microsoft Hyper-V".
Here's a sample VBScript code. Save the contents as "FindServers.vbs" (text file download) and run from an elevated command prompt "cscript FindServers.vbs".
On Error Resume Next
Const SCP = "Microsoft Hyper-V"
' Add as many lines as needed for the domains in your org.
DoQuery "DC=YOURDOMAIN,DC=com", "YOURDOMAIN", SCP
Sub DoQuery(szDomainDN, szDomainShortName, szSCP)
Set oConnection = CreateObject("ADODB.Connection")
Set oCommand = CreateObject("ADODB.Command")
oConnection.Provider = ("ADsDSOObject")
oConnection.Open "Ads Provider"
oCommand.ActiveConnection = oConnection
oCommand.Properties("Page Size") = 99
oCommand.Properties("Searchscope") = &H2 'ADS_SCOPE_SUBTREE
oCommand.Properties("Chase Referrals") = &H60
oCommand.CommandText = _
"select distinguishedName from 'LDAP://" & _
szDomainDN & "' " & _
"where objectCategory='serviceConnectionPoint' " & _
"and cn='" & szSCP & "'"
Set oRecordSet = oCommand.Execute
If Err Then
"ERROR: Unable to find Domain Rooted at: " & _
If Not oRecordSet.EOF Then
wscript.echo szDomainShortName & ":" & _
' If you want to enumerate the machine names,
' uncomment this block of code
'Do Until oRecordSet.EOF
' szNodeName = _
' 'Trim "CN=<szSCP>,CN="
' mid(szNodeName, InStr(szNodeName,",CN=")+4)
' 'Trim the domain DN
' wscript.echo szNodeName
wscript.echo szDomainShortName & ": 0"
set oRecordSet = Nothing
set oCommand = Nothing
set oConnection = Nothing
To use the script, edit the call right at the top to "DoQuery", inserting the appropriate domain for your organisation. Add multiple lines if you have multiple domains. If you want a list of machine names, uncomment the code-block starting "oRecordSet.MoveFirst" and ending "Loop"
So I'm sure you're wondering, how many servers are actively running at Microsoft? With a bit of additional work using the script as the starting point, a simple database and some Excel macro wizardry, I happen to have been tracking the stats internally for some time now. While I can't share the scale, exact numbers and date-ranges for the graph below, you get an idea of the overall trend over a "few" months. (Don't worry about why there's two lines - the blue line is the important one). What I can say is that the current number is in the thousands. Many, many, thousands.
One of the advantages of having Virtualization integrated with Windows is that the Hyper-V (and in fact
Great post, explained really well and I could really understand. Thank you.
My hyper-v installation isn't registered as a service connection point.... Anyway to tell it to register itself? I'm on a 2008 domain with hyper-v on a 2008 box.
David - when the VMMS service starts, it should register the SCP automatically. Are there any errors in the Hyper-V-VMMS event log channel?