Forum Discussion
ckarawani-dev
Aug 01, 2021Copper Contributor
Get-CsOnlineUser - Cannot filter with boolean attributes due to casting errors
Since Friday July 20th 2021, Every time I run a Get-CsOnlineUser with a Filter on a boolean attribute, I am getting an error. Example 1: Getting users with Voice Enabled: Get-CsOnli...
craigjohnson
Aug 03, 2021Copper Contributor
I am having the same issue. have you received any updates yet?
- ckarawani-devAug 03, 2021Copper Contributor
The ticket is still open. Their support resource provided a wrongful suggestion using "$true" as true and "$null" as false. This is not a valid solution as any non-empty string would resolve true.
For now , the two viable workarounds I identified are:
1. Using any non-empty string (ex. 'banana') as true and an empty string '' as false.
Not ideal and a bit of a hack using an empty/non-empty string as my flags.
2. Using Where-Object {$_.EnterpriseVoiceEnabled -eq $true} instead.
Also not ideal as it is way less efficient as it first fetches the non-filtered results to then discard a bunch via the Where-Object.
Still waiting on a better fix.- craigjohnsonAug 03, 2021Copper Contributor
ckarawani-dev thank you for the update. making those changes on my scripts worked.