We have Exchange Info Stores that begin with UsersA-B, UsersC-D, etc., and then some that are outside that naming convention.
$allIS = Get-MailboxDatabase |
Where { $_.name -notlike "*Users*" } |
Select Identity
I'll lookup a current user's info store, and then try to do a comparison on the $allIS array. If it matches, do some action.
When I output the value of $allIS[0] for instance, it returns @{Identity=MSCCR\CEO\CEO}.
I'd like to throw those converted strings into a different array, and then do the comparison. This would be to have a dynamic list of information stores to compare against. But maybe this isn't the best, most efficient way. What would be the best way to try to do this comparison, as right now I'm comparing apples to oranges here?
$allIS | % {[string]$_.Identity}will convert all objects in the array to strings. Is that what you want?