Skip to content

Latest commit

 

History

History
113 lines (71 loc) · 2.75 KB

Exo_Ps72_Notes.md

File metadata and controls

113 lines (71 loc) · 2.75 KB

ExO and PowerShell 7.2

Docs landing page https://docs.microsoft.com/en-us/powershell/exchange/exchange-online-powershell

Installation https://docs.microsoft.com/en-us/powershell/exchange/exchange-online-powershell-v2?view=exchange-ps#install-and-maintain-the-exo-v2-module

Windows:

Import-Module ExchangeOnlineManagement
Connect-ExchangeOnline
Get-EXOMailbox

Will open browser windows for login by default.

Linux

https://docs.microsoft.com/en-us/powershell/exchange/exchange-online-powershell-v2?view=exchange-ps#install-and-maintain-the-exo-v2-module

Quote: "The EXO V2 module is officially supported in the following distributions of Linux:

  • Ubuntu 18.04 LTS
  • Ubuntu 20.04 LTS"
sudo pwsh

Install-Module -Name PSWSMan
Install-WSMan

Section "Prerequisites for the EXO V2 module" not applicable it seems:

Set-ExecutionPolicy RemoteSigned
# --> Set-ExecutionPolicy: Operation is not supported on this platform.

Test:

# don't do this in 'sudo pwsh'
Install-Module -Name ExchangeOnlineManagement

Connect-ExchangeOnline -Device
# takes some time, including Creating implicit remoting module

Get-EXOMailbox

Do not forget to disconnect:

Disconnect-ExchangeOnline
# Running this cmdlet clears all active sessions created using Connect-ExchangeOnline or Connect-IPPSSession.
# Press(Y/y/A/a) if you want to continue.

App-only authentication

Doc and steps https://docs.microsoft.com/en-us/powershell/exchange/app-only-auth-powershell-v2

Best to simply follow the steps to register the app.

https://github.com/dgoldman-msft/PSServicePrincipal/ no longer useful IMO (Windows PowerShell, other issues)

Docker

https://docs.microsoft.com/en-us/dotnet/architecture/microservices/net-core-net-framework-containers/net-container-os-targets

List of all tags for PowerShell containers https://hub.docker.com/_/microsoft-powershell - 7.2.0-ubuntu-focal-20211102 https://mcr.microsoft.com/v2/powershell/tags/list

Supported parent images for Windows App Service containers https://docs.microsoft.com/en-us/azure/app-service/configure-custom-container?pivots=container-windows#supported-parent-images

Interactive in Container

docker pull mcr.microsoft.com/powershell:7.2.0-ubuntu-20.04

docker run -it mcr.microsoft.com/powershell:7.2.0-ubuntu-20.04 /bin/bash

In container:

apt-get update
apt-get -y install sudo

sudo pwsh

Install-Module -Name PSWSMan
Install-WSMan

exit

pwsh
Install-Module -Name ExchangeOnlineManagement

Connect-ExchangeOnline -Device

Get-EXOMailbox

See ubuntu-container-test-log.txt