# Disabled ActiveSync and OWA in Exchange Online

**URL:** <https://forums.powershell.org/t/disabled-activesync-and-owa-in-exchange-online/2213>\
**Category:** PowerShell Help\
**Created:** [January 22, 2014, 7:56am UTC](https://forums.powershell.org/t/disabled-activesync-and-owa-in-exchange-online/2213 "2014-01-22T07:56:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeff-torres](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/jeff-torres/32/920_2.png) [@jeff-torres](https://forums.powershell.org/u/jeff-torres)\
**Post date:** [January 22, 2014, 7:56am UTC](https://forums.powershell.org/t/disabled-activesync-and-owa-in-exchange-online/2213/1 "2014-01-22T07:56:08Z")

</div>

Hello all!

I’m hoping this will be something fairly easy and obvious that I’m just missing.

I’m working on a script that will create a new mailbox in Office 365. This works great, but what I also would it to do is disable Exchange ActiveSync and OWA for Devices for the newly created user. After connecting to Exchange Online through PowerShell I’ve tried the Remove-MobileDevice and Remove-ActiveSync commands, but in those cases it’s looking for a device to remove, where I need it to disable the settings for a specified user. I’ve attached a screen of the exact setting I’m talking about.

---

<div class="post-metadata">

**Author:** ![lachlan-picking](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/lachlan-picking/32/919_2.png) [@lachlan-picking](https://forums.powershell.org/u/lachlan-picking)\
**Post date:** [January 22, 2014, 8:11am UTC](https://forums.powershell.org/t/disabled-activesync-and-owa-in-exchange-online/2213/2 "2014-01-22T08:11:18Z")

</div>

For the record, I don’t work with exchange and don’t have direct access to exchange modules so I can’t test this, but here’s what I got from google:

To disable ActiveSync for a specific user:

```
Set-CASMailbox -Identity <Mailbox ID> -ActiveSyncEnabled $False
```

To disable OWA for a specific user:

```
Set-CASMailbox -Identity <Mailbox ID> -OWAEnabled $false
```

where \<Mailbox ID\> is a GUID, distinguished name (DN), user principal name (UPN), SMTP address, or alias.

Apparently, you can also pipe objects into Set-CASMailbox from Get-User or Get-Mailbox but you’ll have to look into that because the online help for the exchange cmdlets looks pretty awful.

---

<div class="post-metadata">

**Author:** ![jeff-torres](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/jeff-torres/32/920_2.png) [@jeff-torres](https://forums.powershell.org/u/jeff-torres)\
**Post date:** [January 22, 2014, 8:17am UTC](https://forums.powershell.org/t/disabled-activesync-and-owa-in-exchange-online/2213/3 "2014-01-22T08:17:28Z")

</div>

That worked BEAUTIFULLY thank you. I’ll play around with what I can and can’t pipe in, but at the very least this accomplishes what I needed my script to do. Thank you!

---

<div class="post-metadata">

**Author:** ![lachlan-picking](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/lachlan-picking/32/919_2.png) [@lachlan-picking](https://forums.powershell.org/u/lachlan-picking)\
**Post date:** [January 22, 2014, 8:19am UTC](https://forums.powershell.org/t/disabled-activesync-and-owa-in-exchange-online/2213/4 "2014-01-22T08:19:32Z")

</div>

No problem! Just try running

```
Get-Help Set-CASMailbox -full
```

and it should tell you what parameters it accepts from the pipeline via property name or value.

---

<div class="post-metadata">

**Author:** ![jeff-torres](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/jeff-torres/32/920_2.png) [@jeff-torres](https://forums.powershell.org/u/jeff-torres)\
**Post date:** [January 22, 2014, 8:23am UTC](https://forums.powershell.org/t/disabled-activesync-and-owa-in-exchange-online/2213/5 "2014-01-22T08:23:08Z")

</div>

Yep, and actually I just tested with `Get-Mailbox -Identity j* | Set-CASMailbox -OWAEnabled $False -WhatIf` and it (theoretically) worked perfectly.

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:52pm UTC](https://forums.powershell.org/t/disabled-activesync-and-owa-in-exchange-online/2213/6 "2024-05-16T20:52:27Z")

</div>


