Forum Discussion

Marvin Oco's avatar
Marvin Oco
Iron Contributor
Oct 07, 2019

Using powershell to disable O365 POP and IMAP from a user CSV list

How to use powershell to disable O365 POP and IMAP from a user CSV list?

 

thanks

 

 

2 Replies

  • Kevin_Morgan's avatar
    Kevin_Morgan
    Iron Contributor

    Marvin Oco 

     

    Consider the CSV file "Users.csv" which contains username (or upn) of users with the column header UserPrincipalName and try the below commands.

    Import-Csv 'C:\Users.csv' | ForEach-Object {
    Set-CASMailbox -Identity $_."UserPrincipalName" -PopEnabled $false -ImapEnabled $false
    }

     

Resources