0 Pluspunkte 0 Minuspunkte
Ich habe mehrere Tasks mit Custom Events, wie kann ich alle Tasks die mit "Berechtigungsaudit_" gebinnen automatisch mit Powershell als XML exportieren?
von  

1 Antwort

0 Pluspunkte 0 Minuspunkte

Mit dem Cmdlet Export-ScheduledTask.

$exportPath = "C:\tasks\"

Get-ScheduledTask | Where-Object { $_.TaskName -like "Berechtigungsaudit_*" } | ForEach-Object {

    $TaskName = $_.TaskName

    Export-ScheduledTask -TaskName $TaskName >> $exportPath\$TaskName.xml

}
von (396 Punkte)