Saturday, February 23, 2008

SSRS - SQL Server Reporting Services Scheduling Error

I've worked with SSRS 2000 and 2005. I have done very little in the way of report creation using SSRS. Mainly have used the Report Manager to schedule subscriptions. I also have dealt with issues on the SQL side of SSRS. My role related to SSRS has been the support of the existing infrastructure for SSRS.

Error 8198 - The job failed. Unable to determine if the owner (domain\username) of job myjob has server access (reason: Could not obtain information about Windows NT group/user 'domain\username'. [SQLSTATE 42000] (Error 8198)).

If running the SSRS Report Server service under a network account, you will be unable to schedule reports. The work around for us was to change the SQL Agent job owner to 'sa'. The issue is that once you change the owner to 'sa', you are no longer able to change the job's schedule from reporting services without changing the owner of the job back to the network account used to run the Report Server. So, I created a few shared schedules in SSRS and changed those jobs to an owner of 'sa'. I just assign one of these schedules to my reports. The only time I have to change the owner of a job is when I am changing or creating a new schedule within the Report Manager. I believe this issue will go away in SQL 2005 SSRS but haven't tested it out. If you do test it and find it resolves the issue let me know and I will update the site.

After resolving the issue above I found an article on Microsoft's website that states the cause and workaround. Click here to read it.

Thursday, February 21, 2008

XML What's All That About Anyway?

I recently had to work with XML within SQL 2005. It was a learning experience for sure.

So what is XML?

- XML stands for Extensible Markup Language

- If you've ever seen HTML you'll see the similarity

- The purpose of XML as I understand it is to transport, store, and structure data.

XML seems to be getting bigger and bigger. It is everywhere you turn. Apparently it is a great way to structure data and pull/index data. My use for it was in a XML datatype column. It was an IP Address Management database and it was being used to track different devices such as printers, switches, routers, desktops, servers, etc...As such, these different devices types have different properties that needed to be tracked. The best solution was an XML datatype in SQL 2005 that defines the data for each of these devices.

Please feel free to make any corrections or post comments and I will make corrections. I am certainly not an XML expert.

Below is some sql code that I used to query a table...hopefully it will help someone out I wish I had the TSQL before I started.

Here is the csv that was exported from a test table I had setup to test.

Please feel free to post any comments or questions...Enjoy your XML experience!!!

Some links you might find useful(I borrowed some parts of the example from the first link...:

1. http://www.code-magazine.com/article.aspx?quickid=0605081&page=1
2. http://www.w3schools.com/xml/xml_whatis.asp
3. http://en.wikipedia.org/wiki/XML

Thursday, February 7, 2008

Change local administrator account password

The script below changes the local administrator account for the PCs in Computers.txt and logs success to one log file, failure to another, and a third with the list of PCs that were registered as failures so that you can use that list to run the script again at a different time after fixing the errors. Some errors are ping failures and these obviously will be PCs that are not on the network. You will need to change the directories in the script or create the directory structure for this script to work. Note: When you run this you will need to be using an account that has administrative access to the PCs. I used my account that is in a group that is setup to be an administrator on all PCs.

Tuesday, February 5, 2008

VBScript to change Excel Macro Security

The script below will change the Excel Macro Security to Low. I created it for the purpose of changing the macro security level to Low for running reports. The server was also used to edit Excel reports and thus the security always got changed to medium or high while people edited reports and often forgot to change it back to Low. Hence, the popup asking to enable/disable macros causing the report to sit there waiting for user input. This script ran prior to the scheduled reports running to ensure the security level was where it should be.

Sending E-mail via VBScript using CDO

This is a template for sending e-mail via vbscript using CDO. You will need to replace the subject/to/from to your liking. I also showed how to place an attachment in the email. Just change the path to the file you want to attach. You will also need to replace "smtp.yourdomain.com" with a valid smtp server. Most companies have some kind of smtp server and there may even be some free ones...that are publicly accessible but I doubt it...as they would be huge targets for spam deliveries. My original use for this script was to distribute log files and it was called by another script if the log was parsed and errors were found.

Saturday, February 2, 2008

Ping and check for success in VBScript

Here is a quick piece of VBScript code that does a ping via the shell object. Then parses the results that were dumped into a text file to check for success. It pings PCs that are in the C:\Computers.txt file. One PC name per line. In the strSuccess=No part you would place the activities for a failed ping which will likely be nothing or possibly writing to a log. In the strSuccess=Yes you would place whatever code needs to be done on the PC name...in my case it is usually some kind of wmi or registry edit. There are other ways to do this such as the WMI class Win32_PingStatus(Only works on XP or later).

Friday, February 1, 2008

Standard TCP/IP Port Missing

This post is specifically related to Standard TCP/IP Ports missing in any version of windows.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\Standard TCP/IP Port

Under that key there is a string value named "Driver" and the data value should be "tcpmon.dll".

I have seen this messed up on server migrations. It is a rare occurrence but a difficult one to figure out.

Also, check to make sure that the following files are in the C:\Windows\System32\ or C:\Winnt\System32\ directory:

tcpmib.dll
tcpmon.dll
tcpmon.ini
tcpmonui.dll