how to replace an account executing a schedule task by gmsa using powershell

Mohamed SAKHO 116 Reputation points
2023-09-20T13:23:30.3166667+00:00
Good morning,

I have a hundred scheduled tasks which are executed by a so-called "service" account, but which is 
I created a gMSA that I want to position on around fifty planned tasks. Manually when I modify the execution account individually it works very well.

So I wanted to know if there is a powershell expert that would have a script to mass override the execution count of my scheduled tasks?

I asked ChatGPT, but none of its scripts work. So I throw a bottle into the sea...

Thanks in advance.
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
11,163 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,183 questions
0 comments No comments
{count} votes