Wednesday, January 23, 2013

Various Warning Emails in SharePoint 2010

I was working on setting up warning emails on my SharePoint farm, both for Site Quota warnings and warning emails for deleting unused sites. SharePoint provides these two features which can be used, but there has always been confusion about who will be receiving the emails. Before I answer that, lets discuss about the set up for sending out such warning emails.

1> First and foremost is to set up the outbound email settings from SharePoint Central Administration, as shown in the screenshot below. Go to Central Administration >> System Settings >> Configure outgoing e-mail settings


Provide the details of the SMTP as shown in the screenshot below otherwise the other configurations related to Warning emails will be greyed out.

2> Now go to the Central Administration >> Application Management and click on "Confirm Site Use and Deletion" as shown in the screenshot below.

3> On this page one can provide all the details as per the requirement and click on OK. The information would be when would the notifications start going to the site collection administrators and also if auto deletion would be opted for such unused sites as shown in the screenshot below.


 4> The e-mails that are generated because of this setting goes to the Primary Site Collection Administrator only. It doesn't go any other site administrator nor to secondary site collection administrator. You can check the primary site collection administrator by going to Central Administration >> Application Management >> Change Site Collection Administrators . Once can validate the Primary Site collection Administrator there.

5> For the Site Quota Warning, one has to go to Central Administration >> Application Management >> Configure Quotas and Locks . In that option, we need to enable check box inorder to send warning emails when the site collection storage is reaches to a warning limit as shown in the screenshot below.



6> These emails once configured will be sent to the Site Collection Administrators. But these Site Collection Administrators are the ones present in the path
Go to the Site Collection >> Site Actions>> Site Settings >> User and Permissions > Site Collection Administrators.

So, one can add more administrators in that group inorder to get the Site Quota Warnings emails.

Hope this helps and clarifies the doubts about the Warning emails sent by SharePoint 2010.
 

Thursday, January 10, 2013

Not able to delete SharePoint 2010 Web Analytics orphaned databases

I was working on cleaning up the sharepoint farm. I tried to delete the Web Analytics Service Application from the UI but was not able to do so. It was not allowing me to delete the service application from PowerShell either and threw the below error.

Exception calling "Delete" with "0" argument(s): "An object in the SharePoint a
dministrative framework, "WebAnalyticsWarehouseDatabase Name=WebAnalyticsServiceApplication_ReportingDB", could not be deleted because other objects depend on it. Update all of these dependants to point to null or different objects and retry this operation. The dependant objec
ts are as follows: WebAnalyticsServiceApplication Name=Web Analytics Service Application"


 I went to the Central Administration --> Upgrade & Migration --> Review Database Status. I observed that the Web Analytics databases were in "not responding" status.

After some analysis, I found that there were timer jobs that were using the databases which didn't allow to delete the service application. The Timer jobs are as follows -

Health Analysis Job (Daily, Web Analytics Data Processing Service, Any Server)
Health Analysis Job (Daily, Web Analytics Web Service, Any Server)
Microsoft SharePoint Foundation Usage Data Processing
Microsoft SharePoint Foundation Usage Data Import
Microsoft SharePoint Foundation Site Inventory Usage Collection


I went ahead and disabled the jobs. Then I went ahead and deleted the service application from the UI. It got deleted successfully without any issues. I ran the powershell command to clean up any orphaned database present on the sharepoint farm by running the below script

Get-SPDatabase | Where{$_.Exists -eq $false} | ForEach {$_.Delete()}

Thursday, December 27, 2012

Site Directory in SharePoint 2010

By default Site Directory template is not available in SharePoint 2010. Actually this template is in hidden state. In order to make it visible, we need to follow the below steps -

1>  Open  "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\1033\XML\webtempsps.xml" XML file in the mentioned path.
2> Search for Site Directory in the XML.
3> Change the Hidden parameter from TRUE to FALSE.
4> To create it as a sub-site, there is a need to run the following command: stsadm.exe -o activatefeature -id 5F3B0127-2F1D-4cfd-8DD2-85AD1FB00BFC –url http://oursite
5> Once that is done we can see the option of Site Directory template under the Enterprise tab while creating a new Site Collection as shown in the screenshot below
6> Now we can go ahead and create a new site directory using the above template. Once the Site Directory is created, Microsoft provides an option of linking older site collections to the Site Directory. To manually add sites,we need navigate to the Sites list present in the newly created Site Directory i.e. http://sitedirectoryURL/SitesList and add to directory.  We can add any URL to the Site Directory.  We need to approve them as content approval is on by default.
7> For the new sites that would be created, we need to do the below configurations as shown in the screenshot below

In the Central Administration -> General Application Settings -> Configure Site Directory


Once the link is opened, we need to provide the Site Directory URL and enable the Site Creation Metadata.  This is enabled inorder to provide data wrt the site collections either to be mandatory or not. This will be visible when we create new site collections as shown in the screenshot below.

In the above screenshot we have selected only one site category to be mandatory. We get to see the below screenshot when we create the new site collection.
 
When the Site Directory is not implemented, the Site Categories option is not available.

For adding or deleting Site Categories in Site Directory of Sharepoint 2010, steps can be followed as mentioned in the below link, which applies to MOSS 2007, but the same steps can be followed for SP 2010 as well with some self understanding.

http://office.microsoft.com/en-in/sharepoint-server-help/add-or-change-categories-in-the-site-directory-HA010106564.aspx

Now coming to the second link on the Site Directory in General Application Settings in CA i.e. Scan Site Directory Links we can provide links for the lists and libraries looking for any broken or updated link. There is a timer job "Site Directory Broken Links Scan" that runs daily to do a validation and update the Title and Description of any updated link on to the Site Directory.

 

Wednesday, December 26, 2012

SharePoint 2010 search administration reports throwing error


While configuring all the service applications, I came across the Link "View Administrative Reports" under the Monitoring section.  When I went ahead and clicked on the one of the reports "CrawledRatePerContentSource", I got an error  "An unexpected error has occured".

I did an analysis of the ULS logs and found that it could not find the store procedure as highlighted in the screenshot below.

Then after doing some more analysis found that there is a timer job named as "Search Health Monitoring - Trace Events" which was in disabled state. Once this timer job is enabled and executed, the store procedures are created and thus execution of reports happen successfully.


Happy Troubleshooting!!!

Wednesday, November 21, 2012

Issue while deleting web application or service application in SP 2010

I came across an error while deleting a User Profile Service Application and it mentioned "An update conflict has occurred, and you must re-try this action. The object UserProfileApplication Name=User Profile Service Application was updated by [farm admin id], in the OWSTIMER (ID) process, on machine [machine name]. View the tracing log for more information about the conflict."

Below are the steps I followed to remove the User Profile Service Application with out error.
On the server throwing the OWSTIMER (ID) error I cleared the server cache, by following the below steps -
1. Logged into server throwing the OWSTIMER error.
2. Went to Start -> Administrative Tools -> Services
3. Stopped the Timer service by Right click SharePoint 2010 Timer and click Stop

Next I cleared the Server Cache (Win 2008 x64 R2) by following the below steps-

1. Browsed to local drive (c:) on the server
2. Looked for the ProgramData directory.  It is set to be hidden by default. Hit the Alt key -> Tools -> Folder Options -> View and under Hidden Files and folders click the Show Hidden files and folders radio button. Click ok.
3. Next browsed to ProgramData/Microsoft/SharePoint/Config directory
4. Inside this directory there are a couple folders with [GUIDs] as their names. Looked inside each folder until I found the one that has all the .XML documents and the Cache.ini file.
5. Backuped the Cache.ini file and save it in a safe place.
6. Then highlighted all the .XML files and deleted them.
7. Opened up the Cache.ini file and deleted the value inside and replaced it with 1. Saved a close the file.
8.  Went back to Administrative Tools -> Services, right clicked SharePoint 2010 Timer services and clicked Start to restart the services.

Inside the ProgramData/Microsoft/SharePoint/Config directory inside the [GUID] folder that had all the .XML documents and Cache.ini files all the .XML documents that were deleted were starting to repopulate.

Retrying the deletion went through with no error.
 

Tuesday, November 6, 2012

List of Active Sharepoint databases in SharePoint 2010

There was a need when I had to get the list of sharepoint databases present on a shared SQL server instance.

Below PowerShell Command helps to reduce the work in searching the databases individually. We need to go to the Sharepoint Management Shell and run the below powershell command -

Get-SPDatabase | Select Name | Out-File c:\AllActiveSPDBs.txt

The text file will be created automatically if it doesn't exist.

Also you can go and validate the same from Central Administration as well by following the path
Central Administration --> Upgrade and Migration --> Review Database Status


Tuesday, November 30, 2010

How to repair and re-install WMI on a Windows 2003 server

We need to restart the server if we do a repair or reinstall of the WMI. We repair WMI components on the server and if it does not work, then reinstall and restart the server.

We need to follow the below steps in order to Repair WMI :-

1> Open a command prompt window (Run as Administrator) and change directory (cd) to %windir%\System32\wbem on 32bit Windows or %windir%\SysWOW64\wbem on 64bit Windows

2> Run both these commands one at a time-

a> FOR %i in (*.dll) do RegSvr32 -s %i
b> FOR %i in (*.exe) do %i /RegServer
c> FOR /f %s in ('dir /b /s *.dll') do regsvr32 /s %s

3> Net stop /y winmgmt

4> FOR /f %s in ('dir /b *.mof *.mfl') do mofcomp %s

5> Net start winmgmt

We need to verify by running any WMI query to check if the WMI is working on the server or not. If the issue is still not resolved, then we need to use the following command to detect and repair a corrupted WMI Repository:

a> rundll32 wbemupgd, RepairWMISetup
b> we need restart the server.



We need to verify by running any WMI query to check if the WMI is working on the server or not. If the issue is still not resolved, then we need to perform the Comprehensive Rebuild Method.

Important note: If you've installed a Service Pack, you need to insert your Windows XP CD with Service Pack integration (called as the Slipstreamed Windows XP CD). If you don't have one, you may point to the %Windir%\ServicePackFiles\i386 folder for a recent version of the system files required during WMI repair. Or you may create a slipstreamed Windows XP CD and insert it when prompted.

Click Start, Run and type the following command, and press ENTER:

1> rundll32.exe setupapi,InstallHinfSection WBEM 132 %windir%\inf\wbemoc.inf

Insert your Windows XP CD into the drive when prompted. Repair process should take few minutes to complete. Then restart Windows for the changes to take effect.
 
 
Hope this helps someone.