Quantcast
Channel: Brian Pedersen's Sitecore and .NET Blog
Viewing all articles
Browse latest Browse all 285

Get Sitecore System Info

$
0
0

Would you like to know the System Info of your current Sitecore instance:

Sitecore System Info

Sitecore System Info

It’s fairly easy. I created an SysInfo.aspx page and dumped in into the /sitecore modules/shell folder. The page is now available on the URL <yourwebsite>/sitecore modules/shell/sysinfo.aspx.

The top info is retrieved directly from Sitecore using the Sitecore.Configuration.About.ToHtml() method. The rest is retrieved from the Sitecore Configuration:

<%@ Page Language="c#" EnableEventValidation="false" AutoEventWireup="true" EnableViewState="false" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Security.Principal" %>
<%@ Import Namespace="System.Threading" %>

<script runat="server">
  void Page_Init(object sender, System.EventArgs e)
  {
  }

  void Page_Load(object sender, System.EventArgs e)
  {
    Response.Buffer = false;
    Response.BufferOutput = false;
    DataBind();
  }
</script>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
  <title>System Info</title>
</head>
<body>
  <form id="MainForm" runat="server"></form>
  <%# Sitecore.Configuration.About.ToHtml() %><br />
  <br />
  <table>
    <tr>
      <td>Instance name</td>
      <td><%# Sitecore.Configuration.Settings.InstanceName %></td>
    </tr>
    <tr>
      <td>Data Folder</td>
      <td><%# Sitecore.Configuration.Settings.DataFolder %></td>
    </tr>
    <tr>
      <td>Log folder</td>
      <td><%# Sitecore.Configuration.Settings.LogFolder %></td>
    </tr>
    <tr>
      <td>Temp folder</td>
      <td><%# Sitecore.Configuration.Settings.TempFolderPath %></td>
    </tr>
    <tr>
      <td>Version file</td>
      <td><%# Sitecore.Configuration.Settings.VersionFilePath %> <%# File.Exists(Sitecore.Configuration.Settings.VersionFilePath) ? "found" : "Not found" %></td>
    </tr>
    <tr>
      <td>License file</td>
      <td><%# Sitecore.Configuration.Settings.LicenseFile %> <%# File.Exists(Sitecore.Configuration.Settings.LicenseFile) ? "found" : "Not found" %></td>
    </tr>
    <tr>
      <td>Analytics enabled</td>
      <td><%# Sitecore.Configuration.Settings.Analytics.Enabled %></td>
    </tr>
    <tr>
      <td>License ID</td>
      <td><%# Sitecore.SecurityModel.License.License.LicenseID %></td>
    </tr>
    <tr>
      <td>Sitecore.xDB.Base is present</td>
      <td><%# Sitecore.SecurityModel.License.License.HasModule("Sitecore.xDB.Base") %></td>
    </tr>
    <tr>
      <td>xDB enabled</td>
      <td><%# Sitecore.Configuration.Settings.GetBoolSetting("Xdb.Enabled", true) %></td>
    </tr>
  </table>
  <hr />
  <%# System.Web.Helpers.ServerInfo.GetHtml() %>
</body>
</html>

To top it off I also added a call to System.Web.Helpers.ServerInfo.GetHtml() to get the .ASP Net info:

.ASP Net Server Info

.ASP Net Server Info

 

CAUTION! THIS IS HIGHLY CLASSIFIED INFORMATION

Please be aware that the information on a page like this is highly classified and is pure candy for any hacker. So make sure that the page is not available from outside, or at least protected by security of some kind.

I always protect pages like this using Declarative security as described in this blog post: Using Declarative Security in Sitecore. Even if the page is not available from the web.

MORE TO READ: 



Viewing all articles
Browse latest Browse all 285

Trending Articles