Linking systems to Advertisements for user notifications

The SMS 2003 web reports have some cool built in stuff around advertisements, one in particular is viewing advertisements for a specific system. A way that you can take advantage of this is to include a link in your customer communication so that they can view all active advertisements hitting their system. But how do you do this without giving them instructions for navigating throughout the web reports? Wouldn’t a link be nice?

The actual link is going to http://REPORTINGPOINT/smsreporting_SITECODE/Report.asp?ReportID=131&ComputerName=COMPUTERNAME (Note this is not a real link as everything in CAPS needs to be changed for your environment). The beginning of this link is easy enough to change as your SMS Reporting Point URL won’t change that often, but now what you need is some custom scripting to grab the COMPUTERNAME dynamically when someone visits the webpage.

To do this first you will need to enable ReverseDNS Lookups on your web server. You can do this by running the following command as documented in KB245574

cscript adsutil.vbs set /w3svc/1/ROOT/EnableReverseDNS “TRUE”

Once this has been done, copy the text below into a file and call it adverts.asp:



Dim strUser

strCompName = Request.ServerVariables(“REMOTE_HOST”)

strPullDNS = InStr(1,strCompName,”.”) -1

strCompName = Left(strCompName, strPullDNS)

Response.Redirect “http://REPORTINGPOINT/smsreporting_SITECODE/Report.asp?ReportID=131&ComputerName=” & strCompName


Edit this with notepad and change the REPORTINGPOINT and SITECODE values to accurately represent your site configuration.  Then go to the <DRIVELETTER>:\Inetpub\wwwroot\Smsreporting_SITECODE directory on your reporting point and place the adverts.asp file in it. After this you can simply run the following from a web browser to automatically detect the system name and display all active advertisements going to it:



***Remember to back this up because whenever you run a site reset or upgrade (like SMS SP1) this could be overwritten or deleted!

Leave a Reply

Your email address will not be published. Required fields are marked *