Disable Access to Service (protocol ) by using PowerShell | Office 365 5/5 (1)

In the current article, we will review how to use the PowerShell commands for disabling a particular access protocol in Exchange Online environment.

Most of the time, we use PowerShell for update existing object or create new objects such as users, Mailboxes, etc.
In some scenarios, we need to create the opposite action – disable specific services.

There are many reasons for disabling a particular service. For example – prevent from the user the option to use POP3/IMAP4 protocol for reading mail, because by default “Behaviour” of these protocols is to download (move) e-mails from the Mailbox to the local hard drive.

Another example could be disabling to option to use ActiveSync protocol (access to the mailbox by suing mobile device) for security reasons, or for troubleshooting mail problems.

In this article, we review some examples of services that are enabled by default, and we need to disable these services for a particular user or all the Office 365 Users (Bulk Mode).

PowerShell | Help & additional information

In case that you are a novice in the PowerShell environment, you can use the following link to get more information about the “first steps” such as: downloading the required PowerShell
software components, how to use the PowerShell console, running a PowerShell script, etc.

Read more
Link Table

PowerShell Naming Conventions & general information

If you want to get more information about the Naming Conventions that we use for this article and get some general tips about: how to work with the PowerShell, read the article: Help and additional information – o365info.com PowerShell articles

Create remote PowerShell session

Before we can use the required PowerShell commands, we need to download and install the Office 365 cmdlets + create remote PowerShell session to Office 365 or Exchange Online. If you need more information about how to create a remote PowerShell session read the following articles: Part 2: Connect to Office 365 by using Remote PowerShell and Part 3: Connect to Exchange Online by using Remote PowerShell

How to use a PowerShell script

Most of the PowerShell articles include a PowerShell script that simplifies the use of the PowerShell commands. If you want to get more information about: How to use a PowerShell script, read the article: Connect to Office 365 and Exchange Online using a script

PowerShell command and Script languish in more details

If you are new to the PowerShell world, you can read more information about PowerShell in Office 365 environment in the article: The Power of PowerShell


1. Disable OWA Access

1.1 – Disable User access to OWA

PowerShell command Syntax

PowerShell command Example

1.2 -Disable access to OWA for all Office 365 users (Bulk Mode)

PowerShell command Syntax


2. Disable POP3/IMAP4 Access

2.1 – Disable User access to POP3/IMAP4

PowerShell command Syntax

PowerShell command Example

2.2 – Disable access to POP3/IMAP4 for all Office 365 users (Bulk Mode)

PowerShell command Syntax


3. Disable ActiveSync Access

3.1 – Disable User access to ActiveSync

PowerShell command Syntax

PowerShell command Example

3.2 – Disable access to ActiveSync for all Office 365 users (Bulk Mode)

PowerShell command Syntax


4. Disable Outlook AnyWhere Access

4.1 – Disable User access to Outlook AnyWhere

PowerShell command Syntax

PowerShell command Example

4.2 – Disable access to Outlook AnyWhere for all Office 365 users (Bulk Mode)

PowerShell command Syntax


5. Disable Office 365 user account

5.1 – Disable Office 365 user account

PowerShell command Syntax

PowerShell command Example


6. Disable Access to PowerShell

6.1 – Disable Access to PowerShell

PowerShell command Syntax

PowerShell command Example

6.2 – Disable Access to PowerShell by using Filter – by Title

PowerShell command Syntax

PowerShell command Example


7. Display information

7.1 – Display information about PowerShell status (Enabled or Disabled)

PowerShell command Syntax

PowerShell command Example

7.2 – Display information about User (Mailbox) Services

PowerShell command Syntax

PowerShell command Example

7.3 – Display information about ALL Users (Mailbox’s) Services

PowerShell command Syntax

7.4 – Display information about all Locked users accounts

PowerShell command Syntax

8. Download Disable Access by protocol PowerShell menu script

For your convenience, I have “Wrapped” all the PowerShell commands that were reviewed in a PowerShell Script named:
Disable-Service.ps1
You are welcome to download the script and use it.

download-button-02.png

PowerShell command syntax – Office 365 | Article series index

Now it’s Your Turn!
It is important for us to know your opinion on this article


Summary
Article Name
Disable Access to Service (protocol ) by using PowerShell | Office 365
Description
In the current article, we will review how to use the PowerShell commands for disabling a specific access protocol in Exchange Online environment.
Author
Publisher Name
o365info.com
Publisher Logo

Please rate this

Print Friendly

Related Post

Eyal Doron on EmailEyal Doron on FacebookEyal Doron on GoogleEyal Doron on LinkedinEyal Doron on PinterestEyal Doron on RssEyal Doron on TwitterEyal Doron on WordpressEyal Doron on Youtube
Eyal Doron
Share your knowledge.
It’s a way to achieve immortality.
Dalai Lama

One Response to “Disable Access to Service (protocol ) by using PowerShell | Office 365”

Leave a Reply

Your email address will not be published. Required fields are marked *