131455
Dec 15, 2017
949
3
0
Frage zu einem Task im Task Scheduler File manuell ausgeführt, dann erstellt es ein Excel auf Laufwerkspfad Mit Batchjob nicht
Hallo,
ich habe ein *.ps1 File. Wenn ich das manuell starte . Inhalt :
Schreibt es mir schön alle Mitarbeiter in ein CSV , auf diesen Pfad.
Nun habe ich das per Aufgabenplaner hinterlegt. Es ist ein Batchuser definiert. Der aber auch Modify Rechte auf den Pfad \\contoso\contoso_web$\dokus\verzeichnis AD User hat.
Nun startet der Batch Job Montags 8 Uhr. "Run with Highest Privileges"
Actions: Start a Programm
Program/script : powershell.exe
Dann mit Add Arguments : -ExecutionPolicy Bypass -File "C:\Support\script\Alle_ADUser.ps1"
Aber auf den Pfad , schreibt es das leider nicht .
jemand ne Idee ?
Gruss
Rainer
ich habe ein *.ps1 File. Wenn ich das manuell starte . Inhalt :
get-aduser -filter * -SearchBase "OU=Niederlassung,DC=contoso,DC=local" -properties * | select-object Name,GivenName,Surname,Description,TiTle,personaltitle,EmployeeNumber,Department,Officephone,mobile |
export-csv "\\contoso\contoso_web$\dokus\verzeichnis AD User\ADUser.csv" -notypeinformation -delimiter ";" -encoding utf8
Schreibt es mir schön alle Mitarbeiter in ein CSV , auf diesen Pfad.
Nun habe ich das per Aufgabenplaner hinterlegt. Es ist ein Batchuser definiert. Der aber auch Modify Rechte auf den Pfad \\contoso\contoso_web$\dokus\verzeichnis AD User hat.
Nun startet der Batch Job Montags 8 Uhr. "Run with Highest Privileges"
Actions: Start a Programm
Program/script : powershell.exe
Dann mit Add Arguments : -ExecutionPolicy Bypass -File "C:\Support\script\Alle_ADUser.ps1"
Aber auf den Pfad , schreibt es das leider nicht .
jemand ne Idee ?
Gruss
Rainer
Please also mark the comments that contributed to the solution of the article
Content-Key: 358314
Url: https://administrator.de/contentid/358314
Printed on: April 23, 2024 at 21:04 o'clock
3 Comments
Latest comment
Put
around your script, and you will see all errors in your logfile.
Best regards
Tom
Start-Transcript "C:\log.txt"
# your code
Stop-Transcript
Es ist ein Batchuser definiert.
This Batch-User really has the "run as batch job" privileges on this server, and additionally usage rights for the Module "ActiveDirectory"?Best regards
Tom