You could use SQL Powershell Extensions (SQLPSX):
http://www.codeplex.com/sqlpsx $dbs = Get-SqlDatabase Z002
$dbs | Select Select Name, LastBackupDate
$dbs | Get-SqlDataFile
$dbs | Get-SqlLogFile
The call to Get-SqlDatabase will return a collection of all databases other than system databases for the server named Z002, the next three lines return the information you are requesting.
There are several of ways of getting this information in addition to using SQLPSX. You can issue T-SQL calls from Powershell, use the SMO classes directly, or use the SQL Server 2008 Provider to get the same information. If you'd like to use an alternative approach let me know and I'll post the code.