Unable to Report On disabled IMAP and POP users
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 $falseOnce I ran that command I then ran the following to see generate a report for all the mailboxes with this feature disableGet-CASMailbox -ResultSize Unlimited | where
{$_.ImapEnabled -eq "False"} | Select-Object Name,ImapEnabled | sort
name | Export-Csv -Encoding ascii c:\IMAP_Users.csv -NoTypeInformationAfter 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...
August 14th, 2012 5:31pm
Export-Csv c:\IMAP_Users.csv -NoTypeInformation?
Free Windows Admin Tool Kit Click here and download it now
August 14th, 2012 6:02pm
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.
August 14th, 2012 8:44pm
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
Free Windows Admin Tool Kit Click here and download it now
August 14th, 2012 8:45pm
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
August 14th, 2012 9:16pm
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?
Free Windows Admin Tool Kit Click here and download it now
August 14th, 2012 9:55pm
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
August 14th, 2012 10:40pm
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
Free Windows Admin Tool Kit Click here and download it now
August 14th, 2012 11:20pm
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
August 17th, 2012 12:41pm
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
Free Windows Admin Tool Kit Click here and download it now
August 17th, 2012 3:55pm