Skip to content

Credentials for Set-Service command #4843

Closed

Description

Currently when creating a service using the New-Service from the module Microsoft.PowerShell.Management I can specify the credentials that my new service will be executed with.

Set-Service currently does not support setting the new logon account for the service.
The current workarounds that I have found:

  • Use sc.exe to change credentials
  • Use Get-WmiObject -Class Win32_Service and from there use the Change method
  • Delete the service and create it again.

But I believe it would be nice to have Set-Service support credentials.
Is it possible to add functionality for setting the credentials using the Set-Service command?

Activity

  1. added
    Issue-Enhancement
    Up-for-Grabs
    on Sep 14, 2017
  2. SteveL-MSFT commented on Sep 14, 2017

    @SteveL-MSFT
    Member

    Shouldn't be too hard as Set-Service uses ChangeServiceConfig win32 api which accepts username/password.

  3. joandrsn commented on Sep 18, 2017

    @joandrsn
    ContributorAuthor

    #4844 was merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-EnhancementResolution-FixedUp-for-GrabsWG-Cmdlets

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions