RunAs startet das Programm nicht

  • Hallo,

    es sind meine ersten Gehversuche mit AutoIT und schon komme ich ins stolpern...

    Ich möchte die Installation von "DameWare Mini Remote Controle" automatisieren

    Das Setup muss als Admin gestartet werden, ansonsten muss das Passwort beim Klick auf "Install" eingegeben werden.
    Typisch Win7 halt...

    Ich habe das Beispiel von RunAs aus der Hilfe versucht mit dem Notepad.
    Funktioniert prima, bin dann im Kontext des Admins mit Notepad



    Wenn ich da den nur den Pfad anpasse tut sich schon nichts mehr!

    Code
    Local $iPID = RunAs($sUserName, "MyDOM", $sPassword, 0, "C:\Temp\Dameware\DameWare-MRC64-v10.0.0.exe", "", @SW_SHOWMAXIMIZED)

    auch so nicht


    Code
    Local $iPID = RunAs($sUserName, "MyDOM", $sPassword, 0, "DameWare-MRC64-v10.0.0.exe", "C:\Temp\Dameware", @SW_SHOWMAXIMIZED)

    versuche ich es mit Putty geht es aber Putty braucht auch kein Admin... Aber von den Pfaden her zeigt das ja das es soweit alles richtig sein sollte.


    Code
    Local $iPID = RunAs($sUserName, "MyDOM", $sPassword, 0, "C:\Temp\Dameware\putty062.exe", "", @SW_SHOWMAXIMIZED)

    Was mache ich flasch?

    Ich hoffe ihr könnt mir helfen.

    Mfg
    Jabberwock

  • Local $iPID = RunAs($sUserName, "MyDOM", $sPassword, 2, "C:\Temp\Dameware\DameWare-MRC64-v10.0.0.exe", "", @SW_SHOWMAXIMIZED)

    hast du bei dem unterstrichenen Teil auch den Domänennamen von dir angepasst? Zudem würde ich hinter dem $sPassword eine "2" nehmen, aber theoretisch sollte auch eine 0 gehen.

  • Hi,

    MyDom habe ich angepasst! Ich wollte nicht den echten Domänennamen da stehen haben... Wie gesagt wenn ich es mit dem notepad mache klappt es! Auch der Login als Admin klappt! Ich nutze einen Domänenuser mit Adminrechten (könnte es mal mit dem localen Admin versuchen...IDEE) Aber das klapp soweit.

    Wenn ich es mit 2 aufrufe dann startet zwar das Setup aber ohne Adminrechte... Warum weiß ich nicht.

    Wenn ich es mit der Putty.exe im gleichen Ordner versuche geht es auch!!!
    Pfade stimmen also.

    Aber Vielen dank schon mal

  • Nur, indem man die UAC eine Stufe tiefer stellt oder deaktiviert. Da es aber ein Firmennetzwerk ist, sollte dieser Schritt entsprechend abgeklärt sein.

    Evtl. gibt es noch andere Wege, hier können dir bestimmt die hießigen Profis (andy, chip, raupi und co.) weiterhelfen :)

  • Das Problem ist hier vermutlich, dass auch ein Admin normalerweise kein vollwertiger Admin unter Windows Vista und neuer ist, sondern nur mit Benutzerrechten arbeitet. Damit ein Administrator im administrativen Kontext arbeitet ist es notwendig mittels UAC Dialog die Rechte zu erweitern. Eine Möglichkeit dies zu realisieren ist es deinem Script diese Rechte per UAC Abfrage zu erteilen (#requireadmin). Alle Programme die das Script startet laufen dann ebenfalls mit den erhöhten rechten.

    Es gibt aber evtl. bessere Wege die ohne UAC Dialog auskommen und sich so für unbeaufsichtigte Installationen eignen. Bei uns im Netzwerk (und ich denke das ist das Standardverhalten von Windows) arbeitet der lokale Superadministrator (Konto "Administrator") grundsätzlich ohne UAC Abfrage. Dies lässt sich per Gruppenrichtlinie bzw. Registry beeinflußen. Standardmässig ist der Superadmin aber deaktiviert. Sollte der Account bei euch aktiviert sein und ebenfalls ohne UAC Abfrage arbeiten würde ich den runas Befehl mit diesem Account testen.

    Es gibt noch weitere Wege wie z.B die Erstellung eines einmaligen Tasks über die Aufgabenplanung. Hier kann als Option der Haken bei "Mit höchsten Privilegien ausführen" gesetzt werden. Aber auch hier hast du das Problem, dass du zum Erstellen eines solchen Tasks erstmal erhöhte Privilegien benötigst. Prinzipiell sollte sich der Task aber auch remote auf den betroffenen oder allen client Rechnern mehr oder weniger automatisiert erstellen lassen, genauso wie sich die Aktivierung des Superadmins im ganzen Netzwerk automatisieren lassen sollte.

  • Hallo,
    vielen Dank für die ausführliche Antwort. Mit dem lokalen Administrator (den meinst du doch, oder?) habe ich es noch nicht versucht.

    Ich möchte das Paket hinterher per WindowsUpdate (WSUS) verteilen. Ich vermute das sich dann auch das ganze Problem mit dem Admin erledigt hat da (vermutlich)
    der Updatedinst eh genug rechte dafür haben wird.

    Ich habe jetzt allerdings schon wieder ein Problem mit dem Setup...
    Es wird nach der Installation (der installer ist aber noch offen) ein weiteres Fenster geöffnet wo dann Registrierungsinformationen eingegeben werden müssen.

    Auf diesem Fenster kann ich nichts machen.
    Kein Text ins Texfeld schreiben
    Kein von den Buttons drücken
    Kein Mausklick

    Alles was vorher im Installer funktioniert geht da auf einmal nicht mehr.

    Ich weiß es ist echt viel verlangt aber vielleicht könnte sich jemand das ganze mal anschauen... Ich bekomme es einfach nicht hin.
    Hier der Link zum Installer.
    http://www.heise.de/download/mini-…ol-1137416.html

    Mfg
    Jabberwock

  • hallo,

    am besten du benutzt das MSI paket von Dameware ...Wir benutzen noch die DNTU7x.msi (msiexec /i "Pfad zur msi\DNTU7x.msi" /qn /norestart)
    Wenn du nur die Exe hast, probiere mal in der CMD Dameware.exe /? und schau ob da die Parameter angezeigt werden.

    Beispiel ungetestet ...
    RunAs($ADMINUSER, $DOMAIN, $ADMINPASS, 0, @comspec & " /c " & "msiexec /i c:\temp\DNTU7x.msi /qn /norestart")

    Gruß gmmg

    Einmal editiert, zuletzt von gmmg (23. September 2015 um 11:49)

  • ah super... genau das hatte ich gesucht. Aber weil ich kein MSI gefunden hatte bin dann zu AutoIT übergegeangen.

    RunAs war schon geklärt.

    Aber jetzt habe ich das msi bekommen aus der .exe mit -out

    Danke


    DACHTE ICH....

    Das bringt mich doch nicht weiter. Jetzt habe ich zwar das msi und kann es auch mit /qn laufen lassen aber die Registrierung bleibt.
    Und um die ging es mir ja. Das Fenster kann ich nicht automatisieren. Warum auch immer...

    Einmal editiert, zuletzt von Jabberwock (23. September 2015 um 12:41)

  • schau mal hier, ob da was passendes zu finden ist

    http://support.dameware.com/kb/article.aspx?ID=400113
    http://forums.dameware.com/viewtopic.php?f=8&t=59


    Complete the following procedures according to your deployment scenario.
    To install DRS or MRC using the MSI installer and a valid license:
    Use the following command at the command line or in an installer script. Replace the variables in this example according to the values in the Arguments section.
    msiexec /i fileName.msi /qn APPDIR="C:\Program Files\DameWare programName\" reboot=reallysuppress SILENT=yes INSTALLSTANDALONE=1 SA_KEY=licenseKey SA_EMAIL=emailAddress SA_FIRST_NAME=firstName SA_LAST_NAME=lastNema /l*+ %temp%\install.log
    To install DRS or MRC using the EXE installer and a valid license:
    Use the following command at the command line or in an installer script. Replace the variables in this example according to the values in the Arguments section.
    fileName.exe /args "/qn APPDIR=\"C:\Program Files\DameWare programName\" reboot=reallysuppress SILENT=yes INSTALLSTANDALONE=1 SA_KEY=licenseKey SA_EMAIL=emailAddress SA_FIRST_NAME=firstName SA_LAST_NAME=lastName /L*V %temp%\Install.log"
    To install DRS or MRC using the MSI installer in evaluation mode:
    Use the following command at the command line or in an installer script. Replace the variables in this example according to the values in the Arguments section.
    msiexec /i fileName.msi /qn APPDIR="C:\Program Files\DameWare programName\" reboot=reallysuppress SILENT=yes INSTALLSTANDALONE=1 /L*V %temp%\Install.log
    To install DRS or MRC using the EXE installer in evaluation mode:
    Use the following command at the command line or in an installer script. Replace the variables in this example according to the values in the Arguments section.
    fileName.exe /args "/qn APPDIR=\"C:\Program Files\DameWare programName\" reboot=reallysuppress SILENT=yes INSTALLSTANDALONE=1 /L*V %temp%\Install.log"
    To install DRS or MRC using the MSI installer in centralized mode:
    Use the following command at the command line or in an installer script. Replace the variables in this example according to the values in the Arguments section.
    msiexec /i fileName.msi /qn APPDIR="C:\Program Files\DameWare programName\" reboot=reallysuppress SILENT=yes INSTALLSTANDALONE=0 CENTRALSERVERHOSTNAME=CentralServerHostName CENTRALSERVERPORT=portNumber CSUSER=userName CSPASSWORD=userPassword /L*V %temp%\Install.log
    To install DRS or MRC using the EXE installer in centralized mode:
    Use the following command at the command line or in an installer script. Replace the variables in this example according to the values in the Arguments section.
    fileName.exe /args "/qn APPDIR=\"C:\Program Files\DameWare programName\" reboot=reallysuppress SILENT=yes INSTALLSTANDALONE=0 CENTRALSERVERHOSTNAME=CentralServerHostName CENTRALSERVERPORT=portNumber CSUSER=userName /L*V %temp%\Install.log"


    Arguments
    The following define the arguments used in the commands in this article.

    • /args "argumentsHere" (EXE only) instructs the EXE installer to pass the arguments inside the quotation marks along to the MSI installer.
    • /L*V C:\Install.logargument will ensure that along installation will be created Install.log file.
    • APPDIR="C:\Program Files\DameWare programName\" specifies the installation directory. Enter Remote Support or Mini Remote Control in place of programName to use the default installation directory.
    • SILENT=yes instructs the installer to install the program silently.
    • SA_KEY=licenseKey (licensed only) contains the license key for licensed installations. Enter a valid license key in place of licenseKey.
    • SA_EMAIL=emailAddress (licensed only) contains the administrator's email address for licensed installations. Enter a valid email address in place of emailAddress.
    • SA_FIRST_NAME=firstName (licensed - optional) contains the administrator's first name. Enter the first nargument will ensure that along installation will be created Install.log fileame in place of firstName.
    • SA_LAST_NAME=lastName (licensed - optional) contains the administrator's last name. Enter the last name in place of lastName.
    • SA_PHONE_NUMBER=phoneNumber (licensed - optional) contains the administrator's phone number. Enter a valid phone number in place of phoneNumber.
    • SA_PROXY_ADDRESS=proxyAddress (licensed - optional) contains the address of the proxy server the program should use to connect to the SolarWinds licensing server. If applicable, enter the proxy server's IP address or hostname in place of proxyAddress.
    • SA_PROXY_PORT=proxyPort (licensed - optional) contains the port the program should use to connect to the proxy server. If applicable, enter the proxy port number in place of proxyPort.
    • INSTALLSTANDALONE=1 (centralized) installs the standalone version. Use 0 to install the centralized version.
    • CENTRALSERVERHOSTNAME=centralServerHostName (centralized) contains the 's host name.
    • CENTRALSERVERPORT=portNumber (centralized) contains the port number to the . By default, this is 6133.
    • CSUSER=centralServerUser (centralized) contains the login name of a Central Server user.
    • CSPASSWORD=centralServerUserPassword (centralized) contain the password of the Central Server user.

    The following arguments are included in version 10.0:

    gruß gmmg

    2 Mal editiert, zuletzt von gmmg (23. September 2015 um 13:22)