GithubHelp home page GithubHelp logo

temiyaha / microsoft.pfe.servicecredentialmanager.powershell Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 19 KB

Microsoft.Pfe.ServiceCredentialManager.PowerShell

License: MIT License

PowerShell 100.00%

microsoft.pfe.servicecredentialmanager.powershell's Introduction

Microsoft.Pfe.ServiceCredentialManager.PowerShell

Microsoft.Pfe.ServiceCredentialManager.PowerShell

Releases

Cmdlets in module

  • Set-WindowsServiceCredential: Set a credential for a Windows service.
  • Get-WindowsServiceCredential: Get a credential information of Windows service.

Examples

Example 1: Set a domain user credential for a Windows service

PS > $serviceName = 'TheWindowsService'
PS > $computerName = 'DOMSERVER'
PS > $userName = '[email protected]'
PS >
PS > # Use the input password by the interactive user.
PS > $message = ('Please input the service credential for {0} service.' -f $serviceName)
PS > $cred = Get-Credential -Message $message -UserName $userName
PS >
PS > Set-WindowsServiceCredential -ServiceName $serviceName -Credential $cred -DomainCredential -TargetComputerName $computerName -Verbose
Verbose: Succeeded the verification of the user "[email protected]" credentials.
Verbose: Found the "TheWindowsService" service on "DOMSERVER".
Verbose: The "TheWindowsService" service on "DOMSERVER" is already stopped.
Verbose: Set the new credentials "[email protected]" to "TheWindowsService" service on the "DOMSERVER".
Verbose: Set the new credentials to the "TheWindowsService" service on "DOMSERVER" was completed.
True

Example 2: Set a local user credential for a Windows service

PS > $serviceName = 'TheWindowsService'
PS > $computerName = 'WG'
PS > $userName = 'WG\ServiceUser'
PS >
PS > # Use the input password by the interactive user.
PS > $message = ('Please input the service credential for {0} service.' -f $serviceName)
PS > $cred = Get-Credential -Message $message -UserName $userName
PS >
PS > Set-WindowsServiceCredential -ServiceName $serviceName -Credential $cred -TargetComputerName $computerName -Verbose
Verbose: Succeeded the verification of the user "WG\ServiceUser" credentials.
Verbose: Found the "TheWindowsService" service on "WG".
Verbose: The "TheWindowsService" service on "WG" is already stopped.
Verbose: Set the new credentials "WG\ServiceUser" to "TheWindowsService" service on the "WG".
Verbose: Set the new credentials to the "TheWindowsService" service on "WG" was completed.
True

Example 3: Get the credential information of Windows service from multiple servers

PS > $targetComputerNames = 'SERVER00','SERVER01'
PS > $serviceNames = 'TheWindowsService','LanmanServer','LanmanWorkstation','Spooler'
PS >
PS > foreach ($targetComputerName in $targetComputerNames)
>>   {
>>       foreach ($serviceName in $serviceNames)
>>       {
>>           Get-WindowsServiceCredential -ServiceName $serviceName -TargetComputerName $targetComputerName
>>       }
>>   }

ComputerName    ServiceName          UserName
------------    -----------          --------
SERVER00        TheWindowsService    contoso\administrator
SERVER00        LanmanServer         LocalSystem
SERVER00        LanmanWorkstation    NT AUTHORITY\NetworkService
SERVER00        Spooler              LocalSystem
SERVER01        TheWindowsService    Administrator@contoso.local
SERVER01        LanmanServer         LocalSystem
SERVER01        LanmanWorkstation    NT AUTHORITY\NetworkService
SERVER01        Spooler              LocalSystem

Reporting bugs or suggesting features

microsoft.pfe.servicecredentialmanager.powershell's People

Contributors

temiyaha avatar

Stargazers

Takeshi Katano avatar

Watchers

James Cloos avatar Kenichiro Nakamura avatar  avatar

microsoft.pfe.servicecredentialmanager.powershell's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.