locked
Unable to Report On disabled IMAP and POP users RRS feed

  • Question

  • Hello everyone -

    I am having a issue with exporting a list of users to a csv file once I did a bulk change to disable IMAP, ActiveSync, and POP3.  This is the command that I ran:

    Get-CASMailbox | Set-CASMailbox -PopEnabled $false -ImapEnabled $false -ActiveSyncEnabled $false

    Once I ran that command I then ran the following to see generate a report for all the mailboxes with this feature disable

    Get-CASMailbox -ResultSize Unlimited | where {$_.ImapEnabled -eq "False"} | Select-Object Name,ImapEnabled | sort name | Export-Csv -Encoding ascii c:\IMAP_Users.csv -NoTypeInformation

    After running this command the file didn't show a list of all people that were disabled. Is there some services or something that needs to be restarted or a server?

    Thanks for all of the help if anyone can...

    Tuesday, August 14, 2012 9:24 PM

Answers

  • So I tried using the -ne "false" seems to have worked. I don't know why this is backwards but it did the trick. The command looks like this now:

    Get-CASMailbox -ResultSize Unlimited | where{$_.ImapEnabled -ne "True"} | Select-Object Name,ImapEnabled | sortname | Export-Csv -Encoding ascii c:\IMAP_Users.csv -NoTypeInformation

    Can anyone answer why this way worked and not the original command?

    • Marked as answer by Exchange Nebie Wednesday, August 15, 2012 1:48 AM
    • Edited by Exchange Nebie Wednesday, August 15, 2012 1:49 AM added more information
    Wednesday, August 15, 2012 1:48 AM

All replies

  • Export-Csv c:\IMAP_Users.csv -NoTypeInformation?
    Tuesday, August 14, 2012 9:55 PM
  • Export-Csv c:\IMAP_Users.csv -NoTypeInformation?
    Sorry I tried that as well. Let me be more clear i do get data exported but the only data that shows is people that are set to "True". I don't get all of the user's that are set to "False" which is what I need to report on.
    Wednesday, August 15, 2012 12:37 AM
  • On Tue, 14 Aug 2012 21:24:48 +0000, Exchange Nebie wrote:
     
    >
    >
    >Hello everyone -
    >
    >I am having a issue with exporting a list of users to a csv file once I did a bulk change to disable IMAP, ActiveSync, and POP3. This is the command that I ran:
    >
    >Get-CASMailbox | Set-CASMailbox -PopEnabled $false -ImapEnabled $false -ActiveSyncEnabled $false
    >
    >Once I ran that command I then ran the following to see generate a report for all the mailboxes with this feature disable
    >
    >Get-CASMailbox -ResultSize Unlimited | where
    >{$_.ImapEnabled -eq "False"} | Select-Object Name,ImapEnabled | sort
    >name | Export-Csv -Encoding ascii c:\IMAP_Users.csv -NoTypeInformation
    >
    >After running this command the file didn't show a list of all people that were disabled. Is there some services or something that needs to be restarted or a server?
    >
    >Thanks for all of the help if anyone can...
     
    Try "-PopEnabled:$false -ImapEnabled:$false
    -ActiveSyncEnabled:$false". Each of those is a switch and requires a
    ":<boolean>" setting.
     
    ---
    Rich Matheisen
    MCSE+I, Exchange MVP
     

    --- Rich Matheisen MCSE+I, Exchange MVP
    Wednesday, August 15, 2012 12:38 AM
  • On Tue, 14 Aug 2012 21:24:48 +0000, Exchange Nebie wrote:
     
    >
    >
    >Hello everyone -
    >
    >I am having a issue with exporting a list of users to a csv file once I did a bulk change to disable IMAP, ActiveSync, and POP3. This is the command that I ran:
    >
    >Get-CASMailbox | Set-CASMailbox -PopEnabled $false -ImapEnabled $false -ActiveSyncEnabled $false
    >
    >Once I ran that command I then ran the following to see generate a report for all the mailboxes with this feature disable
    >
    >Get-CASMailbox -ResultSize Unlimited | where
    >{$_.ImapEnabled -eq "False"} | Select-Object Name,ImapEnabled | sort
    >name | Export-Csv -Encoding ascii c:\IMAP_Users.csv -NoTypeInformation
    >
    >After running this command the file didn't show a list of all people that were disabled. Is there some services or something that needs to be restarted or a server?
    >
    >Thanks for all of the help if anyone can...
     
    Try "-PopEnabled:$false -ImapEnabled:$false
    -ActiveSyncEnabled:$false". Each of those is a switch and requires a
    ":<boolean>" setting.
     
    ---
    Rich Matheisen
    MCSE+I, Exchange MVP
     

    --- Rich Matheisen MCSE+I, Exchange MVP
    Just so I'm clear the command would look like this now? 
    Get-CASMailbox -ResultSize Unlimited | where
    >{$_.ImapEnabled -eq "$False"} | Select-Object Name,ImapEnabled | sort
    >name | Export-Csv -Encoding ascii c:\IMAP_Users.csv -NoTypeInformation
    • Marked as answer by Exchange Nebie Wednesday, August 15, 2012 1:46 AM
    • Unmarked as answer by Exchange Nebie Wednesday, August 15, 2012 1:46 AM
    Wednesday, August 15, 2012 1:09 AM
  • So I tried using the -ne "false" seems to have worked. I don't know why this is backwards but it did the trick. The command looks like this now:

    Get-CASMailbox -ResultSize Unlimited | where{$_.ImapEnabled -ne "True"} | Select-Object Name,ImapEnabled | sortname | Export-Csv -Encoding ascii c:\IMAP_Users.csv -NoTypeInformation

    Can anyone answer why this way worked and not the original command?

    • Marked as answer by Exchange Nebie Wednesday, August 15, 2012 1:48 AM
    • Edited by Exchange Nebie Wednesday, August 15, 2012 1:49 AM added more information
    Wednesday, August 15, 2012 1:48 AM
  • On Wed, 15 Aug 2012 01:09:21 +0000, Exchange Nebie wrote:
     
    >On Tue, 14 Aug 2012 21:24:48 +0000, Exchange Nebie wrote: > > >Hello everyone - > >I am having a issue with exporting a list of users to a csv file once I did a bulk change to disable IMAP, ActiveSync, and POP3. This is the command that I ran: > >Get-CASMailbox | Set-CASMailbox -PopEnabled $false -ImapEnabled $false -ActiveSyncEnabled $false > >Once I ran that command I then ran the following to see generate a report for all the mailboxes with this feature disable > >Get-CASMailbox -ResultSize Unlimited | where >{$_.ImapEnabled -eq "False"} | Select-Object Name,ImapEnabled | sort >name | Export-Csv -Encoding ascii c:\IMAP_Users.csv -NoTypeInformation > >After running this command the file didn't show a list of all people that were disabled. Is there some services or something that needs to be restarted or a server? > >Thanks for all of the help if anyone can... Try "-PopEnabled:$false -ImapEnabled:$false -ActiveSyncEnabled:$false". Each of those is a switch and requires a
    >":<boolean>" setting. --- Rich Matheisen MCSE+I, Exchange MVP
    >--- Rich Matheisen MCSE+I, Exchange MVPJust so I'm clear the command would look like this now? Get-CASMailbox -ResultSize Unlimited | where >{$_.ImapEnabled -eq "$False"} | Select-Object Name,ImapEnabled | sort >name | Export-Csv -Encoding ascii c:\IMAP_Users.csv -NoTypeInformation
     
    No, not the test to see if the protocol is enabled. Change the
    set-casmailbox switch values.
     
    ---
    Rich Matheisen
    MCSE+I, Exchange MVP
     

    --- Rich Matheisen MCSE+I, Exchange MVP
    Wednesday, August 15, 2012 2:33 AM
  • On Wed, 15 Aug 2012 01:48:41 +0000, Exchange Nebie wrote:
     
    >
    >
    >So I tried using the -ne "false" seems to have worked. I don't know why this is backwards but it did the trick. The command looks like this now:
    >
    >Get-CASMailbox -ResultSize Unlimited | where{$_.ImapEnabled -ne "True"} | Select-Object Name,ImapEnabled | sortname | Export-Csv -Encoding ascii c:\IMAP_Users.csv -NoTypeInformation
    >
    >
    >
    >Can anyone answer why this way worked and not the original command?
     
    Remove the quotes around your test value:
     
    where {$_.ImapEnabled -eq $false}
     
    or use a negated test:
     
    where {!$_.ImapEnabled}
     
    ImapEnabled is a boolean object. It's either $true or $false but it
    isn't the "true" or "false".
     
     
    [PS] C:\>(get-casmailbox "mbx").ImapEnabled|gm
     
     
    TypeName: System.Boolean
     
    Name MemberType Definition
    ---- ---------- ----------
    CompareTo Method int CompareTo(System.Object obj), int
    CompareTo(bool value)
    Equals Method bool Equals(System.Object obj), bool
    Equals(bool obj)
    GetHashCode Method int GetHashCode()
    GetType Method type GetType()
    GetTypeCode Method System.TypeCode GetTypeCode()
    ToString Method string ToString(), string
    ToString(System.IFormatProvider provider)
     
     
     
    If you want to use "true" or "false" then use this:
     
    where {$_.ImapEnabled.ToString() -eq "false"}
    where {$_.ImapEnabled.ToString() -eq "true"}
     
    ---
    Rich Matheisen
    MCSE+I, Exchange MVP
     

    --- Rich Matheisen MCSE+I, Exchange MVP
    Wednesday, August 15, 2012 3:13 AM
  • Thanks for this update. Removing the quotes worked just fine. Now what if i wanted to report on users with ImapEnabled $True and $False? How would that script look? Thanks to everyone
    Friday, August 17, 2012 4:34 PM
  • On Fri, 17 Aug 2012 16:34:24 +0000, Exchange Nebie wrote:
     
    >Thanks for this update. Removing the quotes worked just fine. Now what if i wanted to report on users with ImapEnabled $True and $False? How would that script look? Thanks to everyone
     
    Just remove your "where"!
     
    Get-CASMailbox -ResultSize Unlimited | Select-Object Name,ImapEnabled
    | sort name | Export-Csv -Encoding ascii c:\IMAP_Users.csv
    -NoTypeInformation
     
    ---
    Rich Matheisen
    MCSE+I, Exchange MVP
     

    --- Rich Matheisen MCSE+I, Exchange MVP
    Friday, August 17, 2012 7:48 PM