Filter Object with string {}

by ceem at 2013-03-21 05:16:12

Hello guys

I am trying to get all Publicfolders which do not have a Replication. The Value is {}.
What am I doing wrong or how do I escape those { ?

get-publicfolder -Identity "\NON_IPM_SUBTREE\OFFLINE ADDRESS BOOK" -recurse | where {$.Replicas-match"’{}’"}

Thanks for your help
by mjolinor at 2013-03-21 05:25:55
That {} is telling you the property is an array. To find the ones that don’t have any replicas (entries in the array):

get-publicfolder -Identity "\NON_IPM_SUBTREE\OFFLINE ADDRESS BOOK" -recurse |
where {$
.Replicas.count -eq 0}
by ceem at 2013-03-21 07:38:27
Thanks for the quick replay that did it.
Another question concerning this. How can I set the value to {}?
I tried:

set-publicfolder -Replicas $null
by mjolinor at 2013-03-21 07:45:43
Try this:

set-publicfolder -replicas @()