Exchange Server - Script to export list of users with activesunc enabled on

Asked By Andrew Story
08-Mar-10 10:39 AM
Hi Guys,

I am trying to find a way to export a list of users who have active sync
enabled only.

I am running the below but it shows me all users and isn;t very friendly when
exported to CSV - I canlt seem to sort the data to make sense of it:

Get-CASMailbox -ResultSize Unlimited |Format-List ActiveSyncEnabled,
Identity >"C:\temp\eas.csv"

I also try to run the below but it won;t run, I am guessing it;s down the the
$true entry:

Get-CASMailbox -ResultSize Unlimited |Format-List ActiveSyncEnabled $True,
Identity >"C:\temp\eas.csv"

Would anyone be able to pint me in the right direction please to retrieve
this information from exchange?
HasActiveSyncDevicePartnership
(1)
CASMailbox
(1)
DistinguisheDName
(1)
DisplayName
(1)
ResultSize
(1)
NoType
(1)
Identity
(1)
Guys
(1)
  Mike Pfeiffer replied to Andrew Story
08-Mar-10 12:49 PM
Give this a try:

Get-CASMailbox -ResultSize Unlimited | ?{$_.ActiveSyncEnabled} | Select
DisplayName,ActiveSyncEnabled | Export-Csv c:\eas.csv -NoType

that is all on one line, so watch out for text wrap
  Karl Mitschke replied to Andrew Story
08-Mar-10 04:56 PM
Hello Andrew,

Identity>> "C:\temp\eas.csv"
Identity>>
Identity>>C:\temp\eas.csv
Identity>>

Try this one liner:

Get-CASMailbox -ResultSize Unlimited -Filter{(HasActiveSyncDevicePartnership
-eq $true) -AND (name -notlike "cas*")}| select name, servername, DistinguisheDName,
ActiveSyncMailboxPolicy |Export-Csv C:\temp\eas.csv -NoTypeInformation


Karl
http://unlockpowershell.wordpress.com/
  Andrew Story replied to Andrew Story
09-Mar-10 03:22 AM
Thanks for your input guys.
Create New Account
help
Thanks, Rodolfo Exchange Setup Discussions MAPIBlockOutlookNonCachedMode (1) MAPIBlockOutlookRpcHttp (1) ActiveSyncAllowedDeviceIDs (1) ImapMessagesRetrievalMimeFormat (1) PopMessagesRetrievalMimeFormat (1) HasActiveSyncDevicePartnership (1) ImapUseProtocolDefaults (1) PopUseProtocolDefaults (1) Set-CASMailbox "Username" -OWASmimeEnabled $false -OWAJunkEmailEnabled $false For all users: Get-mailbox | Set-CASMailbox "Username" -OWASmimeEnabled $false -OWAJunkEmailEnabled $false - - Bharat Suneja MVP - Exchange www.zenprise.com NEW blog location Servers / cn = ex2 ServerName : ex2 DisplayName : Ex2007test ActiveSyncAllowedDeviceIDs : {} ActiveSyncMailboxPolicy : Default ActiveSyncMailboxPolicyIsDefaulted : True ActiveSyncDebugLogging : ActiveSyncEnabled : True HasActiveSyncDevicePartnership : False OWAEnabled : True OWACalendarEnabled : OWAContactsEnabled : OWATasksEnabled : OWAJournalEnabled : OWANotesEnabled : OWARemindersAndNotificationsEnabled : OWAPremiumClientEnabled : OWASpellCheckerEnabled : OWASearchFoldersEnabled : OWASignaturesEnabled : OWAThemeSelectionEnabled : OWAJunkEmailEnabled IsValid : True OriginatingServer : hssdc2.HSSMAIN.ORG ExchangeVersion : 0.1 (8.0.535.0) Name : Ex2007test DistinguishedName : CN = Ex2007test, CN = Users, DC = HSSMAIN, DC = OR G Identity : HSSMAIN.ORG / Users / Ex2007test Guid cn = EX1 ServerName : ex1 DisplayName : Nunez, Rodolfo ActiveSyncAllowedDeviceIDs : {} ActiveSyncMailboxPolicy : Default ActiveSyncMailboxPolicyIsDefaulted : True ActiveSyncDebugLogging : ActiveSyncEnabled : False HasActiveSyncDevicePartnership : True OWAEnabled : True OWACalendarEnabled : False OWAContactsEnabled : False OWATasksEnabled : False OWAJournalEnabled : False OWANotesEnabled : False OWARemindersAndNotificationsEnabled : False True OriginatingServer : hssdc2.HSSMAIN.ORG ExchangeVersion : 0.1 (8.0.535.0) Name : Nunez, Rodolfo DistinguishedName : CN = Nunez \ , Rodolfo, OU = IT, OU = Staff, DC = HS SMAIN, DC = ORG Identity : HSSMAIN.ORG
and POP3 for a specified user Exchange Server I am trying to use the Set-CASMailbox command to enable IMAP4 and POP3 for a user and I can't get it to work. The command I am using is: Set-CASMailbox -identity <username> imapenable and it comes back and says missing here? Larry Exchange Admin Discussions Microsoft Exchange (1) SAMAccountName (1) CASMailbox (1) SMTP (1) DistinguishedName (1) MailNickname (1) TrueYou (1) Rodolfo (1) Larry, Did you try to enable this using correctly but your command doesn't look right. . . Is this what you are tipying? Set-CASMailbox -identity <username> -ImapEnabled:$true Set-CASMailbox -identity "username" -ImapEnabled $true You can use any name that uniquely identifies a user for the -identity parameter, such as: - sAMAccountName - Display Name - mailNickname / alias - distinguishedName - SMTP address - - Bharat Suneja MVP - Exchange www.zenprise.com NEW blog location: exchangepedia.com / blog - -- -- -- -- -- -- -- -- -- -- -- -- -- - Here is what I am typing: PS C: \ Documents and Settings \ root> Set-CASMailbox -identity <username> -ImapEnabled:$true The redirection operator '<' is not supported yet. At line:1 char
get_mailbox | set-casmailbox perhaps? Exchange Server get_mailbox | set-casmailbox perhaps? Exchange Admin Discussions Get_mailbox (1) Casmailbox (1) Perhaps (1) oh, 2 bits. much more elegant. Hi How can I disable all and imap accounts for all users in my exchange organization? I am trying with set-casmailbox but this only disables it for a single user? Regards, Miha If you want to looking for a powerscript that will do that. Regards, Miha Thanks have found it get-casmailbox | where{$_.popEnabled -eq "True"} | set-casmailbox -popEnabled:$false Regards, Miha keywords: get_mailbox, | , set-casmailbox, perhaps? description: get_mailbox | set-casmailbox perhaps?