4.0.0 HP PolyServe Software for Microsoft SQL Server Administration Guide (T5392-96056, March 2010)
• Microsoft NTLM
http://msdn.microsoft.com/en-us/library/aa378749(VS.85).aspx
querySpn.vbs script
' Copyright (c) Microsoft Corporation 2004 -
' File: querySpn.vbs
' Contents: Query a given SPN in a given forest to find the owners
' History: 7/7/2004 Craig Wiand Created
Option Explicit
Const DUMP_SPNs = True
Dim oConnection, oCmd, oRecordSet
Dim oGC, oNSP
Dim strGCPath, strClass, strSPN, strADOQuery
Dim vObjClass, vSPNs, vName
ParseCommandLine()
'--- Set up the connection ---
Set oConnection = CreateObject("ADODB.Connection")
Set oCmd = CReateObject("ADODB.Command")
oConnection.Provider = "ADsDSOObject"
oConnection.Open "ADs Provider"
Set oCmd.ActiveConnection = oConnection
oCmd.Properties("Page Size") = 1000
'--- Build the query string ---
strADOQuery = "<" + strGCPath + ">;(servicePrincipalName=" + strSPN + ");" & _
"dnsHostName,distinguishedName,servicePrincipalName,objectClass," & _
"samAccountName;subtree"
oCmd.CommandText = strADOQuery
'--- Execute the query for the object in the directory ---
Set oRecordSet = oCmd.Execute
If oRecordSet.EOF and oRecordSet.Bof Then
Wscript.Echo "No SPNs found!"
Else
While Not oRecordset.Eof
Wscript.Echo oRecordset.Fields("distinguishedName")
vObjClass = oRecordset.Fields("objectClass")
strClass = vObjClass( UBound(vObjClass) )
Wscript.Echo "Class: " & strClass
If UCase(strClass) = "COMPUTER" Then
Wscript.Echo "Computer DNS: " &
oRecordset.Fields("dnsHostName")
Else
Wscript.Echo "User Logon: " &
oRecordset.Fields("samAccountName")
End If
If DUMP_SPNs Then
'--- Display the SPNs on the object ---
vSPNs = oRecordset.Fields("servicePrincipalName")
For Each vName in vSPNs
Wscript.Echo "-- " + vName
Next
End If
Wscript.Echo
oRecordset.MoveNext
Wend
Troubleshooting118