Created
December 6, 2020 13:27
-
-
Save garrytrinder/89fc4ea2c0d359437dc90507841fecb9 to your computer and use it in GitHub Desktop.
Execute PS1 script from host machine inside CLI for Microsoft 365 Docker container, uses custom Azure AD identity and password login
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run --rm -it -v ${PWD}:/home/cli-microsoft365/scripts -e "CLIMICROSOFT365_AADAPPID=da049853-dd90-49df-aa21-4e0c8b646a36" -e "CLIMICROSOFT365_TENANT=e8954f17-a373-4b61-b54d-45c038fe3188" -e "[email protected]" -e "M365_PASSWORD=password" m365pnp/cli-microsoft365:next pwsh scripts/script.ps1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
m365 login --authType password --userName $env:M365_USER --password $env:M365_PASSWORD | |
m365 status | |
$sites = m365 spo site list -o json | ConvertFrom-Json | |
Write-Output "Total Sites: $($sites.Count)" | |
m365 logout |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment