It is a very common requirement in SharePoint Portal Solution to analyze a SharePoint solution in terms of storage capacity and statistics of sites, document libraries, area etc., to monitor the growth of the SharePoint solution and to take prompt action, if any thing goes wrong. Like, SharePoint should know what document library is most used in terms of versions, or the number of documents uploaded.
Microsoft SharePoint Portal Solution database is Microsoft�s proprietary database, and it cannot be modified because of any problems with future service pack releases, but sometimes you can write SELECT queries that can give full information that may be useful for the SharePoint Administrator. I was looking for some queries that would help me to analyze a SharePoint solution, but unfortunately, didn�t find any article that gives a list of useful queries, so I started to write my own SQL queries.
Contents
An Overview of the SharePoint Database Schema
A List of SQL Queries
An Overview of the SharePoint Database Schema
In order to write queries against the SharePoint database schema, you should how Microsoft organizes information in SQL tables. Some common tables are:
Docs
Docversions
Sites
Webs
Information pertaining to document libraries, list, area, and sites can easily be fetched by joining these tables in the Portal_Site database. You can write a query against the PORTAL_Profile database to get useful information of user profiles etc.
A List of SQL Queries
Top 100 documents in terms of size (latest version(s) only): Collapse | Copy CodeSELECT TOP 100 Webs.FullUrl As SiteUrl,
Webs.Title 'Document/List Library Title',
DirName + '/' + LeafName AS 'Document Name',
CAST((CAST(CAST(Size as decimal(10,2))/1024 As
decimal(10,2))/1024) AS Decimal(10,2)) AS 'Size in MB'
FROM Docs INNER JOIN Webs On Docs.WebId = Webs.Id
INNER JOIN Sites ON Webs.SiteId = SItes.Id
WHERE
Docs.Type <> 1 AND (LeafName NOT LIKE '%.stp')
AND (LeafName NOT LIKE '%.aspx')
AND (LeafName NOT LIKE '%.xfp')
AND (LeafName NOT LIKE '%.dwp')
AND (LeafName NOT LIKE '%template%')
AND (LeafName NOT LIKE '%.inf')
AND (LeafName NOT LIKE '%.css')
ORDER BY 'Size in MB' DESCTop 100 most versioned documents: Collapse | Copy CodeSELECT TOP 100
Webs.FullUrl As SiteUrl,
Webs.Title 'Document/List Library Title',
DirName + '/' + LeafName AS 'Document Name',
COUNT(Docversions.version)AS 'Total Version',
SUM(CAST((CAST(CAST(Docversions.Size as decimal(10,2))/1024 As
decimal(10,2))/1024) AS Decimal(10,2)) ) AS 'Total Document Size (MB)',
CAST((CAST(CAST(AVG(Docversions.Size) as decimal(10,2))/1024 As
decimal(10,2))/1024) AS Decimal(10,2)) AS 'Avg Document Size (MB)'
FROM Docs INNER JOIN DocVersions ON Docs.Id = DocVersions.Id
INNER JOIN Webs On Docs.WebId = Webs.Id
INNER JOIN Sites ON Webs.SiteId = SItes.Id
WHERE
Docs.Type <> 1
AND (LeafName NOT LIKE '%.stp')
AND (LeafName NOT LIKE '%.aspx')
AND (LeafName NOT LIKE '%.xfp')
AND (LeafName NOT LIKE '%.dwp')
AND (LeafName NOT LIKE '%template%')
AND (LeafName NOT LIKE '%.inf')
AND (LeafName NOT LIKE '%.css')
GROUP BY Webs.FullUrl, Webs.Title, DirName + '/' + LeafName
ORDER BY 'Total Version' desc, 'Total Document Size (MB)' descList of unhosted pages in the SharePoint solution: Collapse | Copy Codeselect Webs.FullUrl As SiteUrl,
case when [dirname] = ''
then '/'+[leafname]
else '/'+[dirname]+'/'+[leafname]
end as [Page Url],
CAST((CAST(CAST(Size as decimal(10,2))/1024 As
decimal(10,2))/1024) AS Decimal(10,2)) AS 'File Size in MB'
FROM Docs INNER JOIN Webs On Docs.WebId = Webs.Id
where [type]=0
and [leafname] like ('%.aspx')
and [dirname] not like ('%_catalogs/%')
and [dirname] not like ('%/Forms')
and [content] is not null
and [dirname] not like ('%Lists/%')
and [setuppath] is not null
order by [Page Url];List of top level WSS sites and their total size, including child sites in the portal: Collapse | Copy Codeselect FullUrl As SiteUrl,
CAST((CAST(CAST(DiskUsed as decimal(10,2))/1024 As
decimal(10,2))/1024) AS Decimal(10,2)) AS 'Total Size in MB'
from sites
Where FullUrl LIKE '%sites%' AND
fullUrl <> 'MySite' AND fullUrl <> 'personal'
List of portal area and total number of users: Collapse | Copy Codeselect webs.FullUrl, Webs.Title,
COUNT(WebMembers.UserId) As 'Total User'
from Webs INNER JOIN WebMembers
ON Webs.Id = WebMembers.WebId
Where fullurl NOT like '%sites%' AND
fullUrl <> 'MySite' AND fullUrl <> 'personal'
Group BY webs.FullUrl, Webs.Title
Order By 'Total User' descList of top level and sub sites in the portal and the number of users: Collapse | Copy Codeselect webs.FullUrl ,Webs.Title, COUNT(WebMembers.UserId) As 'Total User'
from Webs INNER JOIN WebMembers
ON Webs.Id = WebMembers.WebId
where fullurl like '%sites%' AND fullUrl <> 'MySite' AND fullUrl <> 'personal'
Group BY webs.FullUrl, Webs.Title
Order By 'Total User' descList of all portal area: Collapse | Copy Codeselect Webs.FullUrl As [Site Url],
Title AS [Area Title]
from Webs
Where fullurl NOT like '%sites%' AND fullUrl <>
'MySite' AND fullUrl <> 'personal'List of the total portal area: Collapse | Copy Codeselect COUNT(*)from Webs
Where fullurl NOT like '%sites%' AND
fullUrl <> 'MySite' AND fullUrl <> 'personal'List of all top level and sub sites in the portal: Collapse | Copy Codeselect Webs.FullUrl As [Site Url],
Title AS [WSS Site Title]
from webs
where fullurl like '%sites%' AND fullUrl <>
'MySite' AND fullUrl <> 'personal'List of the total top level and sub sites in the portal: Collapse | Copy Codeselect COUNT(*) from webs
where fullurl like '%sites%' AND fullUrl <>
'MySite' AND fullUrl <> 'personal'List of all list/document libraries and total items: Collapse | Copy Codeselect
case when webs.fullurl = ''
then 'Portal Site'
else webs.fullurl
end as [Site Relative Url],
webs.Title As [Site Title],
case tp_servertemplate
when 104 then 'Announcement'
when 105 then 'Contacts'
When 108 then 'Discussion Boards'
when 101 then 'Docuemnt Library'
when 106 then 'Events'
when 100 then 'Generic List'
when 1100 then 'Issue List'
when 103 then 'Links List'
when 109 then 'Image Library'
when 115 then 'InfoPath Form Library'
when 102 then 'Survey'
when 107 then 'Task List'
else 'Other' end as Type,
tp_title 'Title',
tp_description As Description,
tp_itemcount As [Total Item]
from lists inner join webs ON lists.tp_webid = webs.Id
Where tp_servertemplate IN (104,105,108,101,
106,100,1100,103,109,115,102,107,120)
order by tp_itemcount descNote: the tp_servertemplate field can have the following values:
104 = Announcement
105 = Contacts List
108 = Discussion Boards
101 = Document Library
106 = Events
100 = Generic List
1100 = Issue List
103 = Links List
109 = Image Library
115 = InfoPath Form Library
102 = Survey List
107 = Task List
List of document libraries and total items: Collapse | Copy Codeselect
case when webs.fullurl = ''
then 'Portal Site'
else webs.fullurl
end as [Site Relative Url],
webs.Title As [Site Title],
lists.tp_title As Title,
tp_description As Description,
tp_itemcount As [Total Item]
from lists inner join webs ON lists.tp_webid = webs.Id
Where tp_servertemplate = 101
order by tp_itemcount descList of image libraries and total items: Collapse | Copy Codeselect case when webs.fullurl = ''
then 'Portal Site'
else webs.fullurl
end as [Site Relative Url],
webs.Title As [Site Title],
lists.tp_title As Title,
tp_description As Description,
tp_itemcount As [Total Item]
from lists inner join webs ON lists.tp_webid = webs.Id
Where tp_servertemplate = 109 -- Image Library
order by tp_itemcount descList of announcement list and total items: Collapse | Copy Codeselect case when webs.fullurl = ''
then 'Portal Site'
else webs.fullurl
end as [Site Relative Url],
webs.Title As [Site Title],
lists.tp_title As Title,
tp_description As Description,
tp_itemcount As [Total Item]
from lists inner join webs ON lists.tp_webid = webs.Id
Where tp_servertemplate = 104 -- Announcement List
order by tp_itemcount descList of contact list and total items: Collapse | Copy Codeselect case when webs.fullurl = ''
then 'Portal Site'
else webs.fullurl
end as [Site Relative Url],
webs.Title As [Site Title],
lists.tp_title As Title,
tp_description As Description,
tp_itemcount As [Total Item]
from lists inner join webs ON lists.tp_webid = webs.Id
Where tp_servertemplate = 105 -- Contact List
order by tp_itemcount descList of event list and total items: Collapse | Copy Codeselect case when webs.fullurl = ''
then 'Portal Site'
else webs.fullurl
end as [Site Relative Url],
webs.Title As [Site Title],
lists.tp_title As Title,
tp_description As Description,
tp_itemcount As [Total Item]
from lists inner join webs ON lists.tp_webid = webs.Id
Where tp_servertemplate = 106 -- Event List
order by tp_itemcount descList of all tasks and total items: Collapse | Copy Codeselect
case when webs.fullurl = ''
then 'Portal Site'
else webs.fullurl
end as [Site Relative Url],
webs.Title As [Site Title],
lists.tp_title As Title,
tp_description As Description,
tp_itemcount As [Total Item]
from lists inner join webs ON lists.tp_webid = webs.Id
Where tp_servertemplate = 107 -- Task List
order by tp_itemcount descList of all InfoPath form library and total items: Collapse | Copy Codeselect
case when webs.fullurl = ''
then 'Portal Site'
else webs.fullurl
end as [Site Relative Url],
webs.Title As [Site Title],
lists.tp_title As Title,
tp_description As Description,
tp_itemcount As [Total Item]
from lists inner join webs ON lists.tp_webid = webs.Id
Where tp_servertemplate = 115 -- Infopath Library
order by tp_itemcount descList of generic list and total items: Collapse | Copy Codeselect
case when webs.fullurl = ''
then 'Portal Site'
else webs.fullurl
end as [Site Relative Url],
webs.Title As [Site Title],
lists.tp_title As Title,
tp_description As Description,
tp_itemcount As [Total Item]
from lists inner join webs ON lists.tp_webid = webs.Id
Where tp_servertemplate = 100 -- Generic List
order by tp_itemcount descTotal number of documents: Collapse | Copy CodeSELECT COUNT(*)
FROM Docs INNER JOIN Webs On Docs.WebId = Webs.Id
INNER JOIN Sites ON Webs.SiteId = SItes.Id
WHERE
Docs.Type <> 1 AND (LeafName NOT LIKE '%.stp')
AND (LeafName NOT LIKE '%.aspx')
AND (LeafName NOT LIKE '%.xfp')
AND (LeafName NOT LIKE '%.dwp')
AND (LeafName NOT LIKE '%template%')
AND (LeafName NOT LIKE '%.inf')
AND (LeafName NOT LIKE '%.css')Total MS Word documents: Collapse | Copy CodeSELECT count(*)
FROM Docs INNER JOIN Webs On Docs.WebId = Webs.Id
INNER JOIN Sites ON Webs.SiteId = SItes.Id
WHERE
Docs.Type <> 1 AND (LeafName LIKE '%.doc')
AND (LeafName NOT LIKE '%template%')Total MS Excel documents: Collapse | Copy CodeSELECT count(*)
FROM Docs INNER JOIN Webs On Docs.WebId = Webs.Id
INNER JOIN Sites ON Webs.SiteId = SItes.Id
WHERE
Docs.Type <> 1 AND (LeafName LIKE '%.xls')
AND (LeafName NOT LIKE '%template%')Total MS PowerPoint documents: Collapse | Copy CodeSELECT count(*)
FROM Docs INNER JOIN Webs On Docs.WebId = Webs.Id
INNER JOIN Sites ON Webs.SiteId = SItes.Id
WHERE
Docs.Type <> 1 AND (LeafName LIKE '%.ppt')
AND (LeafName NOT LIKE '%template%')Total TXT documents: Collapse | Copy CodeSELECT count(*)
FROM Docs INNER JOIN Webs On Docs.WebId = Webs.Id
INNER JOIN Sites ON Webs.SiteId = SItes.Id
WHERE
Docs.Type <> 1 AND (LeafName LIKE '%.txt')
AND (LeafName NOT LIKE '%template%')Total Zip files: Collapse | Copy CodeSELECT count(*)
FROM Docs INNER JOIN Webs On Docs.WebId = Webs.Id
INNER JOIN Sites ON Webs.SiteId = SItes.Id
WHERE
Docs.Type <> 1 AND (LeafName LIKE '%.zip')
AND (LeafName NOT LIKE '%template%')Total PDF files: Collapse | Copy CodeSELECT count(*)
FROM Docs INNER JOIN Webs On Docs.WebId = Webs.Id
INNER JOIN Sites ON Webs.SiteId = SItes.Id
WHERE
Docs.Type <> 1 AND (LeafName LIKE '%.pdf')
AND (LeafName NOT LIKE '%template%')Total JPG files: Collapse | Copy CodeSELECT count(*)
FROM Docs INNER JOIN Webs On Docs.WebId = Webs.Id
INNER JOIN Sites ON Webs.SiteId = SItes.Id
WHERE
Docs.Type <> 1 AND (LeafName LIKE '%.jpg')
AND (LeafName NOT LIKE '%template%')Total GIF files: Collapse | Copy CodeSELECT count(*)
FROM Docs INNER JOIN Webs On Docs.WebId = Webs.Id
INNER JOIN Sites ON Webs.SiteId = SItes.Id
WHERE
Docs.Type <> 1 AND (LeafName LIKE '%.gif')
AND (LeafName NOT LIKE '%template%')Total files other than DOC, PDF, XLS, PPT, TXT, Zip, ASPX, DEWP, STP, CSS, JPG, GIF: Collapse | Copy CodeSELECT count(*)
FROM Docs INNER JOIN Webs On Docs.WebId = Webs.Id
INNER JOIN Sites ON Webs.SiteId = SItes.Id
WHERE
Docs.Type <> 1 AND (LeafName NOT LIKE '%.pdf')
AND (LeafName NOT LIKE '%template%')
AND (LeafName NOT LIKE '%.doc')
AND (LeafName NOT LIKE '%.xls')
AND (LeafName NOT LIKE '%.ppt')
AND (LeafName NOT LIKE '%.txt')
AND (LeafName NOT LIKE '%.zip')
AND (LeafName NOT LIKE '%.aspx')
AND (LeafName NOT LIKE '%.dwp')
AND (LeafName NOT LIKE '%.stp')
AND (LeafName NOT LIKE '%.css')
AND (LeafName NOT LIKE '%.jpg')
AND (LeafName NOT LIKE '%.gif')
AND (LeafName <>'_webpartpage.htm')Total size of all documents: Collapse | Copy CodeSELECT SUM(CAST((CAST(CAST(Size as decimal(10,2))/1024
As decimal(10,2))/1024) AS Decimal(10,2)))
AS 'Total Size in MB'
FROM Docs INNER JOIN Webs On Docs.WebId = Webs.Id
INNER JOIN Sites ON Webs.SiteId = SItes.Id
WHERE
Docs.Type <> 1 AND (LeafName NOT LIKE '%.stp')
AND (LeafName NOT LIKE '%.aspx')
AND (LeafName NOT LIKE '%.xfp')
AND (LeafName NOT LIKE '%.dwp')
AND (LeafName NOT LIKE '%template%')
AND (LeafName NOT LIKE '%.inf')
AND (LeafName NOT LIKE '%.css')
AND (LeafName <>'_webpartpage.htm')Conclusion
Sunday, October 9, 2011
Monday, March 28, 2011
How to edit the Display page of Events in Sharepoint 2003 Version
How can i edit the Display page of Events in Sharepoint 2003 Version ?
1) go To the folder "C:\Program Files\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\1033\MPS" where events related files present
2) Check for the Default.aspx
3) I have received a requirement during my experience to disable to "Go to Events" for every event page .
4) For every event page this page will loads so at the time of body load i have called a function to disable the "Go To Events" link and its image based on the control name rendered .
5) That's it we are ready .
add the function to the body onload as below
onload="MWSOnLoad();disableEventLink();"
1) go To the folder "C:\Program Files\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\1033\MPS" where events related files present
2) Check for the Default.aspx
3) I have received a requirement during my experience to disable to "Go to Events" for every event page .
4) For every event page this page will loads so at the time of body load i have called a function to disable the "Go To Events" link and its image based on the control name rendered .
5) That's it we are ready .
add the function to the body onload as below
onload="MWSOnLoad();disableEventLink();"
Wednesday, February 16, 2011
Deleting users from all sites in SPS 2003
Deleting users from all sites in SPS 2003
By tpham
Sure, you can use the stsadm.exe tool with the “deleteuser” command, but you have to do that with *every* site which that user is a member of. And sure, you can use the “enumusers” switch to find these dead users, but again that is limited to listing the users for one site only.
So, fire up SQL Query Analyzer, connect to your SharePoint SQL database, and switch the active database to PORTALNAME_SITE. Then paste the following SQL:
SELECT DISTINCT N’”C:\Program Files\Common Files\Microsoft Shared\web server extensions\60\BIN\stsadm.exe”‘+ N’ -o deleteuser -url “http://portaladdress/’ + dbo.Webs.FullUrl + N’” -userlogin “‘ + dbo.UserInfo.tp_Login + N’”‘ AS Command FROM dbo.Webs RIGHT OUTER JOIN dbo.UserInfo ON dbo.Webs.SiteId = dbo.UserInfo.tp_SiteID WHERE (dbo.UserInfo.tp_Login = N’DOMAINNAME\username1′ OR dbo.UserInfo.tp_Login = N’ DOMAINNAME\username2′) AND (dbo.Webs.FullUrl IS NOT NULL) AND (dbo.Webs.FullUrl LIKE N’sites%’)
Of course, change the path to stsadm.exe if it is different for your server, replace http://portaladdress with your root portal address, and replace DOMAINNAME\username1 with the accounts that you want to remove. Then run the query, and it will generate one “stsadm –o deleteuser” command for every user and for every site which that user is a member of. Copy the output to the clipboard, paste it into Notepad and save it as a .bat file. Then run the .bat file in the Command Window using “ | clip”. The output will be silent but captured to the clipboard so you can review any possible errors after the operation is completed. Some errors that may occur include deleting the last administrator of a Site, missing users (I got lots of these but don’t know why yet) and deleting users from sub-sites in a Site collection that does not have unique permissions. All of these errors are harmless, but you’ll be left with a much cleaner collection of Site memberships in SharePoint, free of those dratted ex-employees whom you want to forget about and can now safely do so since their name won’t keep popping up anymore.
By tpham
Sure, you can use the stsadm.exe tool with the “deleteuser” command, but you have to do that with *every* site which that user is a member of. And sure, you can use the “enumusers” switch to find these dead users, but again that is limited to listing the users for one site only.
So, fire up SQL Query Analyzer, connect to your SharePoint SQL database, and switch the active database to PORTALNAME_SITE. Then paste the following SQL:
SELECT DISTINCT N’”C:\Program Files\Common Files\Microsoft Shared\web server extensions\60\BIN\stsadm.exe”‘+ N’ -o deleteuser -url “http://portaladdress/’ + dbo.Webs.FullUrl + N’” -userlogin “‘ + dbo.UserInfo.tp_Login + N’”‘ AS Command FROM dbo.Webs RIGHT OUTER JOIN dbo.UserInfo ON dbo.Webs.SiteId = dbo.UserInfo.tp_SiteID WHERE (dbo.UserInfo.tp_Login = N’DOMAINNAME\username1′ OR dbo.UserInfo.tp_Login = N’ DOMAINNAME\username2′) AND (dbo.Webs.FullUrl IS NOT NULL) AND (dbo.Webs.FullUrl LIKE N’sites%’)
Of course, change the path to stsadm.exe if it is different for your server, replace http://portaladdress with your root portal address, and replace DOMAINNAME\username1 with the accounts that you want to remove. Then run the query, and it will generate one “stsadm –o deleteuser” command for every user and for every site which that user is a member of. Copy the output to the clipboard, paste it into Notepad and save it as a .bat file. Then run the .bat file in the Command Window using “
Thursday, January 27, 2011
How To Make SharePoint 2003 Play Nice With Office 2007 Files
Office 2007 and SharePoint 2003, How To Fix Icons and File Open Issues
After digging around more than a dozen websites to get my own SharePoint site accepting Office 2007 files (docx, pptx, etc) as Word and PowerPoint files and not zip files I thought I’d try to bring all the info into one place for easy reference.
As you may of have not noticed if you’re using SharePoint 2003 and Office 2007 and save your documents to SharePoint you never see the correct icon and if you try to open the file from SharePoint it now thinks the file is a zip file. You can work around this by ignoring the icon and doing the little "Drop Down" and say "Edit in Word" but just because Microsoft has released SharePoint 2007 that doesn’t mean you have to do work arounds just to get your own site to work with Office 2007.
Since we are going to be working with IIS let’s go ahead and stop it,‘net stop iisadmin’.
So first off let’s get the icons we need. A big shout out to Alexander for creating those icons for us. Just open the zip, grab the icons from the "gif-light" directory, copy them into ‘%program directory%\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\IMAGES’. Now just edit the XML file which loads those icons by going to, ‘%program directory\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\XML’, open "docicon.xml" with Notepad. ALERT: For me any time I start messing with windows files I expect Murphy to show up so do yourself a favor and before you edit this and other files do a right-click, send to, compressed file just in case. Locate the sectionsection and add the following keeping your formatting inline for easy reference and nice XML:
Now that we have the icons and SharePoint knows how to assign them let’s move on to getting IIS to understand that a .docx file should be opened by Word instead of Zip. This also is pretty straight forward once you either know IIS and knew immediately the problem was a mime type association or you keep reading and just let me tell you how to fix this. Basically the problem is IIS doesn’t know how to serve up these file extensions so we need to tell it how by adding the mime type associations. Since we stopped IIS earlier it’s just a matter of editing the XML file containing the extensions which is ‘MetaBase.XML’ located at, %Windows%\system32\inetsrv. What we need to do is add the following to the IIsMimeMap section. Again keep the formatting pretty and do the ‘send to compressed’ just in case. Also note there is a leading and trailing " in that section so be careful how you paste and edit :
.docm,application/vnd.ms-word.document.macroEnabled.12
.docx,application/vnd.openxmlformats-officedocument.wordprocessingml.document
.dotm,application/vnd.ms-word.template.macroEnabled.12
.dotx,application/vnd.openxmlformats-officedocument.wordprocessingml.template
.potm,application/vnd.ms-powerpoint.template.macroEnabled.12
.potx,application/vnd.openxmlformats-officedocument.presentationml.template
.ppam,application/vnd.ms-powerpoint.addin.macroEnabled.12
.ppsm,application/vnd.ms-powerpoint.slideshow.macroEnabled.12
.ppsx,application/vnd.openxmlformats-officedocument.presentationml.slideshow
.pptm,application/vnd.ms-powerpoint.presentation.macroEnabled.12
.pptx,application/vnd.openxmlformats-officedocument.presentationml.presentation
.xlam,application/vnd.ms-excel.addin.macroEnabled.12
.xlsb,application/vnd.ms-excel.sheet.binary.macroEnabled.12
.xlsm,application/vnd.ms-excel.sheet.macroEnabled.12
.xlsx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
.xltm,application/vnd.ms-excel.template.macroEnabled.12
.xltx,application/vnd.openxmlformats-officedocument.spreadsheetml.template
Now just start IIS back up, simple way for that is to do an ‘IISReset’ at the command prompt and go test SharePoint. If you have followed the above correctly and not made any editing mistakes to the XML files you should be good to go.
After digging around more than a dozen websites to get my own SharePoint site accepting Office 2007 files (docx, pptx, etc) as Word and PowerPoint files and not zip files I thought I’d try to bring all the info into one place for easy reference.
As you may of have not noticed if you’re using SharePoint 2003 and Office 2007 and save your documents to SharePoint you never see the correct icon and if you try to open the file from SharePoint it now thinks the file is a zip file. You can work around this by ignoring the icon and doing the little "Drop Down" and say "Edit in Word" but just because Microsoft has released SharePoint 2007 that doesn’t mean you have to do work arounds just to get your own site to work with Office 2007.
Since we are going to be working with IIS let’s go ahead and stop it,
So first off let’s get the icons we need. A big shout out to Alexander for creating those icons for us. Just open the zip, grab the icons from the "gif-light" directory, copy them into ‘%program directory%\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\IMAGES’. Now just edit the XML file which loads those icons by going to, ‘%program directory\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\XML’, open "docicon.xml" with Notepad. ALERT: For me any time I start messing with windows files I expect Murphy to show up so do yourself a favor and before you edit this and other files do a right-click, send to, compressed file just in case. Locate the section
Now that we have the icons and SharePoint knows how to assign them let’s move on to getting IIS to understand that a .docx file should be opened by Word instead of Zip. This also is pretty straight forward once you either know IIS and knew immediately the problem was a mime type association or you keep reading and just let me tell you how to fix this. Basically the problem is IIS doesn’t know how to serve up these file extensions so we need to tell it how by adding the mime type associations. Since we stopped IIS earlier it’s just a matter of editing the XML file containing the extensions which is ‘MetaBase.XML’ located at, %Windows%\system32\inetsrv. What we need to do is add the following to the IIsMimeMap section. Again keep the formatting pretty and do the ‘send to compressed’ just in case. Also note there is a leading and trailing " in that section so be careful how you paste and edit :
.docm,application/vnd.ms-word.document.macroEnabled.12
.docx,application/vnd.openxmlformats-officedocument.wordprocessingml.document
.dotm,application/vnd.ms-word.template.macroEnabled.12
.dotx,application/vnd.openxmlformats-officedocument.wordprocessingml.template
.potm,application/vnd.ms-powerpoint.template.macroEnabled.12
.potx,application/vnd.openxmlformats-officedocument.presentationml.template
.ppam,application/vnd.ms-powerpoint.addin.macroEnabled.12
.ppsm,application/vnd.ms-powerpoint.slideshow.macroEnabled.12
.ppsx,application/vnd.openxmlformats-officedocument.presentationml.slideshow
.pptm,application/vnd.ms-powerpoint.presentation.macroEnabled.12
.pptx,application/vnd.openxmlformats-officedocument.presentationml.presentation
.xlam,application/vnd.ms-excel.addin.macroEnabled.12
.xlsb,application/vnd.ms-excel.sheet.binary.macroEnabled.12
.xlsm,application/vnd.ms-excel.sheet.macroEnabled.12
.xlsx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
.xltm,application/vnd.ms-excel.template.macroEnabled.12
.xltx,application/vnd.openxmlformats-officedocument.spreadsheetml.template
Now just start IIS back up, simple way for that is to do an ‘IISReset’ at the command prompt and go test SharePoint. If you have followed the above correctly and not made any editing mistakes to the XML files you should be good to go.
Tuesday, September 28, 2010
deploying The Reports in Sharepoint 2003 using Report Viewer WebPart
Reporting Services provides several Web Parts that work with specific versions of a report server and in particular deployment modes. If you want to access report server content on a SharePoint site from a native mode report server, use the SharePoint 2.0 Web Parts that are included with Reporting Services. Instructions for installing and using the 2.0 Web Parts are provided in this topic.
If you want to use a SharePoint 3.0 Web Part to access a report server that runs in SharePoint integrated mode, use the Reporting Services Add-in. For more information about the add-in, see Overview of Reporting Services and SharePoint Technology Integration.
About Report Explorer and Report Viewer
--------------------------------------------------------------------------------
Report Explorer and Report Viewer are SharePoint 2.0 Web Parts that were introduced in SQL Server 2000 Reporting Services Service Pack 2 (SP2) and continue to be available in current releases.
The Web Parts provide a way to view reports and explore the report server folder hierarchy from a SharePoint site:
Report Explorer connects to Report Manager on the report server computer. You can browse available reports on a report server and subscribe to individual reports. If Report Builder is enabled and you have sufficient permissions, you can start Report Builder from the Report Explorer Web Part.
Report Explorer displays the contents of a folder using a page in Report Manager. Access to individual items and folders throughout the report server folder hierarchy are controlled through role assignments on the report server. When you select a report, it opens in a new browser window. The HTML viewer on the report server displays the report and provides the report toolbar, not the Report Viewer Web Part. If you want to customize the toolbar settings, be sure to specify the URL access parameters on the report server. For instructions, see Using URL Access Parameters.
Report Viewer displays a report and provides a toolbar that you can use to navigate pages, search for content, or export the report. You can add the Report Viewer Web Part to a Web Part page to always show a specific report on that page or you can connect it to Report Explorer to display reports that are opened through that Web Part.
Note
The Report Viewer Web Part has the same name as a newer Report Viewer Web Part that is part of the Reporting Services Add-in, a SharePoint integration feature for Reporting Services report servers. Although it has the same name, it is a different Web Part that has a different schema and implementation. The Report Viewer Web Parts are not interchangeable despite having the same name. Visually, you can distinguish the two Web Parts through the following characteristic: the Report Viewer 3.0 Web Part that is installed through the add-in has an Actions menu on the toolbar.
Requirements
--------------------------------------------------------------------------------
Requirements for using the Report Viewer and Report Explorer Web Parts include the following:
Supported versions of SharePoint products and technologies include Windows SharePoint Services 2.0, 3.0, and SharePoint Foundation 2010; Microsoft SharePoint Portal Server; and Microsoft Office SharePoint Server 2007 and SharePoint Server 2010.
The report server version must be SQL Server 2005 Reporting Services or later.
The report server must run in native mode. You cannot use the Report Explorer and Report Viewer Web Parts to connect to or view reports on a report server that runs in SharePoint integrated mode. For more information about modes, see Planning a Deployment Mode.
Report Manager must be installed.
The Web Parts are unchanged from previous releases. Furthermore, they do not support the SharePoint integration feature set that is part of the Reporting Services Add-in. Specifically, they do not support the features that are described in the topic Overview of Reporting Services and SharePoint Technology Integration.
Report Explorer and Report Viewer Web Parts are distributed through a cabinet (.cab) file that is included with Reporting Services. Instructions for installing, configuring, and using the Web Parts are provided in the following sections of this topic.
Installing Web Parts
--------------------------------------------------------------------------------
Web parts are delivered to a SharePoint server as a cabinet (.cab) file. Run the Stsadm.exe tool on the .cab file from the command line to install the Web Parts. The Stsadm.exe tool is included in a SharePoint installation. To learn more about the tool and Web part deployment see your SharePoint documentation.
Note
The following instructions assume that you are using SQL Server 2005 Reporting Services or later and Windows SharePoint Services 3.0 or Office SharePoint Server 2007.
Copy the RSWebParts.cab to a folder on the SharePoint server. The .cab is installed with Reporting Services. By default, it is located in the C:\Program Files\Microsoft SQL Server\100\Tools\Reporting Services\SharePoint folder. You can copy it to any folder on the SharePoint server, and then delete it later after you install the Web Parts.
On the computer that has the installation of the SharePoint product or technology, open a Command Prompt window and navigate to the folder that has the Stsadm.exe tool. The path will vary depending on which version of Windows SharePoint Services you are running or if you running SharePoint Foundation 2010. For example, if you are using Windows SharePoint Services 3.0, the path is C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN.
Run Stsadm.exe on the .cab, using the following syntax:
CopySTSADM.EXE -o addwppack -filename "C:\ Program Files\Microsoft SQL Server\100\Tools\Reporting Services\SharePoint\RSWebParts.cab" -globalinstall
Specifying -globalinstall adds the Web Parts to the global assembly cache (GAC). This step is necessary if you want to connect the Web Parts.
Adding and Configuring Web Parts
--------------------------------------------------------------------------------
After you install the Web Parts, you can add them to a Web Part Page on a SharePoint site. You must have permission to create Web sites and add content.
Note that customizing the Web Parts is not supported. The Web parts are intended to be used as is, and should not be extended or modified.
To add the Web Parts to a team site
In a SharePoint Web application, open a Web Part page.
In Site Actions, click Edit Page.
In a zone on the page, click Add a Web Part.
In the Add Web Parts dialog box, scroll down to Miscellaneous. If you are using Office SharePoint Server , you might need to expand All Web Parts first.
Select Report Explorer. You can also select Report Viewer if you want to add both Web Parts at the same time to the same zone.
Do not select SQL Server Reporting Services Report Viewer if you see it in the same list. That Web Part is registered when you install the Reporting Services Add-in used for running a report server in SharePoint integrated mode. It cannot be used to view reports on a native mode report server.
Click Add.
While the page is in edit mode, click Edit in the Report Explorer Web Part.
In Report Manager URL, type a URL to a Report Manager instance that is associated with the native mode report server you want to access. By default, a Report Manager URL has the following syntax: http:///reports.
Optionally, set the Start Path. The start path is a folder in the report server folder hierarchy. You can specify a start path if you want the default page to be a folder further down the folder hierarchy. The path must begin with a forward slash. You must specify a complete path that starts with the root node of the report server folder hierarchy, but does not include the server name or Report Manager virtual directory. For example, to open a folder named Adventure Works just below the root node, specify /Adventure Works in the Start Path.
If you want to connect Report Explorer and Report Viewer, set the connection while the page is in Edit mode:
Click Edit on the Report Explorer Web Part menu.
Point to Connections.
Point to Show report in.
Click Report Viewer.
If you added Report Viewer to show a report within the page, enter a URL to the report.
Click Edit on the Report Viewer Web Part menu.
Click Modify Shared Web Part.
In Report Manager URL, type the full URL to a Report Manager instance that is associated with the native mode report server you want to access.
In Report Path, specify a forward slash, followed by the folder path, and the report name. Do not include the server name or Report Manager virtual directory. For example, to open the Company Sales report in the Adventure Works folder, specify /Adventure Works/Company Sales.
If you want to use a SharePoint 3.0 Web Part to access a report server that runs in SharePoint integrated mode, use the Reporting Services Add-in. For more information about the add-in, see Overview of Reporting Services and SharePoint Technology Integration.
About Report Explorer and Report Viewer
--------------------------------------------------------------------------------
Report Explorer and Report Viewer are SharePoint 2.0 Web Parts that were introduced in SQL Server 2000 Reporting Services Service Pack 2 (SP2) and continue to be available in current releases.
The Web Parts provide a way to view reports and explore the report server folder hierarchy from a SharePoint site:
Report Explorer connects to Report Manager on the report server computer. You can browse available reports on a report server and subscribe to individual reports. If Report Builder is enabled and you have sufficient permissions, you can start Report Builder from the Report Explorer Web Part.
Report Explorer displays the contents of a folder using a page in Report Manager. Access to individual items and folders throughout the report server folder hierarchy are controlled through role assignments on the report server. When you select a report, it opens in a new browser window. The HTML viewer on the report server displays the report and provides the report toolbar, not the Report Viewer Web Part. If you want to customize the toolbar settings, be sure to specify the URL access parameters on the report server. For instructions, see Using URL Access Parameters.
Report Viewer displays a report and provides a toolbar that you can use to navigate pages, search for content, or export the report. You can add the Report Viewer Web Part to a Web Part page to always show a specific report on that page or you can connect it to Report Explorer to display reports that are opened through that Web Part.
Note
The Report Viewer Web Part has the same name as a newer Report Viewer Web Part that is part of the Reporting Services Add-in, a SharePoint integration feature for Reporting Services report servers. Although it has the same name, it is a different Web Part that has a different schema and implementation. The Report Viewer Web Parts are not interchangeable despite having the same name. Visually, you can distinguish the two Web Parts through the following characteristic: the Report Viewer 3.0 Web Part that is installed through the add-in has an Actions menu on the toolbar.
Requirements
--------------------------------------------------------------------------------
Requirements for using the Report Viewer and Report Explorer Web Parts include the following:
Supported versions of SharePoint products and technologies include Windows SharePoint Services 2.0, 3.0, and SharePoint Foundation 2010; Microsoft SharePoint Portal Server; and Microsoft Office SharePoint Server 2007 and SharePoint Server 2010.
The report server version must be SQL Server 2005 Reporting Services or later.
The report server must run in native mode. You cannot use the Report Explorer and Report Viewer Web Parts to connect to or view reports on a report server that runs in SharePoint integrated mode. For more information about modes, see Planning a Deployment Mode.
Report Manager must be installed.
The Web Parts are unchanged from previous releases. Furthermore, they do not support the SharePoint integration feature set that is part of the Reporting Services Add-in. Specifically, they do not support the features that are described in the topic Overview of Reporting Services and SharePoint Technology Integration.
Report Explorer and Report Viewer Web Parts are distributed through a cabinet (.cab) file that is included with Reporting Services. Instructions for installing, configuring, and using the Web Parts are provided in the following sections of this topic.
Installing Web Parts
--------------------------------------------------------------------------------
Web parts are delivered to a SharePoint server as a cabinet (.cab) file. Run the Stsadm.exe tool on the .cab file from the command line to install the Web Parts. The Stsadm.exe tool is included in a SharePoint installation. To learn more about the tool and Web part deployment see your SharePoint documentation.
Note
The following instructions assume that you are using SQL Server 2005 Reporting Services or later and Windows SharePoint Services 3.0 or Office SharePoint Server 2007.
Copy the RSWebParts.cab to a folder on the SharePoint server. The .cab is installed with Reporting Services. By default, it is located in the C:\Program Files\Microsoft SQL Server\100\Tools\Reporting Services\SharePoint folder. You can copy it to any folder on the SharePoint server, and then delete it later after you install the Web Parts.
On the computer that has the installation of the SharePoint product or technology, open a Command Prompt window and navigate to the folder that has the Stsadm.exe tool. The path will vary depending on which version of Windows SharePoint Services you are running or if you running SharePoint Foundation 2010. For example, if you are using Windows SharePoint Services 3.0, the path is C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN.
Run Stsadm.exe on the .cab, using the following syntax:
CopySTSADM.EXE -o addwppack -filename "C:\ Program Files\Microsoft SQL Server\100\Tools\Reporting Services\SharePoint\RSWebParts.cab" -globalinstall
Specifying -globalinstall adds the Web Parts to the global assembly cache (GAC). This step is necessary if you want to connect the Web Parts.
Adding and Configuring Web Parts
--------------------------------------------------------------------------------
After you install the Web Parts, you can add them to a Web Part Page on a SharePoint site. You must have permission to create Web sites and add content.
Note that customizing the Web Parts is not supported. The Web parts are intended to be used as is, and should not be extended or modified.
To add the Web Parts to a team site
In a SharePoint Web application, open a Web Part page.
In Site Actions, click Edit Page.
In a zone on the page, click Add a Web Part.
In the Add Web Parts dialog box, scroll down to Miscellaneous. If you are using Office SharePoint Server , you might need to expand All Web Parts first.
Select Report Explorer. You can also select Report Viewer if you want to add both Web Parts at the same time to the same zone.
Do not select SQL Server Reporting Services Report Viewer if you see it in the same list. That Web Part is registered when you install the Reporting Services Add-in used for running a report server in SharePoint integrated mode. It cannot be used to view reports on a native mode report server.
Click Add.
While the page is in edit mode, click Edit in the Report Explorer Web Part.
In Report Manager URL, type a URL to a Report Manager instance that is associated with the native mode report server you want to access. By default, a Report Manager URL has the following syntax: http://
Optionally, set the Start Path. The start path is a folder in the report server folder hierarchy. You can specify a start path if you want the default page to be a folder further down the folder hierarchy. The path must begin with a forward slash. You must specify a complete path that starts with the root node of the report server folder hierarchy, but does not include the server name or Report Manager virtual directory. For example, to open a folder named Adventure Works just below the root node, specify /Adventure Works in the Start Path.
If you want to connect Report Explorer and Report Viewer, set the connection while the page is in Edit mode:
Click Edit on the Report Explorer Web Part menu.
Point to Connections.
Point to Show report in.
Click Report Viewer.
If you added Report Viewer to show a report within the page, enter a URL to the report.
Click Edit on the Report Viewer Web Part menu.
Click Modify Shared Web Part.
In Report Manager URL, type the full URL to a Report Manager instance that is associated with the native mode report server you want to access.
In Report Path, specify a forward slash, followed by the folder path, and the report name. Do not include the server name or Report Manager virtual directory. For example, to open the Company Sales report in the Adventure Works folder, specify /Adventure Works/Company Sales.
Wednesday, May 26, 2010
Unable to connect to the configuration database
Check The url ypu have deployed in the sharepoint application is added to the managed paths of the share point or not.If not add that url as excluded path so that that application is able to access the sharepoint config database.
http://localhost:28990/scprefix.aspx?VirtualServer=http%3a%2f%2fsny-spdb1%2f
http://localhost:28990/scprefix.aspx?VirtualServer=http%3a%2f%2fsny-spdb1%2f
Wednesday, April 7, 2010
Firefox prompts for a login prompt
Working with a client who has a mixture of both IE and Firefox for connecting to SharePoint. They are using internally and are currently using NTLM. Firefox was prompting for a login prompt every time user was connecting to SharePoint and this was causing a headache.
It turns out the fix is not too difficult and I wanted to repost here.
1. Open up FireFox
2. Type about:config in the address bar
3. Locate the key named network.automatic-ntlm-auth.trusted-uris.
4. Set that key’s value to a comma separated list of servers you want NTLM auth for
This was posted on various blogs but wanted to point this out as the client couldn’t seem to locate themselves.
Note: This is not a problem for those clients using Kerberos
It turns out the fix is not too difficult and I wanted to repost here.
1. Open up FireFox
2. Type about:config in the address bar
3. Locate the key named network.automatic-ntlm-auth.trusted-uris.
4. Set that key’s value to a comma separated list of servers you want NTLM auth for
This was posted on various blogs but wanted to point this out as the client couldn’t seem to locate themselves.
Note: This is not a problem for those clients using Kerberos
Subscribe to:
Posts (Atom)
