Skip Ribbon Commands
Skip to main content

Quick Launch

Todd Klindt's home page > Todd Klindt's Office 365 Admin Blog > Posts > Simplifying Client Credentials with PowerShell: Add-ClientCredential
September 27
Simplifying Client Credentials with PowerShell: Add-ClientCredential

If you’ve been around the block with SharePoint or Microsoft 365 administration, you know that handling client credentials can sometimes feel like juggling with fire. When I start a new engagement with a client I generally get credentials to access their tenant. Of course they immediately go into our password management tool. I also do a lot of PowerShell scripting for my clients, so I save them to the Windows Credential store too, so that I can connect with Connect-PnPOnline without having to enter them each time. And while that’s not a lot of work, I thought I could streamline it. That’s why I’ve put together a PowerShell command, Add-ClientCredential, that makes it a little easier.

What Does Add-ClientCredential do?

In a nutshell, this PowerShell command is designed to streamline the process of adding client credentials in a SharePoint or Microsoft 365 environment. It stores your credential for and If you don’t specify any credentials when you connect with Connect-PnPOnline it will look for them in the Windows Credential Store. If you have one assigned for the root of the tenant,, it will also use that for other sites in the tenant, like, if a credential is not saved for that specific site.

Here’s a quick example:

Add-ClientCredential -TenantName "contoso" -UserName

I like this method because then my password will never show up in History or a Transcript if one is running. Since we didn’t pass it a password, it will prompt you for one. Then it will create credential entries for,, and

To pass it a password, do it like this:

Add-ClientCredential -TenantName "contoso" -UserName -Password (ConvertTo-SecureString "YourPassword”
-AsPlainText -Force)

Keep in mind that will show up in plain text in PowerShell’s Get-History, or the Transcript file, if you have that running.

I built in some smarts so that if there is already a credential stored for “Contoso” it will let you know and ask you if you want to overwrite it.

If you want to get super fancy you can add the –TestCredential switch which will test the credentials you gave it by logging in with them. All of this is available if you run help Add-ClientCredential –Examples.

In the background this function uses Add-PnPStoredCredential to store the credentials for you. It adds them for the root of the tenant, and the –admin URL.

How to Get Started

To get your hands on this little beauty, head over to my GitHub repository. You can download addclientcreds.psm1 itself, or clone the whole repo. Use Import-Module to import it into your PowerShell host and you’re ready to go.

Wrapping Up

addclientcreds.psm1 is my attempt to put a little more simplicity and sanity into the world of SharePoint and Microsoft 365 administration. I hope you find it as useful as I do. As always, I welcome your feedback and questions. Drop a comment below or shoot me a message on Twitter @ToddKlindt.




Service Provider

You don’t need to stress over whatever else. Security Guaranteed – Escort industry has now become a basic piece of the general public and it is totally alright for you to enlist Call girls in Model Town. The exchanges are likewise protected when you Book Models or Russian Girls in Model Town.
 on 10/14/2023 4:17 AM


Whenever i in the same way wrote a website with a indistinguishable motif may get it again for yield what you consider :D
 on 10/23/2023 1:29 AM

Re: Simplifying Client Credentials with PowerShell: Add-ClientCredential

A Escort’s emotional needs are the same as a man’s. But these emotional needs are not met through intercourse. Some women want to express the feeling of connection they feel with sex. Women can define their emotional needs in terms of arousal and arousal, as it relates to the concept of male emotional connection.
 on 10/25/2023 1:20 AM

Re: Simplifying Client Credentials with PowerShell: Add-ClientCredential

Our Escorts are very professional. They deal with clients with enough professionalism and ensure the complete pleasure of sex and romance. They are punctual and disciplined. They know how to impress a man and how to make him feel comfortable.
 on 10/25/2023 1:43 AM

Delhi Escorts

Delhi call girls’ WhatsApp numbers are in high demand throughout the country. But now, you can book incredibly cheap call girls in Delhi. These beautiful and confident are worth a watch when you are lying on your bed, naked. Our online call girls in Delhi, Navi Delhi, love to receive multiple orgasms from their clients, and they love to give equally exploding orgasms to their clients.
 on 10/25/2023 2:20 AM

Service Provider

With the assist of the broad-minded Delhi Escorts Agency , you can obtain the extremely good sensuous pride and have fun with a awesome time. These youthful ladies are experts and recognized for serving their warm sexual offerings
 on 11/3/2023 7:59 AM

Service Provider

Adult offerings and unfold jovial temper round. Ensure to cherish a few superb sexual positions in mattress with those partners like 69 pose, blowjob, hand task, anal, puppy fashion, cum in mouth, sex without condom, lady on top, and so forth. Experienced and nicely-informed girls are going to hold you to your wild sexual wishes and make satisfied you absolutely.
 on 11/3/2023 8:00 AM

Service Provider

Are you looking for gorgeous as well as sensational lady tonight? If of course, our South Delhi escorts are always all set to be with you in your house/ hotel for an outstanding experience. The crackling hot call girls in South Delhi are outstanding at various occasions and celebrations. They can be your girlfriend as well as performer to bring excitement to the session.
 on 11/8/2023 4:41 AM

stranger cam

We are really grateful for your blog post. You will find a lot of approaches after visiting your post. I was exactly searching for. Thanks for such post and please keep it up. Great work.Awesome article, it was exceptionally helpful! I simply began in this and I'm becoming more acquainted with it better! Cheers, keep doing awesome!
 on 11/15/2023 3:30 AM


We appreciate you taking the time to provide us with this vital information. Your article is excellent and insightful. Play the game, please.
 on 11/17/2023 2:28 AM
1 - 10Next

Add Comment

Items on this list require content approval. Your submission will not appear in public views until approved by someone with proper rights. More information on content approval.


Body *

Today's date *

Select a date from the calendar.
Please enter today's date so I know you are a real person


Want a message when I reply to your comment? Put your Twitter handle here.