SharePoint Experts, Information Architects, Expert Witness
Tuesday, March 25, 2008
1) Make sure IIS is installed before you install VMWare - if you don't, uninstall and start again
2) After IIS is installed, disable the default web site then install VMWare
3) If neither of the above work, add your IP/Machine Name to the Hosts file
If none of the above work, you are likely missing a service pack or have an old copy of VMWare.
Having had this issue, the following code resolves it all - and by the way, I included what you need for using statements (hate when folks leave that out!):
using System.Runtime.InteropServices; // Needed for DLLs
using System.IO; // Needed for FileInfo (to open the file)
using System.Xml; // Needed for the XML document namespace (if using InfoPath)
using System.Management; // Needed to Get/Set the printer
public partial class Form1 : Form
// Code by David M. Sterling - Sterling International Consulting Group
// Add the function to return the default printer:
[DllImport("winspool.drv", CharSet = CharSet.Auto, SetLastError = true)]
public static extern bool GetDefaultPrinter(StringBuilder pszBuffer, ref int pcchBuffer);
private const int ERROR_FILE_NOT_FOUND = 2;
private const int ERROR_INSUFFICIENT_BUFFER = 122;
/// Printer name as string
public int SetTheDefaultPrinter(string PrinterName)
int ReturnVal = 0;
string DeviceIdPath = "win32_printer.DeviceId='" + PrinterName + "'";
using (ManagementObject PrinterObj = new ManagementObject(DeviceIdPath))
ManagementBaseObject ReturnedParameters =
PrinterObj.InvokeMethod("SetDefaultPrinter", null, null);
ReturnVal = (int)(uint)ReturnedParameters.Properties["ReturnValue"].Value;
public string GetDefaultPrinter()
int pcch_Buffer = 0;
if (GetDefaultPrinter(null, ref pcch_Buffer))
int lastWin32Error = Marshal.GetLastWin32Error();
if (lastWin32Error == ERROR_INSUFFICIENT_BUFFER)
StringBuilder psz_Buffer = new StringBuilder(pcch_Buffer);
if (GetDefaultPrinter(psz_Buffer, ref pcch_Buffer))
lastWin32Error = Marshal.GetLastWin32Error();
if (lastWin32Error == ERROR_FILE_NOT_FOUND)
return "Error : unable to obtain the current default printer";
private void Form1_Load(object sender, EventArgs e)
string TheNewPrinterName = "HP Deskjet 6800 Series";
string DefaultPrinterName = GetDefaultPrinter();
// Print away...
// When done:
Tuesday, March 18, 2008
(You might have thought mosstcr, but the name of the book changed!).
From this site you can view the local blog as well as download the source from the book and the bonus web chapter on the Business Data Catalog.
The problem occurs in Buttons, DataGrids and other event driven controls in Web Parts and Controls. On the first time through, the primary event (like the Click event on a button), the event does not fire. On the second click however, everything seems fine. If you follow through in Debug, you'll file that the event is actually skipped and the control proceeds to the render event.
In most cases, the fix is simple: one of the controls within the control/web part has AutoPostBack = true where it doesn't need it. Typically, this is a cut and paste error - for example, adding AutoPostBack to a TextBox.
This, by the way, though very odd, is somewhat expected. The invalid postback on the control tells ASP.NET that it's already happened, when indeed it hasn't since the specific control cannot perform the actual postback.
Saturday, March 15, 2008
While not always a guaranteed fix, you can try this simple one. On the system in question, open a command prompt and enter:
This is will update the Group Policies on the local system (note that in some cases, you may have to reboot). Once complete, try opening VMWare Server again and you should see the normal local host option.
Sunday, March 2, 2008
You may have an issue in which SharePoint Alerts are not being sent, though you receive an alert when it is created.
The primary issue centered around the Timer Service and a few jobs that must be running for alerts to work. A few things to check for first:
1) Verify the Timer service is running and that it's identity (running as) is the SharePoint Service account (Start > Control Panel > Administrative Tools > Services). Locate the SharePoint Timer service in the list and see if it is running. If not, right click on it and start it. If it stops again, the user is likely incorrect. Right click on it and select Properties then on the Identity tab, verify the account in use (Local Service or similar is NOT correct); set this to be the SharePoint Service account, close out the properties and try to start it again. If it stops again, you will have to go to the Domain Policies and make sure that the service account has "Run as a Service".
2) Verify the necessary jobs exist (SharePoint 3.0 Central Administration > Operations > Timer Job Definitions):
Workflow Auto Cleanup
If they do exist, check the Timer Job Status (SharePoint 3.0 Central Administration > Operations > Timer Job Status) and see if any of these are displaying errors (you should also check the System Application Event Log).
If the jobs do not exist, you may be in for some work depending on the installation. If the site was a restore, you may have created an issue Microsoft has identified - you can see this solution here:
However, as I discovered with one of my clients, a site that had been migrated (not the situation explained in the link above) was missing these jobs. After much investigation, I was able to simply add the jobs as follows:
Login to the server, get down to the command line and set your directory to be the SharePoint bin folder (usually c:\program files\common files\microsoft shared\web server extensions\12\bin). Verify the STSADM.exe file (the SharePoint command line utility) is there to make sure you are in the right folder.
Add the jobs to the site experiencing the problem by adding the jobs manually as so (Note: you should ONLY do this for the job(s) missing).
First you can verify whether the job already exists by using the command:
stsadm -o getproperty -propertyname job-immediate-alerts -url http://yoursite:port
If the job does not exist, you will recieve a message:
If the job does exist, you will see a different message, such as:
Property Exist="Yes" Value="every 5 minutes between 0 and 59"
(In both cases, the message preceeded by a left arrow and closed with a slash-right arrow; this blog will not permit me to enter the exact syntax as it interprets it as HTML).
Verify this for all the job types:
Job Type: Property Name:
Immediate Alerts job-immediate-alerts
Workflow Auto Cleanup job-workflow-autoclean
Workflow Failover job-workflow-failover
To add the individual jobs:
stsadm -o setproperty -propertyname job-immediate-alerts -url http://yoursite:port -propertyvalue "every 5 minutes between 0 and 59"
stsadm -o setproperty -propertyname job-workflow -url http://yoursite:port -propertyvalue "every 5 minutes between 0 and 59"
Workflow Auto Clean:
stsadm -o setproperty -propertyname job-workflow-autoclean -url http://yoursite:port -propertyvalue "daily between 22:00:00 and 06:00:00"
stsadm -o setproperty -propertyname job-workflow-failover -url http://yoursite:port -propertyvalue "every 15 minutes between 0 and 59"
Use the Get Property command to verify that the jobs are created. Note that the URL MUST BE SPECIFIED AND CORRECT or you will simply receive 'Property Exist="No"'.
Hope this helps! Sure beat trying to follow the Microsoft solution (which may or may not have corrected the problem).