EMS - Select-Object ReplayLagTimes doesn't show up correctly when exported to CSV
Hello:
Does anyone have a fix for this? Thanks.
The CSV output from the command below looks good except ReplayLagTimes, which has a value of
System.Collections.Generic.KeyValuePair`2[Microsoft.Exchange.Data.Directory.ADObjectId,Microsoft.Exchange.Data.EnhancedTimeSpan][]. If I omit the "| Export-Csv D:\Temp\MB-DB-info.csv" part at the end, the console output shows ReplayLagTimes correctly.
Get-MailboxDatabase -Identity MB-* | Select-Object Name, EdbFilePath, LogFolderPath, ReplayLagTimes | Export-Csv D:\Temp\MB-DB-info.csv
April 14th, 2011 10:06am
Hi
If you run the command without the Export-CSV, I assume all is OK?
What version of Exchange are you using?
Sukh
Free Windows Admin Tool Kit Click here and download it now
April 14th, 2011 10:22am
Oh, forgot to mention, Exchange Server 2010 SP1 Update Rollup 3 v3. Yes, without the Export-CSV part, the console output shows ReplayLagTimes correctly. It seems like a bug in PS.
April 14th, 2011 10:54am
Hi
What if you Get-MailboxDatabase -Identity MB-* | Select-Object Name, EdbFilePath, LogFolderPath, ReplayLagTimes > c:\mb.txt
then import to excel, I assume this will work and a workaround?
Sukh
Free Windows Admin Tool Kit Click here and download it now
April 15th, 2011 5:38am
I didn't really need it in CSV format, so text will be fine. I was just wondering why it didn't work correctly in CSV. Thanks.
April 15th, 2011 10:31am
Hi SysAdmin-E.com,
The ReplayLagTimes property is an array of objects.
If you want to export it to CSV file, please use this cmdlet:
Get-MailboxDatabase -Identity MB-* | Select-Object Name, EdbFilePath, LogFolderPath,@{Name='ReplayLagTimes';Expression={[string]::join(";",($_.ReplayLagTimes))}} | export-csv D:\Temp\MB-DB-info.csvPlease remember to click Mark as Answer on the post that helps you, and to click Unmark as Answer if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Free Windows Admin Tool Kit Click here and download it now
April 18th, 2011 10:53pm