Thursday, February 02, 2012

Sharepoint 2010 Error - "The trial period for this product has expired."

Are you getting this error:
Referring to the following article, Microsoft seems to have a introduced a bug:
http://social.technet.microsoft.com/Forums/en-US/sharepoint2010setup/thread/644ab342-4eaa-468c-95c1-f345a4f65f26/


To alleviate the issue,  navigate to Central Administration => Monitoring => Review Rule Definitions => click on "Trial period for this product is about to expire" rule under configuration and edit it. Uncheck the "Enabled" checkbox. Then wait for the Health Analyzer service to run again and close the issue.

Monday, January 30, 2012

RadGrid - AutoFit columns in a grid


Call the following function on page load to force the RadGrid to auto size the columns:


function pageLoad() {
var grid = $find("RadGrid1");
var columns = grid.get_masterTableView().get_columns();
for (var i = 0; i < columns.length; i++) {
columns[i].resizeToFit();
}
}

Friday, January 27, 2012

Thursday, January 19, 2012

Getting Session State in HttpHandlers (ASHX files)

A reminder to myself and others, when you want to get access to your Session State from an ASHX or HttpHandler, you need to implement IReadOnlySessionState:

<% @ webhandler language="C#" class="DownloadHandler" %>

using System;
using System.Web;
using System.Web.SessionState;

public class DownloadHandler : IHttpHandler, IReadOnlySessionState
{
public bool IsReusable { get { return true; } }

public void ProcessRequest(HttpContext ctx)
{
ctx.Response.Write(ctx.Session["fred"]);
}
}

(http://www.hanselman.com/blog/GettingSessionStateInHttpHandlersASHXFiles.aspx)

Moving SharePoint Content Database Files To New Location

Often you need to relocate your MOSS database files to a new partition, drive, or SAN, while leaving them attached to the same SQL Database Instance.

1. Prepare SQL Script

Alter the database file names using the scripts listed down below. Modify the scripts as appropriate for each database.

If the database has dashes in the name you have to put quotes around it.

2. Run the Script

Run the script in SQL Management Studio, or Management Studio Express. You should get a result indicating that the paths have been altered for the databases.

3. Stop SharePoint and SQL Server

Stop IIS, or the web applications your SharePoint site. Stop MSSQL Server through Management Studio or via the Windows Service.

4. Move the databases to the new location

Copy the mdf and log files to the new location (new drive, partition, etc).

Please copy and then delete, as opposed to trusting a cut+paste operation.

5. Start the SQL services

Start MSSQL either through Management Studio or via the Windows Service.

6. Verify access to each database

Verify the databases are working properly, you can just pull up the properties to the database in Management Studio.

7. Start SharePoint services

Start IIS, web apps, or whatever you disabled in step 3.

Go verify your SharePoint site is working.

8. You are Done.

Go get coffee, pat yourself on the back, etc.

The SQL Script:

ALTER DATABASE SP_WSS_SEARCH_DB

MODIFY FILE (NAME = SP_WSS_SEARCH_DB_log ,FILENAME = ‘D:\ Data\SP_WSS_SEARCH_DB_log.LDF’)

GO

ALTER DATABASE SharePoint_Configuration_DB

MODIFY FILE (NAME = SharePoint_Configuration_DB_log ,FILENAME = ‘D: \Data\SharePoint_Configuration_DB_log.LDF’)

GO

ALTER DATABASE “SharePoint_AdminContent_ce805cd0-0b6d-4ea1-8eaa-469b1ea0296a”

MODIFY FILE (NAME = ‘SharePoint_AdminContent_ce805cd0-0b6d-4ea1-8eaa-469b1ea0296a_log’ ,FILENAME = ‘D: Data\SharePoint_AdminContent_ce805cd0-0b6d-4ea1-8eaa-469b1ea0296a_log.LDF’)

GO

Keep in mind that moving the database may cause SharePoint to perform a full crawl in place of a regularly scheduled incremental crawl at the next crawl interval.

Go here to get more information from MSDN.


(http://marcellotonarelli.wordpress.com/2010/06/03/moving-sharepoint-content-database-files-to-new-location)

Monday, April 05, 2010

Event log errors 6398, 7076, 6482 on Sharepoint Server

Original blog entry: http://www.stationcomputing.com/scblogspace/Lists/Posts/Post.aspx?List=ec6ce151-566a-499e-94a5-e153fafda404&ID=4

We have been researching the issues outlined in the above blog on our Sharepoint development server. We also requested the hotfix from MSFT. If the hotfix does not alleviate the issues, we will apply the steps outlined in the blog and let everyone know how it goes.

Error 6398 The Execute method of job definition Microsoft.Office.Server.Administration.ApplicationServerAdministrationServiceJob (ID 979c174b-76e3-4376-877c-c6740b35a7d4) threw an exception. More information is included below. Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

Error 7076 An exception occurred while executing the Application Server Administration job. Message: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

Error 6482 Application Server Administration job failed for service instance Microsoft.Office.Excel.Server.ExcelServerSharedWebServiceInstance (a716c72c-13c3-4a94-a05e-9d166fb02402). Reason: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

Ok, so the search services are playing up again, and this time I reckoned it had to be the Office Search Server Search. So this is what I did to fix the problem:

1: Recycle Office Server Search (Operations / Services on Server / Stop), stsadm command line start on the lines of:

STSADM -o osearch -action start -role Index -farmcontactemail email@yourcompany.com -farmperformancelevel PartlyReduced -farmserviceaccount searchserviceaccount -farmservicepassword searchserviceaccountpassword -defaultindexlocation "locationoftheindexfiles"

Where:

email@yourcompany.com: This is the email address related to the farm administrator

searchserviceaccount: This is the account applied to Office Search Server Search

searchserviceaccountpassword: This is the password related to the Office Search Server Search account above

Locationoftheindexfiles: F:\Program Files\Microsoft Office Servers\12.0\Data\Office Server\Applications

2: Ensure the Tasks folder permissions (c:\windows\tasks) are set against the WSS_WPG (the search service account is a member of this group)

3: Reset the indexer to the index server (Central Admin, Shared Services Provider, Edit, Indexer)

4: Reset the crawl (Central Admin, Shared Services Provider, Search Settings, Reset all Crawled Content) – note you may have to wait whilst the indexer move is in progress though you will be informed.

5: Run a full crawl to update the index

Carried out the above, checked the event logs for the same errors after 10 minutes and no repeat of them.

Interesting though how these type of errors occur, since there doesn't appear to be any trigger for them. All other services appear to be ok. The only thing I can think of that may cause this is an error in the index itself, stopping certain data going to the index.

Monday, May 18, 2009

Set up a DHCP Server

Original Post

Alright, in this walkthrough we are going to install a DHCP server on Windows 2003. Most of you may already have an DHCP server offered by a small router, or even a larger one, but you might want to use the one built into Windows 2003 because its easier to control one location (in a smaller Active Directory network) with most of the essential services. I am going to install DHCP services on the same system (I used in the other walkthroughs) as my Active Directory, DNS, and Certificate Services.

First things first, if you have any clients using DHCP on there computers and they are getting the addresses from the router, you will need to power off the clients (its easier to do it now, then clean them up later) and then login to your router (or device that is currently distributing DHCP addresses to clients) and disable the DHCP services.
Once you have the DHCP server disabled, we can work on the server.
Go to; Start -> Settings -> Control Panel -> Add / Remove Programs
On the left click Add / Remove Windows Components and in the list of components select ‘Networking Services’ (do not check the checkbox next to it, just select it) and click on ‘Details’. In the new window check the box next to ‘Dynamic Host Configuration Protocol (DHCP)’ and click ‘Ok’ then click on ‘Next’ in the Windows Components Wizard dialog window. Windows 2003 will copy files, you may need your CD in the drive.

Now that DHCP is installed, lets configure it.

Go to; Start -> Programs -> Administrative Tools -> DHCP

You should be faced with the familiar tree view. On your left expand (server name). You may have an red arrow pointing down on the server box icon next to the (server name). This red arrow means the server has not yet been authorized in Active Directory. Lets do that now, right click on (server name) and choose ‘Authorize’. Give the server a few minutes and the DHCP server will be authorized in Active Directory. Close the DHCP Configuration Console and re-open it.

Go to; Start -> Programs -> Administrative Tools -> DHCP

To re-open the console, expand the (server name) and a green arrow should now appear next to the (server name).

Right click on (server name) and choose ‘New Scope’. Click ‘Next’ in the first window, and then you will be asked for a Name and Description for this DHCP Server. In the name you can put anything, but I will use ‘Testing Walkthrough DHCP Server’. I am going to leave the description blank and click ‘Next’.

Now you will need to enter your start IP Address and End IP Address. You can get these from the previous device that did DHCP on your network or enter some new ones. Just make sure that your server is in the same subnet as your new addresses. So, since my server is 192.168.100.2 I will use ‘192.168.100.100’ as the Start IP Address and ‘192.168.100.254’ as the End IP Address.

You can leave the ‘Length’ and ‘Subnet mask’ defaulted and click ‘Next’. You should now be presented with the ‘Add Exclusions’ since we should have none at this stage, choose the defaults (none) and click ‘Next’.

Lease Duration is our next page, leaving this at default is good, so just click ‘Next’. You should now be asked if you would like to Configure DHCP Options. We like options, so click ‘Yes’ I want to configure these options now’ (it’s the default) and click ‘Next’.

Router (Default Gateway) page; Enter the IP Address of your router to get out to the internet, im going to use 192.168.100.1 in this walkthrough. You can get your default gateway from the IP address properties on this server if you have internet access from this machine (you should if you did the other walkthroughs correctly).

You can get your gateway by going to; Start -> Run type in ‘cmd’ and click ‘Ok’. Then at the command line type in ‘ipconfig’ and read the line that says ‘Default Gateway’. Enter it in the Router (Default Gateway) part of the DHCP Options and click ‘Next’.

Now we get to configure our Domain Name and DNS Servers. In the ‘Parent Domain’ box type your domain suffix. We used this in the other walkthroughs about Active Directory and DNS.

Examples would be like…

Mycompany.work

Or

Networkname.home

Now that you put your Parent Domain in the box, enter the DNS servers IP Address in the ‘IP Address’ box and click ‘Add’ or you can type the servers name and click ‘Add’. If you are installing this DHCP server on your Active Directory server we setup in the last walkthroughs then you can just use the servers IP Address as the DNS server to give to clients, since its what should be done anyway, so the clients find the Active Directory server using DNS.

Click ‘Next’ when your done with this page…

The next page contains WINS, we don’t use WINS anymore so just click ‘Next’. (WINS Sucks…..)

Now you will be asked if you want to activate this scope, choose ‘Yes’ and click ‘Next’ and then ‘Finish’.

You may now turn your clients back on, they should now get addresses from the DHCP server running on your Windows 2003 Box.

(You may also need to run ‘ipconfig /renew’ on some clients if they don’t get an address from the server after the reboot.)

Installing a certificate server

Original post

In this tutorial we will setup Certificate Services on a Windows 2003 server. I am going to use the same server as I did with the Active Directory; Windows 2003 walkthrough, so my installation will be with an already completed Active Directory Domain. If you do not have Active Directory, I recommend you do before using Certificate Services, as they do like working hand-in-hand.

First, let’s load up our server and login as the Administrator. When we are at the desktop, let’s to go Start -> Settings -> Control Panel then open ‘Add / Remove Programs’. On you’re left click on ‘Add / Remove Windows Components’. When it is fully loaded, find ‘Certificate Services’ in the list and check the checkbox next to it. A pop-up dialog will come up informing you that you cannot change the name of the machine and such when you have become an Certificate Authority, so click ‘Yes’ then click ‘Next’.

Now we are given the opportunity to choose what type of CA (Certificate Authority) we want to setup. Since this is a clean install of Windows 2003 and we don’t have any certificate servers I am going to choose the default, ‘Enterprise root CA’ and click ‘Next’.

We now have to enter Identifying Information for this CA. In the Common Name box, put a short name to describe your network or a company name, for my purposes in this document I will use Testing Walkthrough as the ‘Common name for this CA’, and click ‘Next’.

The next area you will have to configure is the Certificate Database Settings, since these are just places to store files; the defaults are good for us. Let’s continue, click ‘Next’.

Windows should start copying files, and you will probably need your Windows 2003 CD in the drive to continue.

During the copy, you may come to a popup stating that Internet Information Services is not installed on this computer, and that we will need it for Web Enrollment Support. Since I think this is usually a good system to use (Web Enrollment) lets do just that.

Click ‘Ok’ on this dialog and let Windows finish the install of Certificate Services, when it is complete you will be able to click ‘Finish’ to close the Windows Components Wizard.

You should now be back at the Add / Remove Programs window and you can once again click on ‘Add / Remove Windows Components’. In the list select Application Server (do not click the checkbox next to it) and click ‘Details’. In this second box choose ‘Internet Information Services (IIS) and it will choose ‘Enable network COM+ access’ for you. Click ‘Ok’ then click ‘Next’ on the Windows Component Wizard. Windows will now copy files from the CD and finish that installation.

Once the Window that is installing the components disappears you can close any other windows that are open, and return to the Desktop.

Let’s check our settings now…

Open; Start -> Programs -> Administrative Tools

You should have some new items! Internet Information Services and Certification Authority.

Open Certification Authority. On the left you will have the normal tree view, click on the item you named your CA when setting up the CA. Mine was ‘Testing Walkthrough’ under here you should have a ‘folder’ called ‘Issued Certificates’, click on it and on the right you should have at least one issued to the CA itself.

Most of what the Certificate Server does it automated through IIS and Active Directory. So, your job is done. Close all Windows and logout.

Enjoy.