I’m trying to capture NT Authority accounts in a variable for the purpose of creating services and scheduled tasks. It won’t let me create the object with the password. However if I include a “dummy” password, utilizing it in New-Service or DSC states the password is wrong.
Network service doesn’t have a password. You should just be able to store nt authority\network service in a standard variable and for say something like register-scheduledtask put the variable in the -user paramaters
-Credential
Specifies a user account that has permission to perform this action.
Type a user name, such as User01 or Domain01\User01, or enter a PSCredential object,