07 January 2011

Common Microsoft SharePoint Server 2010 Installation Issues and Resolutions

ISSUE #1: when running the SharePoint 2010 Products Configuration Wizard you may experience the error:

Failed to create the configuration database.
An exception of type System.Security.Cryptography.CryptographicException was thrown. Additional exception information: The data is invalid.

To resolve the issue you can perform the following steps:

Modify the ACL on the 14 directory under %commonprogramfiles\Microsoft Shared\Web Server Extensions.

Right-click on the folder %commonprogramfiles%\Microsoft Shared\Web Server Extensions\14, and then select the Security tab.
On the 14 Properties dialog under the Security tab, select Edit.
On the Permissions for 14 dialog click Add… and enter Network Service in the Enter the object names to select and then click OK.
On the Permissions for 14 dialog select Full Control under Permissions for NETWORK SERVICE and click OK.
On the 14 Properties dialog click OK.

NOTE
The previous steps are applicable only prior to running the SharePoint 2010 Products Configuration Wizard. If you have run the SharePoint 2010 Products Configuration Wizard, follow the steps below:

Open an elevated Command Prompt and change directories to %commonprogramfiles%\Microsoft Shared\Web Server Extensions\14 and enter psconfig –cmd –configdb disconnect to disconnect from the current configuration database.
Open SQL Server Management Studio or SqlCmd and delete the existing configuration database.
Follow the previous steps to modify the ACL on the 14 directory and run the SharePoint 2010 Products Configuration Wizard to create and configure the server farm.

NOTE
In the event the steps above do not immediately resolve the issue, open the Registry Editor and delete the "SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\14.0\Secure\FarmAdmin" Registry key and then run the SharePoint 2010 Products Configuration Wizard.

ISSUE #2: when running the SharePoint 2010 Products Configuration Wizard you may experience the error:

An exception of type Microsoft.Office.Server.UserProfiles.UserProfileException was thrown. Additional exception information: Unrecognized attribute 'allowInsecureTransport'. Note that attribute names are case-sensitive. (C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\WebClients\Profile\client.config line 56).

To resolve the issue you can perform the following steps:

Download and install KB976462 from http://support.microsoft.com/kb/976462 for Windows Server 2008 R2 or KB971831 from http://code.msdn.microsoft.com/Project/Download/FileDownload.aspx?ProjectName=KB971831&DownloadId=7285 for Windows Server 2008 and run the SharePoint 2010 Products Configuration Wizard.

ISSUE #3: when running Setup.exe for Microsoft SharePoint Server 2010 you may experience the error:

Setup is unable to proceed due to the following error(s):
A system restart from a previous installation or update is pending. Restart your computer and run setup to continue.

To resolve the issue you can perform the following steps:

For the list of pre-requisites needed to install the product please refer to:
http://go.microsoft.com/fwlink/?LinkId=106209
Correct the issue(s) listed above and re-run setup.

Check the value of the following Registry keys:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates\UpdateExeVolatile - if the value of the UpdateExeVolatile Registry key is anything other than 0 you will see this message.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations - if the PendingFileRenameOperations Registry key has any value you will see this message.

To remove an orphaned UpdateExeVolatile registry key value

Open a registry editor, such as Regedit.exe or Regedt32.exe.
Navigate to HKLM\SOFTWARE\Microsoft\Updates\
In the right navigation pane, double-click the UpdateExeVolatile key.
Configure the key with a value of 0
Close Registry Editor.
To delete the orphaned PendingFileRenameOperations registry key
Open a registry editor, such as Regedit.exe or Regedt32.exe.
Navigate to HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\
In the right navigation pane, right-click the PendingFileRenameOperations key and select Delete.
Close Registry Editor.

ISSUE #4: when running the SharePoint 2010 Products Configuration Wizard you may experience the error:

Failed to register SharePoint services.
An exception of type System.ServiceProcess.TimeoutException was thrown. Additional exception information: Time out has expired and the operation has not been completed.
System.ServiceProcess.TimeoutException: Time out has expired and the operation has not been completed.
at System.ServiceProcess.ServiceController.WaitForStatus(ServiceControllerStatus desiredStatus, TimeSpan timeout)

Run Setup.exe when the steps above have been completed.

To resolve the issue you can perform the following steps:

Download and install KB976462 from http://support.microsoft.com/kb/976462 for Windows Server 2008 R2 or KB971831 from http://code.msdn.microsoft.com/Project/Download/FileDownload.aspx?ProjectName=KB971831&DownloadId=7285 for Windows Server 2008 and run the SharePoint 2010 Products Configuration Wizard.

ISSUE #5: when running the SharePoint 2010 Products Configuration Wizard you may experience the error:

Error: Cannot add the specified assembly to the global assembly cache: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\policy\Policy.11.0.Microsoft.SharePoint.dll.

To resolve this issue you can perform the following steps:

Delete the contents of %commonprogramfiles%\Microsoft Shared\Web Server Extensions\14\policy\ and run the SharePoint 2010 Products Configuration Wizard.

ISSUE #6: when running Setup.exe for Microsoft SharePoint Server 2010 you may experience the following error:

The language of this installation is not supported by your system

This issue is largely caused by corruption of the binaries, you can use the extract command in a Command Prompt and check the log to determine the health of the binaries; otherwise, download a new copy of the binaries and retry setup.

Thanks to Bill Baer
Technical Product Manager (SharePoint), Microsoft Certified Master for SharePoint 2007, Microsoft Corporation.

06 January 2011

How to validate forms using javascript

Forms are most commonly used HTML elemnts. Sometimes we need some fields of these forms to be mandatory. This can be done in php as well but the form will need to be submitted and the user will have to fill all the field again with the correct values, which is quite irritating. We can enhance the user experience by doing form validation using Javascript. For this purpose i wrote a very simple and easy to understand code. This is a sample code you can use it according to your need.
<!--Put this code in the head section of the page-->
<script type="text/javascript" language="javascript">
function validate_form()
{
 //For empty field validation
 if (document.getElementById('name').value=="")
 {
  alert ('Please enter a valid name.');
  document.getElementById('name').focus();
  return false;
 }
 //For Email address validation
 var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
 if (!filter.test(document.getElementById('email').value))
 {
  alert("Please input a valid email address!")
  document.getElementById('email').focus();
  return false;
 }
 //For empty field validation
 if (document.getElementById('phone').value=="")
 {
  alert ('Please enter a valid phone number.');
  document.getElementById('phone').focus();
  return false;
 }
 //For numeric field validation
 if (isNaN(document.getElementById('phone').value))
 {
  alert ('Please enter only numeric values.');
  document.getElementById('phone').focus();
  return false;
 }
}
</script>
<!--End of validation code-->
HTML Form
<form id="form1" name="form1" method="post" action="" onsubmit="return validate_form()">
  <table width="400" border="0" align="center" cellpadding="4" cellspacing="0">
    <tr>
      <td colspan="2"><strong>Validate Form:</strong></td>
    </tr>
    <tr>
      <td> </td>
      <td> </td>
    </tr>
    <tr>
      <td>Name:</td>
      <td><label>
        <input type="text" name="name" id="name" />
      </label></td>
    </tr>
    <tr>
      <td>Email:</td>
      <td><label>
        <input type="text" name="email" id="email" />
      </label></td>
    </tr>
    <tr>
      <td>Phone Number:</td>
      <td><label>
        <input type="text" name="phone" id="phone" />
      </label></td>
    </tr>
    <tr>
      <td colspan="2" align="center"><label>
        <input type="submit" name="button" id="button" value="Submit" />
      </label></td>
    </tr>
  </table>
</form>
So that was some basic html form validation using javascript. If you guyz have any questions, please feel free to ask by commenting on this post.

05 January 2011

Disabling Mcafee and SQL Server Splash Screens

Disabling McAfee Splash Screen:
These instructions show how to stop the McAfee Anti-Virus 8.5i splash screen appearing everytime you start Windows.
WARNING: You should backup your files before editing the registry. If you use Registry Editor incorrectly, you can cause serious problems that may require you to reinstall your operating system.  Use Registry Editor at your own risk.
  • You may need to first temporarily disable McAfee from blocking changes to McAfee settings.
  • To do this, open the McAfee VirusScan Console and right-click on Access Protection and select Properties.
  • Select Common Standard Protection and uncheck Block for Prevent Modification of McAfee Files and Settings. Click Apply.
  • Run regedit
  • Navigate down to HKEY_LOCAL_MACHINE\Software\McAfee\DesktopProtection   
  • Double click bSkipSplash.
  • A "DWORD Editor" window will appear. To skip the splash screen set the value to 1 by entering 1 then clicking OK.
Don't forget to re-check the block setting for "Prevent Modification of McAfee Files and Settings" in the VirusScan console.

Disabling SQL Splash Screen:
sqlwb –nosplash

Php For Beginners (Lesson 4b)

This lesson is in continuation with Php for Beginners lesson 4, so i will be continuing from where i left in lesson 4. Well in the last lesson, I was discussing php operators, and arithmetic operators were discussed in detail. In this lesson i will discuss Assignment operators and their usage in php.

Assignment Operators
Assignment operators are used to perform operations and assign values in variables. Basic assignment operators used in php are as follows:

= Operator
<?php
$a=5;
echo $a; // outputs 5
?>
+= Operator
<?php
$a=5;
$a+=6;
echo $a; // outputs 11
?>
$a+=6 is same as $a=$a+6.
-= Operator
<?php
$a=5;
$a-=4;
echo $a; // outputs 1
?>
$a-=6 is same as $a=$a-6.
*= Operator
<?php
$a=5;
$a*=6;
echo $a; // outputs 30
?>
$a*=6 is same as $a=$a*6.
/= Operator
<?php
$a=5;
$a/=2;
echo $a; // outputs 2.5
?>
$a/=6 is same as $a=$a/6.
.= Operator
<?php
$a=5;
$b=6;
$a.=$b;
echo $a; // outputs 56
?>
$a.=$b is same as $a=$a.$b.
%= Operator
<?php
$a=5;
$a%=2;
echo $a; // outputs 1
?>
$a%=6 is same as $a=$a%6.

This is all for assignment operators, feel free to comment and ask any questions that you may have.


next Previous Lesson --- Next Lesson next

How to create dynamic rss feed using php mysql

Dynamic rss feed can be created in the similar manner as static rss feed, but it will be saved in a php file (eg. Rss.php ). In dynamic rss feed first we define the content type of the script and then we write xml script exactly same to the static feed except that the item tag is now written inside a while loop which is fetching data from the database.

Let’s make an example dynamic rss feed to give you guys a clear picture of what we are talking about. To make this example simple I will not be including the database connection code in this script.

Syntax

First we define the content type of the script as xml and rss. This can be done using the following line of code:
<?php header("Content-Type: application/rss+xml; charset=ISO-8859-1"); ?>
After defining the content type we will initialize the rss feed by placing following xml code:
<?php echo '<?xml version="1.0" encoding="ISO-8859-1" ?>'; ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
Now we need to define information about our site. Place the following code immediately after the previous code in your xml file:
<title>Skills 2 Earn</title>
<description>Knowledge for all</description>
<link>http://skills2earn.com</link>
In the above code “<title>” tag is used for setting the title of your site, “<description>” tag for description and “<link>” tag for the link of your site.

Now comes the most important part of your dynamic rss feed, in this part you need to define the information about your content. For this purpose “<item>” tags are used. If you want to put four topics in your feed then you need to use four “<item>” tags. We will do it by defining “<item>” tags inside a while loop. Following is an example code to let you know how these item tags can be used:
<?php
$sql="SELECT title,description,link FROM table1 LIMIT 5";
$result=mysql_query($sql) or die ($sql."<br />".mysql_error());
while ($row=mysql_fetch_array($result))
{
?>
   <item>
   <title><?php echo $row[‘title’]; ?></title>
   <description><?php echo $row[‘description’]; ?></description>
   <link><?php echo $row[‘link’]; ?></link>
   </item>
<?php
}
?>
In the above code “<title>” tag is used for setting the title of your topic, “<description>” tag for description and “<link>” tag for the link of your topic.

In the end you need to close all open tags. As I am doing in the code below:
</channel>
</rss>
That’s it guys, you have done it, you have created dynamic rss feed using php and mysql, but remember this example code is not supposed to work as it’s a dummy code just to make you guys understand how a dynamic rss feed is created.

Complete Code

Complete code is mentioned below. You need to safe it in a php file and you can name it as “rss.php”.
<?php header("Content-Type: application/rss+xml; charset=ISO-8859-1"); ?>
<?php echo '<?xml version="1.0" encoding="ISO-8859-1" ?>'; ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Skills 2 Earn</title>
<description>Knowledge for all</description>
<link>http://skills2earn.com</link>
<?php
$sql="SELECT title,description,link FROM table1 LIMIT 5";
$result=mysql_query($sql) or die ($sql."<br />".mysql_error());
while ($row=mysql_fetch_array($result))
{
?>
   <item>
   <title><?php echo $row[‘title’]; ?></title>
   <description><?php echo $row[‘description’]; ?></description>
   <link><?php echo $row[‘link’]; ?></link>
   </item>
<?php
}
?>
</channel>
</rss>
For any problems or queries, you may have, feel free to comment on this post. I would love to resolve your problems.