March 25, 2008

What Modules Do I Have and How Many of Them?

Finding out how many modules you have installed on a site, and additionally how many times those modules are used is something that you would think is very simple within DotNetNuke.  However, it is a bit more complex than one would hope.  By default DNN does not provide a mechanism for you to perform this kind of research, however, I have a very simple SQL Script that will allow you to see ALL modules and from there the total number of instances (in all portals) and the total number of instances that are deleted (in the recycle bin).  From an administrative perspective this is a key piece of information to know.

FROM Modules 
WHERE ModuleDefId MD.ModuleDefId
AS 'TotalInstances',
FROM Modules 
WHERE ModuleDefId MD.ModuleDefId 
AND IsDeleted 1
AS 'RecycleBinInstances' 
FROM DesktopModules DM
INNER JOIN ModuleDefinitions MD 
ON DM.DesktopModuleID MD.DesktopModuleID 
GROUP BY DM.ModuleName, DM.Friendlyname, MD.ModuleDefId 
ORDER BY 'TotalInstances'

Just run this script and you will quickly see all modules and module counts. A few things to note, if you have multiple portals this script will give only 1 count. Additionally this script will show you ALL modules, including "host" and "admin" modules provided by the DNN core. However as a general rule this should help you with your next administration task.

Please share any comments below, for technical assistance please use my forum!

tags: DNN, Tutorials, SQL
comments powered by Disqus

Content provided in this blog is provided "AS-IS" and the information should be used at your own discretion.  The thoughts and opinions expressed are the personal thoughts of Mitchel Sellers and do not reflect the opinions of his employer.

Content Copyright

Content in this blog is copyright protected.  Re-publishing on other websites is allowed as long as proper credit and backlink to the article is provided.  Any other re-publishing or distribution of this content is prohibited without written permission from Mitchel Sellers.