Faruque Ahmed : MCP, MCSA, MCSE, MCTS, MCIT, CCNA, OCA, OCP, GCP
LL
LL
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
PS C:\Windows\system32> Install-module exchangeonlinemanagement
PowerShellGet requires NuGet provider version '2.8.5.201' or newer to interact with NuGet-based repositories. The NuGet
provider must be available in 'C:\Program Files\PackageManagement\ProviderAssemblies' or
'C:\Users\FaruQ\AppData\Local\PackageManagement\ProviderAssemblies'. You can also install the NuGet provider by running
'Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force'. Do you want PowerShellGet to install and
import the NuGet provider now?
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): Y
Untrusted repository
You are installing the modules from an untrusted repository. If you trust this repository, change its
InstallationPolicy value by running the Set-PSRepository cmdlet. Are you sure you want to install the modules from
'PSGallery'?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"): A
PS C:\Windows\system32> Get-command -module exchangeonlinemanagement
PS C:\Windows\system32> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine
Execution Policy Change
The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose
you to the security risks described in the about_Execution_Policies help topic at
https:/go.microsoft.com/fwlink/?LinkID=135170. Do you want to change the execution policy?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"): A
PS C:\Windows\system32> Import-Module ExchangeOnlineManagement
PS C:\Windows\system32> Connect-ExchangeOnline –UserPrincipalName admin@federal.onmicrosoft.com
----------------------------------------------------------------------------------------
This V3 EXO PowerShell module contains new REST API backed Exchange Online cmdlets which doesn't require WinRM for Client-Server communication. You can now run these cmdlets after turning off WinRM Basic Auth in your client machine thus making it more secure.
Unlike the EXO* prefixed cmdlets, the cmdlets in this module support full functional parity with the RPS (V1) cmdlets.
V3 cmdlets in the downloaded module are resilient to transient failures, handling retries and throttling errors inherently.
REST backed EOP and SCC cmdlets are also available in the V3 module. Similar to EXO, the cmdlets can be run without WinRM basic auth enabled.
For more information check https://aka.ms/exov3-module
Starting with EXO V3.7, use the LoadCmdletHelp parameter alongside Connect-ExchangeOnline to access the Get-Help cmdlet, as it will not be loaded by default
----------------------------------------------------------------------------------------
PS C:\Windows\system32> Get-RetentionPolicy
Name RetentionPolicyTagLinks Guid
---- ----------------------- ----
6 month archive rule {6 months archive} fac66a85-bef0-480b-b564-b65aeda84ab2
ArbitrationMailbox {Never Delete, AsyncOperationNotification, 428a40de-e17e-4677-9dce-f7d1aa97d509
ModeratedRecipients, AutoGroup}
Default MRM Policy {5 Year Delete, 1 Year Delete, 6 Month b6471a84-a377-4849-b30f-601107a456ab
Delete, Personal 5 year move to archive...}
PS C:\Windows\system32> Start-ManagedFolderAssistant -Identity "nizam.uddin@federal.com"
PS C:\Windows\system32> Get-Mailbox -Identity "nizam.uddin@federal.com" | FL RetentionPolicy
RetentionPolicy : 6 month archive rule
PS C:\Windows\system32> Get-Mailbox -Identity "nizam.uddin@federal.com" | FL ArchiveStatus,ArchiveState
ArchiveStatus : Active
ArchiveState : Local
PS C:\Windows\system32> Set-Mailbox "nizam.uddin@federal.com" -RetentionHoldEnabled $false
PS C:\Windows\system32> Get-Mailbox -Identity "nizam.uddin@federalcom" | FL ArchiveStatus,ArchiveState
ArchiveStatus : Active
ArchiveState : Local
PS C:\Windows\system32> Get-MailboxStatistics -Identity "nizam.uddin@federal.com" | FL StorageLimitStatus,TotalItemSize,TotalDeletedItemSize
StorageLimitStatus :
TotalItemSize : 49.21 GB (52,841,403,461 bytes)
TotalDeletedItemSize : 1.558 GB (1,673,363,231 bytes)