Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Array.au3"
- Global $_nice_COMerrorArray, $_nice_COMerrorObj
- _nice_COMerrorHandler(1) ; COM error handler.
- ; Generated by AutoIt ScriptOMatic
- ; Description: Represents a Secure Sockets Layer (SSL) binding.
- Local $wbemFlagReturnImmediately = 0x10
- Local $wbemFlagForwardOnly = 0x20
- Local $colItems = ""
- Local $sComputer = "."
- Local $sUser = ""
- Local $sPassword = ""
- Local $sReturn=""
- FileDelete(@TempDir & "\ScriptOMatic.SSLBinding2.txt")
- If $sComputer & $sUser & $sPassword = "." Then
- ToolTip("...ObjGet", @DesktopWidth - 30,@DesktopHeight - 130, "ScriptOMatic - SSLBinding2",1,4)
- Local $oWMIService = ObjGet("winmgmts:\\" & $sComputer & "\root\WebAdministration")
- If Not IsObj($oWMIService) Then Exit MsgBox(262144, "WMI ScriptOMatic error", "ObjGet failed")
- Else
- ToolTip("...ObjCreate", @DesktopWidth - 30,@DesktopHeight - 130, "ScriptOMatic - SSLBinding2",1,4)
- Local $wmiLocator = ObjCreate("WbemScripting.SWbemLocator")
- If Not IsObj($wmiLocator) Then Exit MsgBox(262144, "WMI ScriptOMatic error", "ObjCreate failed")
- ToolTip("...ConnectServer", @DesktopWidth - 30,@DesktopHeight - 130, "ScriptOMatic - SSLBinding2",1,4)
- Local $oWMIService = $wmiLocator.ConnectServer($sComputer, "\root\WebAdministration", $sUser, $sPassword)
- If Not IsObj($oWMIService) Then Exit MsgBox(262144, "WMI ScriptOMatic error", "ConnectServer failed")
- EndIf
- ToolTip("...ExecQuery", @DesktopWidth - 30,@DesktopHeight - 130, "ScriptOMatic - SSLBinding2",1,4)
- Local $colItems = $oWMIService.ExecQuery("SELECT * FROM SSLBinding2", _
- "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly)
- ToolTip("...ExecQuery executed."& @CR &"...waiting for data.", @DesktopWidth - 30,@DesktopHeight - 130, "ScriptOMatic - SSLBinding2",1,4)
- If IsObj($colItems) Then
- Local $iCounter = 0
- For $objItem In $colItems
- $iCounter += 1
- If Not Mod( $iCounter , 100 ) Then
- ToolTip("...adding "& $iCounter &" of ??", @DesktopWidth - 30,@DesktopHeight - 130, "ScriptOMatic - SSLBinding2",1,4)
- FileWriteLine(@TempDir & "\ScriptOMatic.SSLBinding2.txt", $sReturn )
- $sReturn = ""
- EndIf
- $sReturn &= "BindingOwnerID: " & $objItem.BindingOwnerID & @CRLF
- $sReturn &= "CertificateCheckMode: " & $objItem.CertificateCheckMode & @CRLF
- $sReturn &= "CertificateHash: " & $objItem.CertificateHash & @CRLF
- $sReturn &= "CTLIdentifier: " & $objItem.CTLIdentifier & @CRLF
- $sReturn &= "CTLStoreName: " & $objItem.CTLStoreName & @CRLF
- $sReturn &= "HostName: " & $objItem.HostName & @CRLF
- $sReturn &= "IPAddress: " & $objItem.IPAddress & @CRLF
- $sReturn &= "Port: " & $objItem.Port & @CRLF
- $sReturn &= "RevocationFreshnessTime: " & WMIDateStringToDate($objItem.RevocationFreshnessTime) & @CRLF
- $sReturn &= "RevocationURLRetrievalTimeout: " & WMIDateStringToDate($objItem.RevocationURLRetrievalTimeout) & @CRLF
- $sReturn &= "SslAlwaysNegoClientCert: " & $objItem.SslAlwaysNegoClientCert & @CRLF
- $sReturn &= "SslUseDsMapper: " & $objItem.SslUseDsMapper & @CRLF
- $sReturn &= "StoreName: " & $objItem.StoreName & @CRLF
- $sReturn &= @CRLF
- Next
- ;ConsoleWrite($sReturn)
- FileWriteLine(@TempDir & "\ScriptOMatic.SSLBinding2.txt", $sReturn )
- Run(@ComSpec & " /c start " & @TempDir & "\ScriptOMatic.SSLBinding2.txt" , @TempDir, @SW_HIDE)
- Else
- MsgBox(262144 ,"WMI ScriptOMatic error","No WMI Objects Found for class: " & "SSLBinding2" )
- EndIf
- If $_nice_COMerrorArray[0][0] Then _nice_COMerrorHandler(2)
- Func WMIDateStringToDate($dtmDate)
- Return (StringMid($dtmDate, 5, 2) & "/" & _
- StringMid($dtmDate, 7, 2) & "/" & StringLeft($dtmDate, 4) _
- & " " & StringMid($dtmDate, 9, 2) & ":" & StringMid($dtmDate, 11, 2) & ":" & StringMid($dtmDate,13, 2))
- EndFunc
- #Region # ValueToDescription Functions #
- #EndRegion # ValueToDescription Functions #
- Func _nice_COMerrorHandler($i = 0)
- If $i == 1 Then
- Dim $_nice_COMerrorArray[301][9]
- $_nice_COMerrorArray[0][0] = 0
- $_nice_COMerrorObj = ObjEvent("AutoIt.Error", "_nice_COMerrorHandler")
- Return
- EndIf
- If $i == 2 Then
- If Not @Compiled Then
- Local $n = 0, $c = 0, $s = FileRead(@ScriptFullPath)
- Local $a = StringSplit($s, @CRLF, 1)
- For $n = 1 To $_nice_COMerrorArray[0][0]
- If Int($_nice_COMerrorArray[$n][7]) > $a[0] Then ContinueLoop
- $_nice_COMerrorArray[$n][8] = StringStripWS($a[Int($_nice_COMerrorArray[$n][7])], 3)
- Next
- If StringInStr($s, "; only for the ANSI compiled version" & @CRLF) Then
- For $n = 1 To $a[0]
- If StringInStr($a[$n], "; only for the ANSI compiled version") Then $c += 1
- If $n > 50 Then ExitLoop
- Next
- For $n = 1 To $_nice_COMerrorArray[0][0]
- $_nice_COMerrorArray[$n][7] = $_nice_COMerrorArray[$n][7] - $c
- Next
- EndIf
- EndIf
- $_nice_COMerrorArray[1][0] = ""
- ReDim $_nice_COMerrorArray[$_nice_COMerrorArray[0][0] + 1][9]
- _ArrayDisplay($_nice_COMerrorArray, "ScriptOMatic - COM Errors intercepted ( the script will continue after this screen )")
- Return
- EndIf
- If $_nice_COMerrorArray[0][0] = 300 Then
- $_nice_COMerrorArray[0][8] = "ScriptLine: only first 300 errors shown !!!"
- Return
- EndIf
- If StringInStr($_nice_COMerrorArray[1][0], "|" & $_nice_COMerrorObj.scriptline & "|") Then Return
- $i = $_nice_COMerrorArray[0][0] + 1
- $_nice_COMerrorArray[0][0] = $i
- $_nice_COMerrorArray[$i][1] = "0x" & Hex($_nice_COMerrorObj, 8)
- $_nice_COMerrorArray[$i][2] = $_nice_COMerrorObj.windescription
- $_nice_COMerrorArray[$i][3] = $_nice_COMerrorObj.source
- $_nice_COMerrorArray[$i][4] = $_nice_COMerrorObj.helpfile
- $_nice_COMerrorArray[$i][5] = $_nice_COMerrorObj.helpcontext
- $_nice_COMerrorArray[$i][6] = $_nice_COMerrorObj.lastdllerror
- $_nice_COMerrorArray[$i][7] = $_nice_COMerrorObj.scriptline
- $_nice_COMerrorArray[1][0] = $_nice_COMerrorArray[1][0] & "|" & $_nice_COMerrorObj.scriptline & "|"
- If $i == 1 Then
- $_nice_COMerrorArray[0][1] = "ErrorNumber:"
- $_nice_COMerrorArray[0][2] = "WinDescription:"
- $_nice_COMerrorArray[0][3] = "Source:"
- $_nice_COMerrorArray[0][4] = "HelpFile:"
- $_nice_COMerrorArray[0][5] = "HelpContext:"
- $_nice_COMerrorArray[0][6] = "LastDLLerror:"
- $_nice_COMerrorArray[0][7] = "ScriptLineNumber:"
- $_nice_COMerrorArray[0][8] = "ScriptLine:"
- EndIf
- EndFunc ;==>_nice_COMerrorHandler
- #comments-start
- List of all the Properties and Methods for \root\WebAdministration:SSLBinding2
- SSLBinding2 Class Qualifiers
- ----------------------------
- 1. Description = Represents a Secure Sockets Layer (SSL) binding.
- 2. DisplayName = SSL Binding2
- 3. dynamic = -1
- 4. factory_clsid = {283ADED9-F67A-4A5A-A8C4-ABF841F47626}
- 5. Locale = 1033
- 6. provider = WebAdministrationProvider
- 7. SupportsCreate = -1
- 8. SupportsDelete = -1
- 9. SupportsUpdate = -1
- SSLBinding2 Class Properties and Property Qualifiers
- ----------------------------------------------------
- 1. BindingOwnerID
- 1.1. CIMTYPE = string
- 1.2. Description = A read/write string value that contains a GUID that represents the application that created the binding.
- 1.3. read = -1
- 1.4. write = -1
- 2. CertificateCheckMode
- 2.1. CIMTYPE = sint32
- 2.2. Description = A read/write sint32 enumeration that configures client certificate checking.
- 2.3. read = -1
- 2.4. ValueMap = 1,2,4,65536
- 2.5. Values = DisableClientCertRevocationCheck,AlwaysUseCachedCRL,EnableRevocationFreshnessTimeSetting,DisableClientCertUsageCheck
- 2.6. write = -1
- 3. CertificateHash
- 3.1. CIMTYPE = string
- 3.2. Description = A read/write string value that represents the unique identifier for the certificate.
- 3.3. read = -1
- 3.4. write = -1
- 4. CTLIdentifier
- 4.1. CIMTYPE = string
- 4.2. Description = A read/write string value that identifies a certificate trust list (CTL).
- 4.3. read = -1
- 4.4. write = -1
- 5. CTLStoreName
- 5.1. CIMTYPE = string
- 5.2. Description = A read/write string value that specifies the name of the certificate store where the CTL is found.
- 5.3. read = -1
- 5.4. write = -1
- 6. HostName
- 6.1. CIMTYPE = string
- 6.2. Description = A read only string value that contains the name of the certificate store where the certificate is found.
- 6.3. key = -1
- 6.4. read = -1
- 7. IPAddress
- 7.1. CIMTYPE = string
- 7.2. Description = A read-only string value that contains the IP address for the secure binding.
- 7.3. key = -1
- 7.4. read = -1
- 8. Port
- 8.1. CIMTYPE = uint32
- 8.2. Description = A read-only uint32 value that contains the port number that the secure binding uses.
- 8.3. key = -1
- 8.4. read = -1
- 9. RevocationFreshnessTime
- 9.1. CIMTYPE = DateTime
- 9.2. Description = A read/write datetime value in seconds.
- 9.3. read = -1
- 9.4. SUBTYPE = interval
- 9.5. write = -1
- 10. RevocationURLRetrievalTimeout
- 10.1. CIMTYPE = DateTime
- 10.2. Description = A read/write datetime value that specifies a timeout interval, in milliseconds, after which the certificate revocation list (CRL) on the certificate client is updated by the CRL from the remote location.
- 10.3. read = -1
- 10.4. SUBTYPE = interval
- 10.5. write = -1
- 11. SslAlwaysNegoClientCert
- 11.1. CIMTYPE = boolean
- 11.2. Description = A read/write Boolean value that specifies how SSL client connections will be negotiated. True if the server will immediately negotiate a client certificate; otherwise, false.
- 11.3. read = -1
- 11.4. write = -1
- 12. SslUseDsMapper
- 12.1. CIMTYPE = boolean
- 12.2. Description = A read/write Boolean value. True if the Microsoft Active Directory certificate mapper is used for client certificate authentication; otherwise, false.
- 12.3. read = -1
- 12.4. write = -1
- 13. StoreName
- 13.1. CIMTYPE = string
- 13.2. Description = A read only string value that contains the name of the certificate store where the certificate is found.
- 13.3. key = -1
- 13.4. read = -1
- SSLBinding2 Class Methods and Method Qualifiers
- -----------------------------------------------
- 1. Create
- 1.1. bypass_getobject = -1
- 1.2. Constructor = -1
- 1.3. Description = Creates an SSL binding.
- 1.4. Implemented = -1
- 1.5. Static = -1
- #comments-end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement