Skip to main content

Set Windows Service Login Account

Summary

This document is used to change the service login account for a target service.

Sample Run

Sample Run 1

Sample Run 2

Dependencies

Variables

@ParameterMode@ - Variable used to modify script parameters based on the User Parameters.

User Parameters

NameExampleRequiredDescription
NamespoolerSemi-RequiredThe service name to modify. Either this or the DisplayName parameter must be specified.
DisplayNamePrint SpoolerSemi-RequiredThe display name of the service to modify. Either this or the Name parameter must be specified.
UsertestuserSemi-RequiredThe username of the user to run the service as. User and Pass must be specified; otherwise, System must be specified.
Passtestpass123Semi-RequiredThe password of the user to run the service as. User and Pass must be specified; otherwise, System must be specified.
System1Semi-RequiredUse this to run the service as "Local System." System must be specified; otherwise, User and Pass must be specified.

Process

See EPM - Windows Configuration - Agnostic - Set-ServiceLogin for process information.

Output

  • Script log
  • Script state
  • Local files on the computer
    • .//Set-ServiceLogin-log.txt
    • .//Set-ServiceLogin-data.txt
    • .//Set-ServiceLogin-error.txt