views:

487

answers:

2

In my output, I get

@{ActiveSyncEnabled=False}

how do I parse this so that it just says "False"?

the output is coming from this line of code:

 $pda = get-casmailbox -Anr $user.displayname | select activesyncenabled
A: 

I don't have access to an exchange box right now, but the information should be there now for someone that does. Here is what worked:

$pda = get-casmailbox -Anr $user.displayname | select activesyncenabled $pda.ActiveSyncEnabled | Write-Host

EBGreen
that didn't work.. the output is now "@{activesyncenabled.ActiveSyncEnabled=}" thanks
phill
When you say "output" how are you generating the output? Are you just doing Write-Host $pda?
EBGreen
I'm doing something similar .. $pda | write-host
phill
What if you go back to the way that you were populating $pda before then use this: $pda.ActiveSyncEnabled | Write-Host
EBGreen
hey that worked! I didn't know you could do that till now. thanks man
phill
+1  A: 

To access the value directly:

(get-casmailbox -Anr $user.displayname).activesyncenabled

You can skip anr and use the identity member:

Get-CASMailbox $user.Identity

To get all activesyncenabled enabled mailboxes:

get-casmailbox -resultSize unlimited -filter {activesyncenabled -eq $true}

Shay Levy