Tried to run the PowerShell sample "Govern orphaned Microsoft Teams" under https://pnp.github.io/office365-cli/sample-scripts/teams/govern-orphan-teams/
Did a copy and paste approach and the script throws an error. It misses just a minor thing -> authentication. For sure a small and minor thing, but if this script is the first one you are trying to use and you don't have a background in the field, every step helps to make life easier.
Go to https://pnp.github.io/office365-cli/sample-scripts/teams/govern-orphan-teams/
Copy and paste the code to a ps1 file
Execute the script
List of orphaned teams
Error.
Adding o365 login -t password -u $(username) -p $(password) from the other teams sample and providing a user and password solves the problem.
o365 version 2.9.0
Hey Thomy, thanks for reporting this. We typically don't include the login step in the sample scripts, because if you're already authenticated, it would reset your existing connection. Also, there are different ways to authenticate: interactively by yourself or using credentials, like you mentioned, in a daemon mode. So rather than forcing a particular way of authenticating in a given script, we thought it would make sense to let users choose how they want to authenticate themselves.
I agree, that if you don't use the CLI daily, it might be something that you miss. Given that we would prefer not to dictate how users should authenticate to use the particular script, how could we make it clear that you need to authenticate before you can run the script. Any suggestions?
Gotcha, and agree with your argument. Was just confused, because the other script had the login thing present, no problem though.
What about a small hello world like chapter in the introduction making the login steps clear? If you agree, I try to create something and let's see if you like it.
But I'm good with closing this one.
That would be great! Appreciate your help! 馃憦
Most helpful comment
Gotcha, and agree with your argument. Was just confused, because the other script had the login thing present, no problem though.
What about a small hello world like chapter in the introduction making the login steps clear? If you agree, I try to create something and let's see if you like it.
But I'm good with closing this one.