Disabled ActiveSync and OWA in Exchange Online

Welcome Forums General PowerShell Q&A Disabled ActiveSync and OWA in Exchange Online

This topic contains 4 replies, has 2 voices, and was last updated by

 
Participant
4 years, 10 months ago.

  • Author
    Posts
  • #12713

    Participant
    Points: 1
    Rank: Member

    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.

  • #12716

    Participant
    Points: 1
    Rank: Member

    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!

  • #12717

    Participant
    Points: 0
    Rank: Member

    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.

  • #12718

    Participant
    Points: 1
    Rank: Member

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

  • #12715

    Participant
    Points: 0
    Rank: Member

    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  -ActiveSyncEnabled $False

    To disable OWA for a specific user:

    Set-CASMailbox -Identity  -OWAEnabled $false

    where 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.

The topic ‘Disabled ActiveSync and OWA in Exchange Online’ is closed to new replies.