mirror of
https://github.com/admindroid-community/powershell-scripts.git
synced 2025-12-17 16:35:19 +00:00
Configure Plus Addressing in Exchane Online
Configure Plus Addressing in Exchane Online
This commit is contained in:
parent
ee0a26a444
commit
9768b0e57d
@ -0,0 +1,62 @@
|
||||
Param
|
||||
(
|
||||
[Parameter(Mandatory = $false)]
|
||||
[switch]$CheckStatus,
|
||||
[switch]$Enable,
|
||||
[switch]$Disable
|
||||
)
|
||||
#Check for EXO v2 module inatallation
|
||||
$Module = Get-Module ExchangeOnlineManagement -ListAvailable
|
||||
if($Module.count -eq 0)
|
||||
{
|
||||
Write-Host Exchange Online PowerShell V2 module is not available -ForegroundColor yellow
|
||||
$Confirm= Read-Host Are you sure you want to install module? [Y] Yes [N] No
|
||||
if($Confirm -match "[yY]")
|
||||
{
|
||||
Write-host "Installing Exchange Online PowerShell module"
|
||||
Install-Module ExchangeOnlineManagement -Repository PSGallery -AllowClobber -Force
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host EXO V2 module is required to connect Exchange Online.Please install module using Install-Module ExchangeOnlineManagement cmdlet.
|
||||
Exit
|
||||
}
|
||||
}
|
||||
|
||||
#Connect Exchange Online
|
||||
Write-Host Connecting to Exchange Online... -ForegroundColor Cyan
|
||||
Connect-ExchangeOnline
|
||||
|
||||
#Check for Plus Addressing status
|
||||
if($CheckStatus.IsPresent)
|
||||
{
|
||||
$Status=Get-OrganizationConfig | select AllowPlusAddressInRecipients
|
||||
if($Status -eq $true)
|
||||
{
|
||||
Write-Host Currently, Plus Addressing is enabled in your organization.
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host Currently,Plus Addressing is disabled in your organization.
|
||||
}
|
||||
}
|
||||
|
||||
#Enable Plus Addressing
|
||||
if($Enable.IsPresent)
|
||||
{
|
||||
Set-OrganizationConfig –AllowPlusAddressInRecipients $True
|
||||
if($?)
|
||||
{
|
||||
Write-Host Plus addressing enabled successfully -ForegroundColor Yellow
|
||||
}
|
||||
}
|
||||
|
||||
#Disable Plus Addressing
|
||||
if($Disable.IsPresent)
|
||||
{
|
||||
Set-OrganizationConfig –AllowPlusAddressInRecipients $False
|
||||
if($?)
|
||||
{
|
||||
Write-Host Plus addressing disabled successfully -ForegroundColor Yellow
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user