kwizcom banner advertisement

Change SharePoint 2010 Authentication from Windows to Forms

June 29, 2012    , , ,
While creating a web application, by mistake selected "Windows" authentication, and felt we need "Forms" authentication (Claims Based Authentication) because of a business requirement. Went to Central Administration >> Application Management >> Manage Web Applications >> Selected the desired web application >> Authentication Providers . Oops, "Forms" option is disabled! Couldn't find any way to enable "Forms" Authentication from user interface. Solution? PowerShell! Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue $WebApp=get-spwebapplication "http://sharepoint.crescent.com" $WebApp.useclaimsauthentication="True" $WebApp.Update()
Change SharePoint 2010 Authentication from Windows to Forms Change SharePoint 2010 Authentication from Windows to Forms Reviewed by Salaudeen Rajack on June 29, 2012 Rating: 5

Hide Contextual Search Scope from Search Dropdown

June 26, 2012    ,
Requirement: Hide the contextual "This Site: Site Name" search scope from Search drop down. Solution: 1. Copy the folder OSearchEnhancedFeature from "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\OSearchEnhancedFeature" as "OSearchNoContextScope" 2. Delete the SearchAdminLinks.xml file inside OSearchNoContextScope and remove the reference <ElementManifest Location="searchadminlinks.xml"/>   from Feature.xml 3. Edit the Feature.xml file, Change the Feature GUID, Feature Title, description. 4. Add <Property Name="DropDownMode">ShowDD_NoContextual</Property> in SearchArea.xml. Move the <Property Name="UseSiteDefaults">true</Property> next to it. 4. Build and Create a WSP. Deploy & activate the feature "Hide Contextual Search Scope Dropdown items" to see it in action! Project structure   Before: After:
Hide Contextual Search Scope from Search Dropdown Hide Contextual Search Scope from Search Dropdown Reviewed by Salaudeen Rajack on June 26, 2012 Rating: 5

Report for SharePoint Access Request Email Configurations

June 23, 2012    , , , , ,
Requirement: People are moving to different roles, Few left the company from time to time. Access requests are sent to those in that kind. Its a problem! We had to monitor the access request configurations to make sure its sent to the relevant person. So, Wrote this PowerShell code to generate the report for SharePoint access request email address configurations. PowerShell to Generate Report on Access Requests Configuration: #Set-ExecutionPolicy RemoteSigned $OutputFN = "AccessRequestConfigs.csv" #delete the file, If already exist! if (Test-Path $OutputFN) { Remove-Item $OutputFN } #Write the CSV Headers "Site Collection Name, Site Name ,URL ,Access Requst E-Mail" > $OutputFN # Get All Web Applications $WebAppServices=Get-SPWebApplication foreach($webApp in $WebAppServices) { # Get All Site collections foreach ($SPsite in $webApp.Sites) { # get All Sites foreach($SPweb in $SPsite.AllWebs) { if($SPweb.R
Report for SharePoint Access Request Email Configurations Report for SharePoint Access Request Email Configurations Reviewed by Salaudeen Rajack on June 23, 2012 Rating: 5

How to Install PowerShell ISE in Windows Server 2008 R2?

June 22, 2012    , , ,
PowerShell ISE is a wonderful tool for creating, Debugging and executing PowerShell scripts. But it doesn't get installed automatically. Here is how to install PowerShell ISE in windows 2008 R2. You don't have to download anything to get PowerShell ISE in Windows 2008 R2, Its a Instinct feature but not installed by default. 1. Go to Server Manager >> Features >> Add Features 2. From the features list choose "Windows PowerShell Integrated Scripting Environment" 3. Click Next and Install Once installed, You can choose "Edit" from PowerShell Script files to launch PowerShell ISE. you can access the PowerShell ISE by typing "PowerShell_ISE" in Run box even! Tail: All these actions can be simply achieved by running these two lines of PowerShell: Import-Module ServerManager Add-Windowsfeature PowerShell-ISE
How to Install PowerShell ISE in Windows Server 2008 R2? How to Install PowerShell ISE in Windows Server 2008 R2? Reviewed by Salaudeen Rajack on June 22, 2012 Rating: 5

Trim audit log to Improve Performance in SharePoint

June 22, 2012    , , , , , ,
Found SharePoint content databases are growing even when no content was added from user side. I was analyzing SharePoint Database growth, went ahead and generated disk space report from SQL Server Management studio (Right click the database, choose Reports >> Standard Reports >> Disk Usage by Table ) which gave me the clear picture: AuditData table was growing rapidly and occupying more disk space. This is because of the auditing feature is turned ON for several Months and Audit logs are stored in the AuditData table of the content database. Auditing feature is great, but it can take so much disk space in a long run and we definitely want to put some cap to preserve system resources, especially database disk space. SharePoint 2010 provides the interface to specify the number of days to retain audit logs and also provides an option to export the audit logs before truncate. So, we can adjust the settings to export and clear the audit logs in a interval. trim audit l
Trim audit log to Improve Performance in SharePoint Trim audit log to Improve Performance in SharePoint Reviewed by Salaudeen Rajack on June 22, 2012 Rating: 5

Find in Which Content Database Site Collection Lives

June 20, 2012    , , ,
Requirement: Get which site collections resides in which content database. Solution: Simplest method is: Navigate to Central Admin >> Application Management >> View All Site Collections .  This will display the content database name of a particular site collection. Site collection's content database in SharePoint 2010 PowerShell Script to get site collection's content database: This code outputs the content database name of given site collection. $site=Get-SPSite "http://sharepoint.crescent.com write-host $site.ContentDatabase.Name One-Liner to Find Content Databases of Site collections in SharePoint 2013: Get-SPWebApplication | Get-SPSite | Select URL, @{Name="Database"; Expression={$_.ContentDatabase.Name}} Using STSADM to get Content Database of All site collections: Execute the STSADM as STSADM -o enumSites -url http://SharePoint.Company.com > SitesList.xml This will generate the SitesList.xml file with following informa
Find in Which Content Database Site Collection Lives Find in Which Content Database Site Collection Lives Reviewed by Salaudeen Rajack on June 20, 2012 Rating: 5

How to Set Welcome Page Programmatically in SharePoint?

June 15, 2012    , , , , , , ,
By default, SharePoint uses "default.aspx" page as the welcome page (or Home page) in SharePoint 2007 and "SitePages/Home.aspx" in SharePoint 2010. It uses Pages/Home.aspx when publishing feature is enabled under MOSS 2007. If you want to change Home Page: SharePoint provides users an interface to set the welcome page once Publishing feature is enabled. (By going to Site actions >> Site Settings >> Welcome Page) and specify the welcome page. What if You don't want to enable the publishing feature, but want to change the Welcome page? Just hit this URL in browser: http:// Sharepoint-site-URL /_layouts/AreaWelcomePage.aspx  ,change the Sharepoint-site-URL accordingly. Want to do it Programmatically? Yes, We can set welcome page in SharePoint 2010 programmatically with Object Model. Here is how: Change welcome page programmatically Using C# Object Model: using (SPSite site = new SPSite("http://sharepoint.com")) { using (S
How to Set Welcome Page Programmatically in SharePoint? How to Set Welcome Page Programmatically in SharePoint? Reviewed by Salaudeen Rajack on June 15, 2012 Rating: 5

Change All SharePoint Site's Access Request Emails with PowerShell

June 15, 2012    , , , , ,
Some time back, I posted an article on Configuring Access Requests from SharePoint .Now, To take the control, Business decided to give the access control requests to SharePoint help desk, instead of site owners. So, the requirement is: Update All SharePoint Site's Access request Emails to: SharePoint Help Desk's Mail id ( SharePointSupport@Crescent.com ). Lets change SharePoint access request email with PowerShell. PowerShell Script to Change All SharePoint S ite's access request Email addresses: # Get All Web Application $webApp=Get-SPWebApplication # Get All site collections foreach ($SPsite in $webApp.Sites) { # get the collection of webs foreach($SPweb in $SPsite.AllWebs) { # if a site inherits permissions, then the Access request mail setting also will be inherited if (!$SPweb.HasUniquePerm) { Write-Host "Inheriting from Parent site" }
Change All SharePoint Site's Access Request Emails with PowerShell Change All SharePoint Site's Access Request Emails with PowerShell Reviewed by Salaudeen Rajack on June 15, 2012 Rating: 5

Iterate through All SharePoint Web Applications, Site Collections, Sub-sites, Lists and List Items Programmatically

June 12, 2012    , , ,
Often in development, we may have to iterate through all web applications, Site collections, sites, Lists and List Items to get some job done or generate reports. Here are the code snippets to help. Iterate Through all web applications, Site collections, Sites, Lists and List Items Using C#: static void Main(string[] args) { SPFarm farm = SPFarm.Local; //Get all SharePoint Web services SPWebService service = farm.Services.GetValue<SPWebService>(""); foreach (SPWebApplication webapp in service.WebApplications) { Console.WriteLine(webapp.Name); //Enumerate through each site collection foreach (SPSite site in webapp.Sites) { //Console.WriteLine(site.Url); //Enumerate thr
Iterate through All SharePoint Web Applications, Site Collections, Sub-sites, Lists and List Items Programmatically Iterate through All SharePoint Web Applications, Site Collections, Sub-sites, Lists and List Items Programmatically Reviewed by Salaudeen Rajack on June 12, 2012 Rating: 5

Alert Management Web Part - Released in CodePlex

June 12, 2012    , , , ,
Received lot of mails from People who read my post Alert Management Web part Mock-up on Alert Management Web Part Solution. So, I created a CodePlex Project to Share! Business Problem: In a Project management site, When new project sites created, Project Manager creates alerts for all team members in multiple Lists/Libraries.  Pain point is: He need to manually create alerts by going to each and every list/library >> Alert Me >> and then adding users to keep them informed. Yes, Its a pain for them to add users one by one in all of the lists and libraries, Solution: we started creating Custom Alert Management web part which will solve this problem. Key Features: Create Alert for Multiple Lists/Libraries at one stretch Edit/Delete Multiple alerts at one stretch based on Site/Sub-Site/User Screens: Deployment Instructions: Download the WSP from below CodePlex location, Add & Deploy the solution. Go to Site collection Features and activate the "Ale
Alert Management Web Part - Released in CodePlex Alert Management Web Part - Released in CodePlex Reviewed by Salaudeen Rajack on June 12, 2012 Rating: 5

SharePoint Web Services Exposed to Anonymous Access Users

June 11, 2012    , , , , ,
Accidentally found my SharePoint Test environment's web services URLs are exposed in Google as anonymous access!  and I was able to access the web services anonymously! Even though SharePoint web services exposed by anonymous access, SharePoint will not allow anyone to do beyond their access rights. Say for e.g. In order to call Add List Item method via web service, End user must have contributor permission at least. But the problem is, It disposes lot of content via web services E.g. SiteData.asmx which exposes every page of our SharePoint site. We don't want to expose data to anyone, We don't want anonymous people to access our web-services, isn't it? What is the Fix for SharePoint 2007 web services anonymous access? Most of the Web services resides at " C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\ISAPI ", which is mapped as a virtual folder " /_vti_bin ".  So, Lets Instruct SharePoint to require authenticati
SharePoint Web Services Exposed to Anonymous Access Users SharePoint Web Services Exposed to Anonymous Access Users Reviewed by Salaudeen Rajack on June 11, 2012 Rating: 5

Programmatically Check whether a Particular List/Library Exists or Not

June 07, 2012    , , , ,
How to check if list exists in SharePoint programmatically? SharePoint 2010 offers TryGetList Method to determine the existence of a List programmatically. TryGetList returns null, if the specified list doesn't exist. SharePoint 2010 check if list exists: using (SPSite site = new SPSite("http://sharepoint.company.com/sites/sales/")) { using (SPWeb web = site.RootWeb) { SPList ProjectList = Web.Lists.TryGetList("Project Documents"); if (ProjectList != null) { ProjectList.Delete(); } } } MOSS 2007: In SharePoint 2007, we have to write our own method to check if a particular list exists or not. SharePoint 2007 check if list exists in C# : //Method to Get whether the particular list exists or Not public static bool ListExists(SPWeb web, string listN
Programmatically Check whether a Particular List/Library Exists or Not Programmatically Check whether a Particular List/Library Exists or Not Reviewed by Salaudeen Rajack on June 07, 2012 Rating: 5

Read From Excel & Import to Sharepoint List - Using Web Services

June 04, 2012    , , ,
Another code snippet using SharePoint-Web Services. Requirement is: End-User wants to read data from Microsoft Excel (it will be placed at c:\contracts.xls ) and append to SharePoint List (List Name: Contracts) on-demand from his desktop. So the idea is: Lets build a console application, Add a web service reference to SharePoint List web service http://<Site>/_vti_bin/Lists.asmx and give it to the end user. Let him run the console application from his desktop on-demand. using System; using System.Collections; using System.Data; using System.Xml; using System.IO; using System.Data.OleDb; using System.Data.Common; namespace ReadFromExcelImportToSharePoint { class Program { static void Main(string[] args) { DateTime dt; string dt1; //initialize Web Service Reference Site1.Lists.Lists list = new ListWebservice.Site1.Lists.Lists(); list.Credentials = System.Net.CredentialCache.DefaultCredentials; XmlNode contac
Read From Excel & Import to Sharepoint List - Using Web Services Read From Excel & Import to Sharepoint List - Using Web Services Reviewed by Salaudeen Rajack on June 04, 2012 Rating: 5

Setting up Scopes in SharePoint Search Results

June 02, 2012    ,
Requirement is: When user search from a particular site collection, either the default search result or advanced search result, should get content ONLY from a list of sites. Solution? Search Scopes! Search scopes in SharePoint allows users to narrow down the search results based on content sources, web addresses, and metadata. So, I created a scope "Search All Marketing Sites" to include all marketing websites URLs. Now, I'm jumping to setting up scope on Search results directly. For Default Search Results: I created a separate search center site, edited the search results page ( /SearchCenter/Pages/Results.aspx ) Search core results web part properties, Expand the Miscellaneous section and entered the scope. SharePoint search scope result page Pretty straight forward, isn't it? How about Advanced Search? For advanced search, scopes are not configured in web part properties as in default search results. But, Its on Site collection's scope setti
Setting up Scopes in SharePoint Search Results Setting up Scopes in SharePoint Search Results Reviewed by Salaudeen Rajack on June 02, 2012 Rating: 5

Site Traffic Hits Report on Every Item on a SharePoint Site

June 02, 2012    , , , , ,
Requirement : Get the site traffic hits count for the past 30 days on each and every File/List/Page/etc stored on a MOSS 2007 site. C# Object Model code to Generate SharePoint hits report: using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.SharePoint; using Microsoft.SharePoint.Administration; using System.Data; using System.Diagnostics; using System.IO; namespace SharePoint.AdminReport { class GetSiteUsageReport { //Method to Convert Data Table to CSV public static string ToCSV(DataTable table, string webURL)//, string listURL) { var result = new StringBuilder(); foreach (DataRow dr in table.Rows) { result.Append(webURL + "\t" + (dr["Folder"].ToString() == "" ? "" : "/") + dr["Folder"].ToString() + "/" + dr["Page"].ToString() + "\t" + dr["Total
Site Traffic Hits Report on Every Item on a SharePoint Site Site Traffic Hits Report on Every Item on a SharePoint Site Reviewed by Salaudeen Rajack on June 02, 2012 Rating: 5

Custom 404 Page Not Found Error Page in SharePoint 2010

June 01, 2012    , , , ,
Its a best practice to show customized 404 page not found error page for any website when user request for a broken URL or mistyped URLs. SharePoint has no exclusions. By default, SharePoint gives this 404 error screen to the user: So, Its great to have custom 404 Page not found error page in SharePoint 2010 to add some user experience, isn't it? Lets see how custom 404 error page in SharePoint can be done: 1. Create an aspx page in Root site collection (say, " \SitePages\CustomError.aspx "). Add some descriptive image and text to it. 2. Go to IIS Manager, Backup the web.config file and proceed with the following steps. 3. Expand the desired web application, open the "Error Pages" feature. 4. Double click on 404 status code  This will open the "Edit Custom Error Page" configuration window. Change the option to: " Execute a URL on this site " and specify the URL as: /SitePages/custom404.aspx (The Error page we have crea
Custom 404 Page Not Found Error Page in SharePoint 2010 Custom 404 Page Not Found Error Page in SharePoint 2010 Reviewed by Salaudeen Rajack on June 01, 2012 Rating: 5
Powered by Blogger.