Wow. Can't believe it's close to 3 months since posting - just shows how busy life can get sometimes. Anyway, I thought I'd share this script which will tell you how many domain-joined Virtual Server hosts are currently running in your organization. It takes advantage of the SCP (Service Connection Point) marker in Active Directory which was introduced in Virtual Server 2005 R2 SP1 (currently in Beta - not too much longer to wait before release).
On Error Resume Next
Const SCP = "MS Virtual Server"
' 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 'ADS_CHASE_REFERRALS_ALWAYS
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
Either download a text file with the contents here and rename it, or copy the above code into a file "FindServers.vbs". Edit the call to "DoQuery" at the top to put in the appropriate domains for your organization. If you want a list of the machine names as well, uncomment the code-block starting "oRecordSet.MoveFirst" and ending "Loop". To run the script, from a command-line, type "cscript FindServers.vbs".
I enjoyed some Out Of Office days to spent some time in the garden, catching up with some friends and
John, your site was one of the ones I used to go to all the time but since you started in the States, it seems the regular dose of favorite info has dwindled far in between. Hope they pay you to do more postings as you provided technical clarity and incentive for people to look at MS based solutions. For example, your ISCSI and VS based clustering was one of the first for everyone to be based off from... there are alot more we miss...
Another new feature of Virtual Server 2005 R2 SP1 is that it now has an Active Directory marker that
John Howard, Program Manager for Microsoft Windows Virtualization, shares this script which will tell you how many domain-joined Virtual Server hosts are currently running in your organization. It takes advantage of the SCP (Service Connection Point)
I re-wrote it with PowerShell.
See the script at http://msgoodies.blogspot.com/2007/07/finding-virtual-servers-in-domain.html
I seems an eternity ago (May 2007) that I put up a post describing how to determine which domain-joined