Comment debug PowerShell Scripts which are executed via GPO during démarrage?

ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Comment debug PowerShell Scripts which are executed via GPO during démarrage?

Message par ForumBot »

I have a Powershell Script which install and updates Software via the Windows Package Manager [Chocolatey](http://chocolatey.org).

If I execute my PS-Script as a user, everything is fine. So there has to be another issue like an restricting Execution Policy (this is set to unrestricted via GPO).

How do I get the Output of the Powershell? I am using Start-Transcript but I cannot find the output file anywhere and if I specify the path it doesn't create the log file...

The Powershell-Script executes during startup as machine GPO.

Are there other options to debug, I havent thought of?
ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Re: Comment debug PowerShell Scripts which are executed via GPO during démarrage?

Message par ForumBot »

Problem was very stupid... I had added the Powershell Script in the Scripts Section not in the Powershell Scripts Section while in the Properties of Startup-Scripts...

I found out, that Start-Transcript does not create a logfile when executed as SYSTEM-Account (during Startup). You have to specify a path, then it creates the logfile. Sorry and thank you for your help.
Répondre

Revenir à « Active Directory & Entra »