Script to export list of users with activesunc enabled on

Status
Not open for further replies.
A

Andrew Story

Hi Guys,

I'm trying to find a way to export a list of users who have active sync

enabled only.

I'm 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'm 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?
 
M

Mike Pfeiffer

Give this a try:

Get-CASMailbox -ResultSize Unlimited | ?{$_.ActiveSyncEnabled} | Select

DisplayName,ActiveSyncEnabled | Export-Csv c:\eas.csv -NoType

that's all on one line, so watch out for text wrap

"Andrew Story" wrote:


> Hi Guys,

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

> I'm 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'm 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?

> .
>
 
K

Karl Mitschke

Hello Andrew,


> Hi Guys,

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

> I'm 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"

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

> Get-CASMailbox -ResultSize Unlimited |Format-List ActiveSyncEnabled
> $True,
>


Identity>>C:\temp\eas.csv

Identity>>
> Would anyone be able to pint me in the right direction please to
> retrieve this information from exchange?
>


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/
 
A

Andrew Story

Thanks for your input guys.

"Andrew Story" <andrewDOTstoryATjameswalkerDOTbiz> wrote in message

news:%23ZZWZWtvKHA.5340@TK2MSFTNGP04.phx.gbl...
> Hi Guys,

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

> I'm 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'm 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?
>
 
Status
Not open for further replies.
Top