Powershell: Login As Batch Job Security Rights
Here is a quick bit of PowerShell. It is some snippets of C# code wrapped up with PowerShell which will allow you to assign accounts to the ‘login as batch job’ local security rights of a local machine. The code is no great shakes but it is a good example of how you might take some existing online code and modify to suit your needs in PowerShell. This function also compliments another script I’ve released in the past for automatically scheduling PowerShell scheduled tasks rather well.
I’ve uploaded this code to the Technet Gallery and Github. The prior mentioned scheduled task function is also in my Github repo for your convenience.