O'Reilly logo

PowerShell in Depth, Second Edition by Don Jones, Jeffery Hicks, Richard Siddaway

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 12. Working with credentials

This chapter covers

  • Creating a credential object
  • Using credentials
  • Supporting alternative credentials in your scripts

A great many PowerShell commands have a –Credential parameter. You can view the list by typing

Get-Help * -Parameter Credential

When you use this parameter, it generally allows the command to operate with the username and password you provide rather than the one you used to log on to the shell. It’s a great way to enable the principle of least privilege: Do as much work as you can with unprivileged credentials, but when more privilege is required, specify alternative credentials for that purpose. You’ll need to run PowerShell with elevated privileges (“Run as Administrator”) to complete ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required