PowerShell - Different Answers to Same Query Posed two ways
Hi All: New to PowerShell so I may be missing something here.While trying to identify a set of public folders to be mail enabled I entered the following queryGet-PublicFolder "\Folder\Subfolder1\ -recurse | Where-Object {$_.MailEnabled -eq "False"}The output list included a folder that I knew to be mail enabled which puzzled me so I ran a second query as followsGet-PublicFolder "\Folder\Subfolder1\FolderInQuestion" | Format-ListThe output from Format-List showed the MailEnabled Property set to 'True'.So I tested to verify that this folder was mail-enabled and it is.Has anyone else seen this anomaly or am I missing something?Is this a bug in the Where-Object cmdlt?Windows 2008 Server SP2 Exchange 2007 SP1ThanksBPL
November 28th, 2009 12:48am

On Fri, 27-Nov-09 21:48:56 GMT, BPLewis wrote:'.So I tested to verify that this folder was mail-enabled and it is.Has anyone else seen this anomaly or am I missing something?Is this a bug in the Where-Object cmdlt?Windows 2008 Server SP2 Exchange 2007 SP1ThanksBPL Do you get the same results if you use:where {$_.mailenabled -eq $false}If you try this you'll see that a string comparison isn't producingthe results you think it is.$a = $false$a -eq "False"$a -eq "$false"$a -eq $false---Rich MatheisenMCSE+I, Exchange MVP--- Rich Matheisen MCSE+I, Exchange MVP
Free Windows Admin Tool Kit Click here and download it now
November 28th, 2009 4:44am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics