You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The CLI has new functionality in place to create a new application to use the CLI on a Microsoft 365 tenant. We have to run m365 setup and follow the questions to the end. Which is nice!
Now I've been brainstorming with my colleagues who had a few questions about this functionality.
We'd like to tune the process a bit to make it even more user friendly for people who have to use it often. So especially for users regularly working with new tenants, like systems integrators who regularly have new customers this is important.
We thought of the following improvements:
Be able to setup the application without reconfiguring the CLI entirely.
If we now run m365 setup it will ask us a lot of questions. But if we're working with the CLI all the time, we generally like to skip that, as we've already configured it to our liking. We don't want it to override our configuration. We just want to create a new app.
See the tenant name, tenantId and appId when running m365 connection list
We use custom scripting to determine if we already have a connection with a tenant. If we do not, it should start the setup process. If we do, it should switch to that tenant.
Be able to specify a custom App Name.
We often work with both PnP PowerShell AND the CLI for Microsoft 365. We want to create an app that's named "M365 Shell tooling" (for example),
How about that? Let's discuss!
As an example, this is the powershell script my colleague wrote, to make working with multiple tenants easier for him.
functionConnect-M365Interactive {
[cmdletBinding()]
param (
[parameter(mandatory=$true)]$tenantName
)
$connections= (m365 connection list --output json |ConvertFrom-Json)
$existingConnection=$connections|Where name -eq"$tenantName-interactive"if($existingConnection) {
m365 connection use --name "$tenantName-interactive"return
}
$cred=Get-PnPStoredCredential-Name "$tenantName-interactive"-ErrorAction SilentlyContinue
if(!$cred) {
Write-Host"No credential found for $tenantName-interactive"
m365 setup
$connectionData= (m365 cli config list --output json) |ConvertFrom-JsonAdd-PnPStoredCredential-Name "$tenantName-interactive"-Username $connectionData.clientId-Password (ConvertTo-SecureString-String $connectionData.tenantId-AsPlainText -Force)
$cred=Get-PnPStoredCredential-Name "$tenantName-interactive"
}
m365 login --tenant $cred.GetNetworkCredential().Password --appId $cred.Username--connectionName "$tenantName-interactive"
}
The text was updated successfully, but these errors were encountered:
Hi guys!
The CLI has new functionality in place to create a new application to use the CLI on a Microsoft 365 tenant. We have to run
m365 setup
and follow the questions to the end. Which is nice!Now I've been brainstorming with my colleagues who had a few questions about this functionality.
We'd like to tune the process a bit to make it even more user friendly for people who have to use it often. So especially for users regularly working with new tenants, like systems integrators who regularly have new customers this is important.
We thought of the following improvements:
Be able to setup the application without reconfiguring the CLI entirely.
If we now run
m365 setup
it will ask us a lot of questions. But if we're working with the CLI all the time, we generally like to skip that, as we've already configured it to our liking. We don't want it to override our configuration. We just want to create a new app.See the tenant name, tenantId and appId when running
m365 connection list
We use custom scripting to determine if we already have a connection with a tenant. If we do not, it should start the setup process. If we do, it should switch to that tenant.
Be able to specify a custom App Name.
We often work with both PnP PowerShell AND the CLI for Microsoft 365. We want to create an app that's named "M365 Shell tooling" (for example),
How about that? Let's discuss!
As an example, this is the powershell script my colleague wrote, to make working with multiple tenants easier for him.
The text was updated successfully, but these errors were encountered: