Here you go, you can modify this to get more data.
SELECT DISTINCT
OBJECT_SCHEMA_NAME(T.[object_id],DB_ID()) AS [Schema]
,T.[name] AS [table_name]
,I.[name] AS [index_name]
--,AC.[name] AS [column_name]
,I.[type_desc]
--,I.[is_unique]
--,I.[data_space_id]
--,I.[ignore_dup_key]
--,I.[is_primary_key]
--,I.[is_unique_constraint]
--,I.[fill_factor]
--,I.[is_padded]
--,I.[is_disabled]
--,I.[is_hypothetical]
--,I.[allow_row_locks]
--,I.[allow_page_locks]
--,IC.[is_descending_key]
--,IC.[is_included_column]
,PS.AVG_FRAGMENTATION_IN_PERCENT
FROM
sys.[tables] AS T
INNER JOIN sys.[indexes] I ON T.[object_id] = I.[object_id]
INNER JOIN sys.[index_columns] IC ON I.[object_id] = IC.[object_id]
INNER JOIN sys.[all_columns] AC ON T.[object_id] = AC.[object_id] AND IC.[column_id] = AC.[column_id]
INNER JOIN SYS.dm_db_index_physical_stats (DB_ID(), OBJECT_ID(''), NULL, NULL, 'LIMITED') PS ON PS.[OBJECT_ID]=T.[OBJECT_ID] AND I.[INDEX_ID]=PS.[INDEX_ID]
WHERE
T.[is_ms_shipped] = 0
--AND I.[type_desc] <> 'HEAP'
ORDER BY
T.[name]--, I.[index_id], IC.[key_ordinal]
I wrote this so long ago, there's probably a better way to do it but this works fine. You might want to create the temp_index table somewhere else though.