-
Notifications
You must be signed in to change notification settings - Fork 15
/
09_Install_Exchange_Online_PowerShell_V2_module.ps1
60 lines (39 loc) · 2.13 KB
/
09_Install_Exchange_Online_PowerShell_V2_module.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Set-Location c:\
Clear-Host
#Windows Remote Management (WinRM) on your computer needs to allow Basic authentication (it's enabled by default)
winrm get winrm/config/client/auth
winrm quickconfig
#If you don't see the value Basic = true
winrm set winrm/config/client/auth @{Basic="true"}
#Install the PowerShellGet
Install-Module PowershellGet -Force
#Update your existing version of the PowerShellGet
Update-Module PowershellGet
#Windows PowerShell needs to be configured to run scripts
Set-ExecutionPolicy RemoteSigned
#Close and re-open the elevated Windows PowerShell window to get the changes from the previous steps
Install-Module -Name ExchangeOnlineManagement
#Update the EXO V2 module, If the EXO V2 module is already installed
#To see the version of the EXO V2 module that's currently installed
Import-Module ExchangeOnlineManagement; Get-Module ExchangeOnlineManagement
#Run the following command to update the EXO V2 module
Update-Module -Name ExchangeOnlineManagement
#To confirm that the update was successful
Import-Module ExchangeOnlineManagement; Get-Module ExchangeOnlineManagement
#To uninstall the EXO V2 module
Uninstall-Module -Name ExchangeOnlineManagement
#Connect to Exchange Online using the EXO V2 module
$UserCredential = Get-Credential
#Accounts without MFA enabled
Connect-ExchangeOnline -Credential $UserCredential -ShowProgress $true
#Accounts with MFA enabled
Connect-ExchangeOnline -UserPrincipalName <UPN> -ShowProgress $true
#PropertySets: This parameter accepts one or more available property set names separated by commas
Get-EXOMailbox -PropertySets Archive,Custom
#Properties: This parameter accepts one or more property names separated by commas
Get-EXOMailbox -Properties LitigationHoldEnabled,AuditEnabled
Get-EXOMailbox -Properties IsMailboxEnabled,SamAccountName -PropertySets Delivery
Get-EXOCASMailbox -Properties EwsEnabled, MAPIBlockOutlookNonCachedMode -PropertySets ActiveSync
#This example returns the properties in the Minimum property set for the first ten mailboxes
Get-EXOMailbox -ResultSize 10
Get-EXOMailbox -ResultSize 10 -PropertySets All