WMI Abfrage Autoit:3.3.10.2

  • Habe mit der aktuellen Autoitversion das Problem, dass ich nicht mehr auf die WMI zugreifen kann.
    Mit der "alten" 3.3.8.1 lief das Skript noch.

    Spoiler anzeigen
    [autoit]

    #include <Array.au3>

    [/autoit] [autoit][/autoit] [autoit]

    $a = _WinWMI_LogonSession()
    If @error Then
    MsgBox(0, "Fehler", "Fehlercode: " & @error)
    Else
    _ArrayDisplay($a)
    EndIf

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func _WinWMI_LogonSession(Const $sComputer = "127.0.0.1")
    Local $iC = 0
    Local $oWMI = ObjGet("winmgmts:{impersonationLevel=impersonate}!" & $sComputer & "\root\CIMV2")
    If @error Then Return SetError(1, 0, -1)
    Local $oList = $oWMI.ExecQuery("SELECT * from Win32_LogonSession", "WQL", 0)
    If Not IsObj($oList) Then Return SetError(2, 0, -1)

    [/autoit] [autoit][/autoit] [autoit]

    Local $aR[$oList.Count][9]

    [/autoit] [autoit][/autoit] [autoit]

    For $i In $oList
    $aR[$iC][0] = $i.AuthenticationPackage
    $aR[$iC][1] = $i.Caption
    $aR[$iC][2] = $i.Description
    $aR[$iC][3] = $i.InstallDate
    $aR[$iC][4] = $i.LogonId
    $aR[$iC][5] = $i.LogonType
    $aR[$iC][6] = $i.Name
    $aR[$iC][7] = $i.StartTime
    $aR[$iC][8] = $i.Status
    $iC += 1
    Next
    Return $aR
    EndFunc

    [/autoit]


    Hat jemand schon eine Ähnliche Erfahrung gemacht?
    ObjGet scheint das Problem zu sein.

    21 is only half the truth.

    Einmal editiert, zuletzt von Mahagon (17. Januar 2014 um 12:19)

  • Dann bau bitte einen COM error handler ein und schau Dir die Fehlermeldung genau an. Beispiel unter ObjEvent.

  • Ach wie blöde
    in ner 6.bak steht der Backslash sogar noch drin.


    Danke ... manchmal sieht man den Wald vor lauter Bäumen nicht

    Bin wohl irgendwie mal auf entfernen oder so gekommen

    21 is only half the truth.