Showing posts with label Administration. Show all posts
Showing posts with label Administration. Show all posts

Friday, June 15, 2012

SharePoint Logs controlling file size

Scenario: While we are waiting for new version of SharePoint, I still find developers/admin's missing out some great features of SharePoint 2010. Here's one, I got 2 new VM pre-configured and they run out of space every second day.

Reason : SharePoint logs

Solution: In SP2010 , new feature was introduced to control logging size "Restrict log disk space usage"

log

Article: Configure diagnostic logging (SharePoint Server 2010)

Monday, April 25, 2011

SP2010 : Backup Restore with Powershell

Scenario:
I have to do this often for my client. While working on SPD , things can get screwed and so I need a quick backup's at different stages.

Also In case I am screwed I want to recover from my latest backup quickly.

Solution:
Powershell, yes :)

How it works:
1. Create a folder where you want to maintain your backups
2. Copy the backup.ps1 and restore.ps1 in same folder.
3. Make sure you have the right site collection url , its hard-coded but can be parameterized but then it will not be fast ;)
4. Keep the PS Command open and run backup / restore scripts as you want.

Backup.ps1:

$siteCollUrl = "http://intranet.contoso.com/"

$a = Get-Date
$currentfolder = (Get-Location -PSProvider FileSystem).ProviderPath

$filename = $currentFolder + "\backup_" + $a.Day.ToString() + "." + $a.Month.ToString() + "." + $a.Year.ToString() + "." + $a.Hour.ToString() + "." + $a.Minute.ToString() + "." + $a.Second.ToString() + ".bak"

Backup-SPSite $siteCollUrl -Path $filename
Restore.ps1:
$siteCollUrl = "http://intranet.contoso.com/"

$currentfolder = (Get-Location -PSProvider FileSystem).ProviderPath
$collFiles = @(gci $currentfolder | Where-Object {$_.name -like "backup_*"})

if($collFiles.Count -gt 0 )
{
$objFile = $collFiles | Select-Object -Last 1;
$filename = $objFile.FullName
Restore-SPSite $siteCollUrl -Path $filename -force
}
else
{
Write-Host "No backup to restore"
}

Thursday, February 24, 2011

SP2007 : My Site broken

Scenario:
Client me a old MOSS VM for development purpose and as the project is related to Profiles, I logged on to the Main portal site and clicked on My Site link on the top.

Error 1 : File not Found

mysiteissue1

Solution:
If you notice , Sharepoint is saying that there is no such site. So that means we need to create one before we proceed further.

Steps :
1. Go to Central Administration
2. Click on Application Management
3. Under "SharePoint Web Application Management" , click on Define managed path.
4, Make sure to select right Web Application where you want My Site ( In my case http://ws2003 ) from the drop down menu
5. Add a new Managed Path 'mysite' with 'Explicit inclusion'
6. Click on Application Management again on the topnav
7. Click on Create a new Site Collection
8. Create a new site collection at 'http://ws2003/mysite' using 'My Site Host' site template

Cool.. we solved Error 1 :)

So I clicked the My Site link on the top again and got

Error 2 : Your personal site cannot be created because Self-Service Site Creation is not enabled. Contact your site administrator for more information.

Solution:
If you notice , SharePoint is saying that some setting is missing and need to be enabled.

1. Go to Central Administration
2. Click on Application Management
3. Under ' Application security' section click on 'Self-service Site Management' link
4. Set the radio button to 'On'

Cool.. we solved Error 2 :)

So I clicked the My Site link on the top again and got

Error 3 : Your personal site cannot be created because the managed path "personal" has not been created for this site. Contact your site administrator for more information.

Explaination:
SharePoint is saying that my site tried creating a site for the logged in user but couldn't because the managed path 'personal' is not defined, under which it was suppose to create all the personal sites.

There are 2 ways to solve the issue.
Solution 1:
Use a managed path which is already defined in the web application settings , i.e. sites. Here's the steps to do this
1. Go to Central Administration
2. Click on the SSP Site from the left menu
3. Click on My Site Settings link under 'User Profile settings'
4. Replace the value in 3rd textbox from 'personal' to 'sites'

Solution 2:
Create a new managed path 'personal'
1. Go to Central Administration
2. Click on Application Management
3. Under "SharePoint Web Application Management" , click on Define managed path.
4, Make sure to select right Web Application where you want My Site ( In my case http://ws2003 ) from the drop down menu
5. Add a new Managed Path 'personal' with 'Wildcard inclusion'.

Cool.. all errors gone. Click on My Site to get to your personal site collection

Wednesday, December 15, 2010

SharePoint Administration service (spadminV4),

Error:
This operation uses the SharePoint Administration service (spadminV4), which could not be contacted.

Or

An unexpected internal error occurred in the Business Data Connectivity Shared Service: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.


Got the above error while deploying / redeploying new WSP

Reason:
Basically its a clear cut indication that the one of the required service is un-reachable.

Solution:
There are few things I will recommend you trying

1. Reset all servers in the farm and try once more.

2. Are you trying to deploying using command line , then try UI or vice-versa

3. Login to each box and start services management console. Look for SharePoint Administration service (spadminV4) on each box and restart it. Please make sure to do this on all servers in farm even though you got error on 1 server.

4. This is workaround to kick off jobs without depending upon the failing service, but you can use OLD STSADM command ( stsadm -o execadmsvcjobs ) . Run it on the failing server or all the servers.

5. Also you might have look into Timer Jobs ( waiting mode ). SharePoint creates one timer job for each server. If you see any such job related to Deployment waiting for long time. Delete the job and try redeploying.

Other related posts:
Deployment stuck at retracting message , Deployment stuck at retracting message

Friday, December 3, 2010

Sharepoint scopes update now option

Scenario:
I certainly have not posted this but I read in blogs and twitter people complaining that SP2010 is missing option to kick off instant update of scopes.Only option is not wait for 10-15 min.

Solution:
Not right, there is an option.

1. Create a new scope or edit an exiting one.
2. Click on 'Search Administration' from the left menu to navigate to home page.
3. Here's the option to start instant update of scope.

scopeupdate

While I feel Microsoft should have added this option within Scope Administrative screen's. But ... :)

Friday, May 14, 2010

SharePoint 2010 : Development machine

I got a brand new laptop and very powerful one. As its all for SharePoint, here some tips and steps I used to make it ready to ROCK

Hardware Configuration : i7 , 8 GB RAM , 320 GB HDD
OS Configuration : Window Server 2008 R2 Enterprise installed

Step by Step guide
Power
Make sure you have the power source hooked and you are not on battery backup.

Internet
Plug the hard wire for internet, we will use this to download latest hotfixes/patched and other big softwares.

Windows Update and Rebooting
Run the Windows Update and restart once all the updates are installed ( without fail )

Add Features
Desktop Experience
Ink
Quality Window Audio and Video
XPS Viewer

Windows Update and Rebooting
Run the Windows Update and restart once all the updates are installed ( without fail )

Mouse
Plug the USB mouse and make sure it get recognized

Internet Explorer
a) Configure Internet explorer startup settings using Wizard

b) By default Internet Explorer enhanced security is enabled , turn Off for Administrator.
Search for 'Server Manager' > Configure IE ES > select Off for Administrator

c) Change default search provider from BING to what ever u like

Machine Name
Rename machine to a better name before you start using it.

Activate Operating System
Activate the OS before you proceed furthur.

Add Role for Hyper V
Search for 'Server Manager' > Add Roles
Look for Hyper-V and install it
Reboot the machine to finalize the changes

Audio
Search for 'Services'
Look for Windows Audio Service - Set it to Automatic - and Start it.

Resolution
Adjust monitor's resolution so that you can utilize maximum screen space.

Time
Adjust time zone and server to reflect correct values

Drivers
Go to your laptop brand website and search for Support and Drivers
a ) Search for Wireless Drivers - Install it
Reboot the machine and Select your preferred network

b) Dual Monitor - Be careful as Hyper-V has issues with high end drivers and can crash your machine.
If you are confident install the graphic drivers

Command Line
As we will use the command window frequently , Launch cmd and set the font and adjust color to something smoother and better

Folder options
Windows Explorer > Press Alt key to get the File menu
Options > Uncheck Hide know file type ,

Softwares
Virtual PC 2007 -
Visual Studio 2010 - Lauch once and set the Keyboard layout to VB or C#
Install Office 2007/2010 ( 32 BIT please ) and Configure Outlook account

Windows Update and Rebooting
Run the Windows Update and restart once all the updates are installed ( without fail )

Communication
a ) Yahoo Messenger - Configure Alerts and Notification options to avoid surprises
b ) MSN
c) GTalk

Developer tools
Visual Studio 2010
Web Installer 2.0


Other productivity tools
Download Google Chrome - make sure to change the Download folder location
Download Firefox - make sure to change the Download folder location
Acrobat Reader
Adobe Flash
7Zip
Notepad++
Snipper Tool ( Its there actually in c:\Windows\System32 and look for Snipper Tool.exe > Right click to save a shortcut to desktop )

Monday, November 2, 2009

Error creating / extending a WebApplication

Scenario:
You got the following error while creating a new WebApplication or extending an existing Web Application.

Error : An object of the type Microsoft.SharePoint.Administration.SPWebApplicationProvisioningJobDefinition named "Provisioning " already exists under the parent Microsoft.SharePoint.Administration.SPWebService named "". Rename your object or delete the existing object.

Solution:
Run the below STSADM command on all the Web Servers and Application servers to make sure all the hanging Administrative jobs are finished.

Code:

stsadm -o execadmsvcjobs

Friday, June 19, 2009

Kerberose Test Utility

Scenario:
We wanted to test access to our service for kerberose.

Solution:
Small console application to test if i can reach the resource. Make sure you are testing a secured resource , and the username used to make the call has SPN created.

Code:

using System;
using System.Collections;
using System.IO;
using System.Net;
using System.Text;

namespace Training {
class Program {
public static void Main(string[] args) {
Console.WriteLine("Kerberose Test Application");

string sUrl = @"http://localhost/getDoc.aspx?id=66";

try
{
//Display what Authentication modules are registered
DisplayRegisteredModules();

// Unregister the standard Basic, NTLM and Negotiate and Digest modules, leaving only Kerberos
// AuthenticationManager.Unregister("Basic");
// AuthenticationManager.Unregister("NTLM");
// AuthenticationManager.Unregister("Negotiate");
// AuthenticationManager.Unregister("Digest");
AuthenticationManager.Unregister("Kerberos");

//Display what Authentication modules are left registered
DisplayRegisteredModules();

// Prepare the web page we will be asking for
var request = (HttpWebRequest)WebRequest.Create(sUrl);
request.UserAgent = "MOSSPH";
request.Proxy = null;

Console.WriteLine();
Console.WriteLine(string.Format("Trying to access :{0}",sUrl));

// TODO. Establish your own security context.
//request.Credentials = CredentialCache.DefaultCredentials;
request.Credentials = new NetworkCredential("username", "password", "domain");
//request.Credentials = new NetworkCredential(args[0], args[1], args[2]);

//CredentialCache wrCache = new CredentialCache();
//wrCache.Add(new Uri(sUrl), "Kerberos", new NetworkCredential("username", "password", "domain"));
//request.Credentials = wrCache;

//CredentialCache wrCache = new CredentialCache();
//wrCache.Add(new Uri(sUrl), "Negotiate", new NetworkCredential("username", "password", "domain"));
//request.Credentials = wrCache;

var response = (HttpWebResponse)request.GetResponse();

// we will read data via the response stream
Console.WriteLine(response.ContentType.ToString());
Console.WriteLine((ulong)response.ContentLength);
Console.WriteLine(response.StatusDescription.ToString());

Stream stream = response.GetResponseStream();
DisplayPageContent(stream);

// Displays all the headers present in the response received from the URI.
Console.WriteLine("\r\nThe following headers were received in the response:");
// Displays each header and it's key associated with the response.
for (int i = 0; i < response.Headers.Count; ++i)
Console.WriteLine("\nHeader Name:{0}, Value :{1}", response.Headers.Keys[i], response.Headers[i]);

Console.WriteLine("\nHeader Name:{0}, Value :{1}", response.ContentType.ToUpper(), response.ContentLength.ToString());

// Releases the resources of the response.
response.Close();
}
catch (Exception ex) {
Console.Write("Error occured:" + ex);
}
finally {
Console.Read();
}
}

private static void DisplayRegisteredModules() {
IEnumerator registeredModules = AuthenticationManager.RegisteredModules;

Console.WriteLine("\r\nThe following authentication modules are now registered with the system:");

while (registeredModules.MoveNext())
{
Console.WriteLine("\r \n Module : {0}", registeredModules.Current);
var currentAuthenticationModule = (IAuthenticationModule)registeredModules.Current;
Console.WriteLine("\t CanPreAuthenticate : {0}", currentAuthenticationModule.CanPreAuthenticate);
}
}

// The DisplayPageContent method display the content of the selected page.
private static void DisplayPageContent(Stream receiveStream) {
// Define the byte array to temporarily hold the current read bytes.
var read = new Byte[512];

// Read the first 512 bytes.
int bytes = receiveStream.Read(read, 0, 512);
Console.WriteLine("\r\nPage Content...\r\n" + Encoding.ASCII.GetString(read, 0, bytes));
}
}
}
Follow me on Twitter

Saturday, April 4, 2009

Server farm configuration not complete error

Error:
Server farm configuration not complete in Central Administration

Solution:
The warning "Server Farm Configuration not Complete" is displayed on Central Administration pages until you complete three tasks that are required prior to deploying any sites. The Administrator Tasks list displays the tasks that need to be completed, as follows:

1.Add servers to the farm
2.Assign required services to each server
3.Create a Shared Services Provider (SSP)

When you have completed all the three tasks, edit the tasks in the Administrator Tasks list, and set the Status to Completed.

Article:
http://technet.microsoft.com/en-us/library/cc298803.aspx

Note:
The tasks displayed in the Administrator Tasks list cannot be customized until after the server farm has been properly configured. After this set of tasks has been completed, the "Server Farm Configuration not Complete" warning is no longer displayed on the Central Administration pages, and the Administrator Tasks list is updated to display a list of tasks that enable you to further configure your Microsoft Office SharePoint Server installation. You may now customize the tasks in the Administrator Tasks list.

Thursday, March 5, 2009

Backup and Restore option

Scenario:
This is one of the most common questions asked. What are my options for backup and restore.

Solution ( Out of Box ):
1. Central Administration - Smallest unit that can be backed up is Web Application

2. STSADM - Smallest unit that can be backed up is site collection, max size limit 100MB

3. SQL Server - Easy to script , smallest unit that can be backed up is database.

4. Codeplex - Usually there are some options there , but dont forget to read issues before you download.

5. SharePoint Designer - it's free now and good for smaller sites ( 25 MB ).

Solutions ( Third Party ):
1. Microsoft Data Protection Manager

2. Avepoint Their tool is designed to accommodate the sharepoint related task such as backup and restore from site level to document level. You can also set up disaster recovery plan and migration from one platform to another easily.

3. Tzunami - Cheaper than AvePoint , not that bad.

4. Quest Software

Tuesday, February 24, 2009

Restoring SQL database using TSQL Script

Scenario:
Solution:
Code:

RESTORE DATABASE CustomDB FROM 
DISK = 'C:\CustomDB_full_backup.bak'
WITH
MOVE 'CustomDB' to 'C:\Program Files\Microsoft SQL Server\MSSQL.2\MSSQL\Data\CustomDB.mdf',
MOVE 'CustomDB_log' to 'C:\Program Files\Microsoft SQL Server\MSSQL.2\MSSQL\Log\CustomDB_Log.ldf'

Article:

Monday, February 2, 2009

Unable to start Sharepoint services

Scenario:
One of my student called me and said that she is not able to start Document Conversion Service of MOSS from Central Administration Web Application.

I connected to her machine and realized that she is not able to start any of the service from the interface.

I have seen the same behaviour in past when drop down menu's and some ActiveX controls were not working properly at client machine.I tried few option as below

Solution:
1. Reboot the Virtual Machine , no luck.

2. Tried starting service manually.
( All Program > Administrative Tools > Services > Document Conversion Load Balancer Service ). This one worked and service was in running state but Central Administrative Web Application still says its not started.

3. Added Central Web Application to Trusted Site.

This one solved the problem.

Basically Web Application was not able to access the machine information like service current state being in wrong zone. Trusted site gave the Web Application trust to get that information.

:-)

Thursday, January 8, 2009

How to backup in sharepoint

Scenario:
You might have read this before but I am sure you will find something new here. With my previous client we had approx 1000 site collections in the farm and backup was really becoming pain because the DB size was increasing fast.So question is what to do to increase performance and do it right way.

Solution:
Few things to keep in mind.
1. SQL Database backup are the best.
2. If you need site collection level backups , use STSADM backup command ( max size 100 GB ). Make sure you lock the site collection to set them to read-only using STSADM command.
3. Reduce latency by running the backup on local drive ( avoid network drive ).

Article:
MSDN Backup Performance
MSDN STSADM Backup
http://kwright78.blogspot.com/2008/07/backup-farm.html
Backup with existing tools

Wednesday, November 5, 2008

Changing port for Central Administration Web Application

Scenario:
You want to change the port number for the Web Application hosting Central Administration

Solution:
Use STSADM utility.

Code:

Stsadm –o setadminport –port 5555
Article:
http://technet.microsoft.com/en-us/library/cc262249.aspx

Tuesday, September 16, 2008

Import Export SiteCollection using STSADM

Export:


stsadm -o export -url http://localhost/sites/recovery -filename recovery.export -versions 4 -includeusersecurity
Create Site Collection:
Create a site collection because IMPORT command doesn't create a new site collection
stsadm -o createsite -url http://localhost/sites/recovery_copy -owneremail administrator@company.com -ownerlogin domain\administrator -sitetemplate STS#1
Import:
stsadm -o import -url http://localhost/sites/recovery_copy -filename recovery.export -includeusersecurity
Note :
Please note import / export is only used to backup/restore a sub-web ( SPWeb ). For backup/restore of site collection you will need Backup / Restore commands from STSADM or Powershell

Saturday, August 2, 2008

Access denied during Backup

Scenario:
You tried to backup the SharePoint content using Central Administration UI and got following error :
Access to the path '\\servername\backup\spbrtoc.xml' is denied.

Reason:
Folder been used for backup doesn't have necessary permission to write a file into it.

Resolution:
Add the service account running SharePoint Timer job to backup folder with Write permissions.

Steps:
1. Navigate to the folder you are using for backup storage
2. Right Click and Select properties
3. Click on Security Tab
4. Add the Service Account with Full Control permissions

Tuesday, July 29, 2008

Indexing pdf documents with Adobe Reader v8/v9 and MOSS 2007

The version 8/9 of the adobe reader has some significant architectural changes (for the better of course) including an inbuilt IFilter to index PDF documents. Previously the adobe IFilter was available as a seperate download. This new change in architecture compromised the ability to search pdf documents from within MOSS 2007. However, the pdf filter works fine with WDS 3.0 . While many consultants recommend that if we're to index pdf documents through MOSS 2007, we use the the v.6 of adobe IFilter and if we want to index pdf documents through WDS 3.0 or higher, we use the v.8 or higher of adobe reader. But what if we wanted to index pdf documents using both WDS and MOSS 2007?!!! Here's how you can use MOSS 2007 with adobe reader v.8, the version currently patronized by WDS 3.0

Steps ( Fixing the icon : REQUIRED on all Web Front Ends ):

1. Add the new filter-extension:
Central Administration -> Search Settings -> File Types -> New File Type ( Add extension 'pdf' , without dot )

2. Search for the PDF icon file on Google.

3. Copy the GIF or PNG file that you downloaded for the icon to the following folder on the server:

Drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\Template\Images

4. Navigate to Drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\Template\XML

4. Look for DOCICON.xml file.

5. Open the DOCICON.xml file using preferred Editor ( i.e. notepad ).

6. Add an entry for the .pdf extension

<Mapping Key="pdf" Value="NameofIconFile.gif" >
7. Save the DOCICON.xml

8. IISReset

Steps ( Fixing the search : Only on Index Server ):

1. Download Adobe Reader ( in-build ifilter ) or Only IFilter

For 64 bit here's the Download Link

2 Install Adobe Reader (v8 or v9) or IFilter on Index Server only.

3. Modify the following Registry keys by changing their "Default" value to the new CLSID of the Adobe IFilter: {E8978DA6-047F-4E3D-9C78-CDBE46041603}

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\12.0\Search\Setup\ContentIndexCommon\Filters\Extension\.pdf
Default -> {E8978DA6-047F-4E3D-9C78-CDBE46041603}


HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0\Search\Setup\ContentIndexCommon\Filters\Extension\.pdf
Default -> {E8978DA6-047F-4E3D-9C78-CDBE46041603}


4. Add the Installation directory of the Adobe Reader v.8 to the System Path.

For example, if the Reader is installed on "C:\Program Files\Adobe", then add

"C:\Program Files\Adobe\Reader 8.0\Reader"
or
"C:\Program Files\Adobe\Reader 9.0\Reader" to the system PATH variable :

Right Click on My Computer -> Properties -> Advanced -> Environment Variables -> Path (Under System Variables) -> Edit ( Add "Drive:\Program Files\Adobe\Reader 8.0\Reader") or "Drive:\Program Files\Adobe\Reader 9.0\Reader").

This effectively tells the Adobe IFilter where to pick up the dependent DLLs.

5. Recycle the search service:

net stop osearch
net start osearch

6. Now we can crawl and search PDF documents with v.8/9 Reader.

Articles:
Which IFilter