Friday, October 30, 2009

Disable AutoRecover in Microsoft SQL Server Management Studio

According to numerous posts and my own poking around, Microsoft did not make the Auto Recovery feature configurable. This means you can’t turn it off in the UI or change the frequency of the saves. This is a bit of a pain when I work from home because I have a roaming profile and the location the Auto Recovery feature writes to is on the network and makes SSMS hang.

Thankfully, there are two registry keys that you change.

Put the contents below in a file with a .reg extension, double-click it and this will turn off the auto recovery feature.

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Microsoft SQL Server\90\Tools\Shell\General\AutoRecover]
"AutoRecover Always Enabled"=dword:00000000
"AutoRecover Enabled"=dword:00000000

To turn it back on, just change the AutoRecovery Enabled = 00000001.

Monday, October 26, 2009

Make Windows Firewall tell you when it is blocking something

Depending on how Windows Firewall is configured, it may or may not tell you that it blocked something. If you want to configure it to notify you when it blocks something, just do one of the following.

netsh firewall set notifications ENABLE ALL

or

Use regedit and set the value to zero

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\DisableNotifications = 0

You have to stop and start the Windows Firewall service for these settings to take effect. A reboot would also do the trick. :)

Unblock a program that is blocked by Windows Firewall

Sometimes Windows Firewall blocks a program that you need to have network access. Corporate IT sometimes blocks UI access to Windows Firewall so that you can’t add a program to Windows Firewall. Thank goodness you can still do it via the command prompt though.

In the example below I am adding MS SQL Server Management Studio as an Allowed Program to Windows Firewall.

netsh firewall set allowedprogram "C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\SqlWb.exe"

Now I can connect to my SQL Server database running on another server.

Thursday, October 22, 2009

Error: Please wait while Explorer View is loaded. If Explorer View does not appear, your browser may not support it.

Internet Explorer 8, and Windows XP combination breaks Explorer View in SharePoint. If you are running IE8 and an OS such as Windows XP and then open a Document Library in Microsoft Office SharePoint Services (MOSS 2007) and then choose the Explorer view you get the message:

Please wait while Explorer View is loaded. If Explorer View does not appear, your browser may not support it.

Some things you can try:

1. Make sure that when you are on the SharePoint site that it shows you are on a Trusted Site or an Intranet Site. In particular, not an Internet site.

2. Go to your Start Menu | Run... and then type services.msc. Scroll to Web Client and make sure it is set to Automatically start, and that it is started.

3. Instead of going to Explorer view, when you are on the All Documents view, click on the Action menu and choose Open with Windows Explorer. This should open a Windows Explorer view. From here, it will act like a regular Windows Explorer window which is what the Explorer view tries to do, but in the browser.

4. Make sure you have at least Office 2003 installed on your computer. You can also install FrontPage. This will make sure the web components are installed.

5. Install this security patch for IE. The actual link for downloading is: http://www.microsoft.com/downloads/details.aspx?familyid=8799159d-df69-49f6-9db5-49147690ce0c&displaylang=en It is explained here: http://support.microsoft.com/kb/974455/  Follow instructions here: http://support.microsoft.com/kb/972584/ to enable the patch.

6. Go to Start Menu | Control Panel | Add or Remove Programs. Is there an item for Microsoft Office 2003 Web Components? There should be if you are running Office 2003. There should be a similar one for Office 2007

7. Run IE8 in compatibility mode. To do this, open IE8 and go to the Tools menu | Developer tools (F12) | Browser Mode | and then select Internet Explorer 7. This site shows how to do this.

If none of this helps, I recommend down-grading to IE 7 and see if that fixes your issue.

If you still have no luck. Un-install Office 2003 and IE8. Then Re-install Office 2003 or greater. Test to see if it works with IE 6 or IE 7 depending on what what you install. Then if everything works, install IE8. If it stops working, pray for a MS fix.

This thread talks about some of the scenarios and OS’s that are affected. http://social.technet.microsoft.com/Forums/en-US/sharepointgeneral/thread/99d923cd-50e2-4a32-a45d-5df4f8627f37

Tuesday, October 20, 2009

Enable Windows Update

Many times group policy disables Windows Update so that Corporate IT has the ability to control what gets pushed to a corporate computer. Sometimes it is useful to get around this.

As with many hacks to group policies you just need to edit your registry.

Delete the following keys in the registry using regedit

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoWindowsUpdate

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Windows Update\DisableWindowsUpdateAccess

Do this at your own risk of course. This KB from Microsoft explains different reason why you may be getting the message in the first place. http://support.microsoft.com/default.aspx?kbid=326686

Monday, October 19, 2009

Allowing Windows Scheduled Tasks to be editable

If you have a company computer the Group Policy may not allow you to edit or add new Scheduled Tasks. Luckily, you can override those settings until the Group Policy is refreshed. Below is what needs to be changed in the Windows Registry to allow you to edit or add the Scheduled Tasks (under Start Menu | Control Panels).

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Task Scheduler5.0] "Disable Advanced"=dword:00000000 "Property Pages"=dword:00000000 "Execution"=dword:00000000 "Allow Browse"=dword:00000000 "DragAndDrop"=dword:00000000 "Task Creation"=dword:00000000 "Task Deletion"=dword:00000000

[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Task Scheduler5.0] "Allow Browse"=dword:00000000

To create a double-clickable file just open up your favorite text editor such as NotePad++ or NotePad. Paste the contents above into your text editor, and save it in a file of any name, as long as the extension is .reg.

Double-click the file to merge the settings into the registry. You should now be able to add or edit your scheduled tasks.

Thursday, October 8, 2009

Volume Shadow Copy (VSS) failing

I was getting all kinds of errors that occurred when Volume Shadow Copy (VSS) was called. I originally saw this in the Windows Event log on my SharePoint server. I then noticed that the Volume Shadow Copy service would not start. I noticed there were errors like “Volume Shadow Copy Service error: Unexpected error LookupAccountName(NULL, domain\username, NULL, p, NULL, p, p). hr = 0x800706fc”. I right-clicked on the my c drive and went to the Shadow Copies tab and it gave me an error of “Initialization failed. Error 0x80080005 Server execution failed.

And finally the easy test to reproduce the error is to go to a command prompt and type vssadmin List Writers. When I run this, I get the following error: “Unexpected failure: Catastrophic failure”.

All this points to VSS being broken and having serious issues. The last command points to the list of writers for VSS not being invalid. In my case, the server was moved from another domain to a new domain. I found out that one of the writers only existed in the old domain and thus could not be found in the current active directory. This makes sense that the LookupAccountName() was generating an error.

To determine what the writers for VSS are, you need to open up the registry and look at the following path:

HKLM\SYSTEM\CurrentControlSet\Services\VSS\VssAccessControl

When I went to the key, I saw that there was a key for a user that does not exist anymore because we switched domains. After I deleted the key, I ran the vssadmin List Writer command line and it worked great. Also, everything else started working also.

Tuesday, October 6, 2009

Add JavaScript file to Master Page in ASP.NET using code-behind

Sometimes it is necessary to include a JavaScript file in your Master Page or any ASP.NET page. There is no problem if all your pages are in the same directory or not using dynamic data and routing. When you start messing with the pattern of the url, hard coded references to a JavaScript file quickly get broken.

Thankfully, there is a relatively easy way to add the JavaScript file using code-behind.

Page.ClientScript.RegisterClientScriptInclude("Validation.js", ResolveClientUrl("~/jscripts/Validation.js"));

In the above example, I have set the key to “Valiadtion.js”, but this could be anything unique. The second parameter uses the ~ so that the proper path is used when developing in a virtual directory and deploying to a separate web site the url works in both cases.

When the html page is generated and sent to the browser, you will see that path changes depending on what directory your page is in. Which is exactly what we needed; a smart path to the JavaScript file.

Friday, October 2, 2009

A bit of understanding how SharePoint Meeting Workspaces link to calendar events

SharePoint allows you to create as many calendars as you like. Each calendar has one or more events. An event is basically an appointment or a series of appointments or calendar item if that term makes more sense. A series just means that it repeats every so often. That could be once a week, daily, monthly, etc. Once you have an event or event series you can may find that you want to track information such as who attended the meeting, the agenda, objectives, etc. You can track all this in what is called a Meeting Workspace. The workspace will show all the information related to an event. Please note, a workspace is NOT linked to a calendar itself. A calendar can have multiple events and each event can have one workspace. If the workspace is related to a event series then the workspace still is linked to an event, but also shows all the events that are in the series in a list of dates on the left side of the workspace.

You can link an event or event series to a Meeting workspace by opening that event or event series on a given calendar. This link describes how to link to a new or existing Meeting workspace. What it does NOT tell is that you can ONLY link to Meeting Workspaces that are BELOW the site that contains your calendar that has the event you are linking to the Meeting workspace. What this means is that if you have a calendar defined in the Meeting workspace itself then you can’t link events on that calendar to that Meeting workspace. You should be able to create a new Meeting workspace below that Meeting workspace, but that doesn’t change the rule I just noted.

A question that came up is “Why is the next event come up by default when I go to the Meeting workspace directly, instead of the last one.” Basically, SharePoint shows the current event if it is the same a today, and will show the next event if the last event has already passed. In general, SharePoint tries to show you the most recent information it has. While this is not always the best, it is by design.