Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

Hallo zusammen,

ich habe folgendes Problem.

Und zwar möchte ich via php ein powershell-Script ausführen.

Generell sollte es ja wie folgt funktionieren:
 

echo Shell_Exec('powershell.exe -executionpolicy bypass -NoProfile -File "C:\inetpub\wwwroot\project_a\outlook_abwesenheit.ps1"');

Um auszuschließen, dass es sich nicht um ein Berechtigungsproblem handelt, habe ich vollzugriff auf die "powershell.exe" gegeben.
In der php.ini habe ich geprüft, ob die Funktion disabled ist, was aber nicht der Fall ist. Nach der in der php.ini definierten max_execution_time zeit erhalte ich einen Timeout.

Irgendwelche Fehler werden nicht angezeigt. (PHP 7.3, IIS)

Hat jemand eine Idee?

Bearbeitet von murat1895

  • Autor
vor 10 Stunden schrieb Visar:

Auf welches Level ist das error_reporting gesetzt? Was sagen die Logs?

Ansonsten: AFAIK ist PHP zumindest bei Funktionsnamen case sensitive, d.h. es kennt kein Shell_Exec, sondern lediglich shell_exec.

Moin moin,

so ist das error_reporting gesetzt:

error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED

Das hier steht nur in der error.log:

[10-Jun-2020 20:04:23 Europe/Berlin] PHP Fatal error:  Maximum execution time of 600 seconds exceeded in C:\inetpub\wwwroot\project_a\includes\central.php on line 79

ich habe nun mal shell_exec in Kleinbuchstaben geschrieben - läuft immernoch auf einen Timeout.

 

 

 

 

Bearbeitet von murat1895

  • Autor

So ich hab´s nun hinbekommen.
das Powershell Skript wurde als anderer Benutzer ausgeführt, der zur Ausführung zu wenig rechte hat.

Nun stehe ich vor dem nächsten Problem.

Ich versuche dieses Script nun zu nutzen, um auf dem Mailserver eine Signatur reinzudrücken:
 

$passwd = Get-Content "C:\test.txt" | ConvertTo-SecureString -Force -AsPlainText
$computername = "mailserver"
$cred = new-object -typename System.Management.Automation.PSCredential "testadmin",$passwd
                    
$s = New-PSSession -ComputerName $computername  -Credential $cred;
Invoke-Command -Session $s -ScriptBlock {
Set-MailboxAutoReplyConfiguration -Identity testbenutzer -AutoReplyState Scheduled -StartTime "6/11/2020 08:00:00" -EndTime "6/11/2020 19:00:00" -InternalMessage "Internal auto-reply message"
}

Ich bekomme hier die Rückmeldung, dass die Funktion Set-MailboxAutoReplyConfiguration nicht bekannt ist. In der normalen Poweshell ist diese auch nicht bekannt, allerdings in der auf dem Mailserver installierten Exchange Management Shell schon.

  • 2 Wochen später...

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.