kwizcom banner advertisement

How to Integrate Syntaxhighlighter with SharePoint?

April 29, 2012    , , , , , ,
Needless to say, format and style of our code plays vital part when writing technical blogs. Among the other code formatting plugins, I personally like SyntaxHighlighter( http://alexgorbatchev.com ) as it is very easy to configure and use while keeping the code readable and easy to copy. In this article I'm sharing my experience on integrating syntax highlighter with SharePoint 2010. Step 1: Download the SyntaxHighlighter & upload to SharePoint Download the syntax highlighter from http://alexgorbatchev.com/SyntaxHighlighter/download/ and upload the files to a document library (or on the SharePoint server's 14 hive) so that you can reference them. Here I've created a document library with name "Syntax" Step 2: Link/Refer the CSS and JS files You can either refer the CSS & JS files in your Master page (Recommended) so that you wan to use it for anywhere.Or if its for one time, You can refer the files in content editor webpart even. Go to ShareP
How to Integrate Syntaxhighlighter with SharePoint? How to Integrate Syntaxhighlighter with SharePoint? Reviewed by Salaudeen Rajack on April 29, 2012 Rating: 5

How to Programmatically Upload File to SharePoint Document Library?

April 27, 2012    , ,
Code snippet to programmatically upload Files to SharePoint List or Library: using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.SharePoint; using System.IO; using System.Collections; namespace UploadFiles { class Program { static void Main(string[] args) { //Get the Site collection using (SPSite site = new SPSite("http://sharepoint.com")) { //Open the Root web using(SPWeb web=site.OpenWeb()) { /*** Simple File Upload ********/ // Read the file from the stream into the byte array FileStream fs= File.OpenRead(@"c:\MyDoc.doc"); byte[] FileContent= new byte[fs.Length]; fs.Read(FileContent, 0, Convert.ToInt32(fs.Length)); fs.Close(); //Get the documents Librarym named "Documents"
How to Programmatically Upload File to SharePoint Document Library? How to Programmatically Upload File to SharePoint Document Library? Reviewed by Salaudeen Rajack on April 27, 2012 Rating: 5

SharePoint Site Template IDs Reference

April 26, 2012    , , ,
When you create SharePoint sites, you'll be picking a relevant template from number of available ones. So, SharePoint makes it easier rather developing everything from the scratch. If you create a SharePoint site/web using PowerShell, You need the template code or id to provision. How to get SharePoint Site/Web Templates using PowerShell: To get all available site templates in SharePoint with the PowerShell, use this cmd-let:   Get-SPWebTemplate This lists all available templates in the farm. Here is the SharePoint site template codes: Template Name Description GLOBAL#0 Global STS#0 Team STS#1 Blank STS#2 Document MPS#0 Basic MPS#1 Blank MPS#2 Decision MPS#3 Social MPS#4 Multipage CENTRALADMIN#0 Central WIKI#0 Wiki BLOG#0 Blog SGS#0 Group TENANTADMIN#0 Tenant ACCSRV#0 Access ACCSRV#1 Assets ACCSRV#3 Charitable
SharePoint Site Template IDs Reference SharePoint Site Template IDs Reference Reviewed by Salaudeen Rajack on April 26, 2012 Rating: 5

SharePoint My Site Analysis Report - A Practial Business Scenario

April 24, 2012    , , , ,
Call from my CIO: "Salaudeen, I need the SharePoint 'My Site' Report with Department wise users along with their other details such as E-Mail." Well, E-Mail I can retrieve by querying Site Owner object, How about Department? Ah, Its available in Profile DB. Let me query that. Here is my code: using System; using System.IO; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.SharePoint; using Microsoft.SharePoint.Administration; using Microsoft.Office.Server; using Microsoft.Office.Server.Administration; using Microsoft.Office.Server.UserProfiles; using System.Web; namespace SharePoint.AdminReports { class MySiteAnalysis { static void Main(string[] args) { //Get the My Site web application URL string site; string WorkEmail; if (args.Length == 0) { Console.WriteLine("Enter the My site URL:"); site = Cons
SharePoint My Site Analysis Report - A Practial Business Scenario SharePoint My Site Analysis Report - A Practial Business Scenario Reviewed by Salaudeen Rajack on April 24, 2012 Rating: 5

How to Hide User Names in SharePoint Survey?

April 24, 2012    , , ,
Ever wanted to hide the user identity in SharePoint Survey? Recently, to provide complete anonymity, we had to hide the user names in Created by and Last Modified By fields in a SharePoint Survey. Follow these steps to hide user names in SharePoint survey: Go to your SharePoint Survey page Click on Settings >> Survey Settings Click on Title, description and navigation link Under General Settings Under Survey Options, select  No  for Show user names in survey results? Click on Save button to apply the changes. Now, you will see fields like Created By  and Last Modified By appear as ***  instead of the actual user name. If you want to know who answered the survey, enable "Show user names in survey results" and this will reveal user names again! Although other lists doesn't provide a way to hide user names, we can achieve it programmatically. refer: How to Hide User Names in Created by, Modified by Fields in SharePoint
How to Hide User Names in SharePoint Survey? How to Hide User Names in SharePoint Survey? Reviewed by Salaudeen Rajack on April 24, 2012 Rating: 5

Apply Filters to People Picker in SharePoint - E.g. Don't show User Accounts with No E-mail

April 22, 2012    , , , ,
Business Problem: Many users having more than one account/admin account in multiple domains. Now the problem is: when end-users selects approvers from people pickers in various workflows, They selects user account without E-Mail. Since the workflows are unable to get any E-Mails from the selected users they are failing. What's the Solution : Lets instruct People Picker "O.K, People Picker, Don't show me accounts which doesn't has E-Mail associated!" But How to filter people picker in SharePoint? Set the appropriate People Picker custom Properties by running the below STSADM commands: Lets say, you want only the "Sales" or "IT" department people to be in People picker. Just apply the filter to People picker with STSADM: stsadm -o setproperty -pn peoplepicker-searchadcustomfilter -pv "(|(department=Sales)(department=IT))" -url <web-application-URL or Site collection URL> To Filter-out accounts without E-mails: st
Apply Filters to People Picker in SharePoint - E.g. Don't show User Accounts with No E-mail Apply Filters to People Picker in SharePoint - E.g. Don't show User Accounts with No E-mail Reviewed by Salaudeen Rajack on April 22, 2012 Rating: 5
Branded Master Page & Page Layout Project in MOSS 2007 Branded Master Page & Page Layout Project in MOSS 2007 Reviewed by Salaudeen Rajack on April 20, 2012 Rating: 5

Delete Users and Clean up User Information List

April 19, 2012    , , , ,
Some time back, I wrote an article on deleting user accounts from "User Information List" to get rid of the issue: Deleted accounts shown in People Picker: SharePoint People Picker shows deleted accounts in Active Directory and SharePoint Since the people picker get data from both Active directory and "User Information List" of SharePoint (Which is a hidden list - SharePoint will create an entry in this list when the user added to the site or visits the site for the first time. SharePoint sync this list from user profile when user create/edit/update/delete items). In my organization, for some reasons, management decided to remove a particular domain completely. So the requirement turned towards SharePoint as: Remove All users of particular domain from User Information List, so that those accounts will not be visible in People picker ! By the way, those accounts were already deleted from active directory and from SharePoint user profile import connections. So, I
Delete Users and Clean up User Information List Delete Users and Clean up User Information List Reviewed by Salaudeen Rajack on April 19, 2012 Rating: 5

People Picker not Showing All Users from Active Directory Domain?

April 16, 2012    , , ,
In a Sandbox, Installed and configured SharePoint. Everything works great, except the People Picker. Problem is: People picker didn't show any user from active directory, However it showed me the users from my local sandbox. Verified whether the Sandbox is joined to the domain. Yes, It is.  By default, People picker should show accounts from AD where the server belongs to. It also will get the users from Two-way-Trusted domains. (And of course, from the site collection's "User Information List" as well.) Additional configurations are needed in case of Configure People Picker in One-way-trusted domains . But here, Application Pool account is the culprit: The application pool account is the one which pulls users from AD to People Picker and in my case, the application pool account was a local account, not a member in AD. App pool id must be a Domain user! Well, After changing the application pool account from local account to the domain account, able to get the
People Picker not Showing All Users from Active Directory Domain? People Picker not Showing All Users from Active Directory Domain? Reviewed by Salaudeen Rajack on April 16, 2012 Rating: 5

PowerShell Quick Reference for SharePoint Administrators

April 15, 2012    ,
What is PowerShell? PowerShell is a command-line scripting tool that helps you to automate and quickly solve tedious Administrator tasks. It was originally developed by Microsoft for task automation and configuration management purposes. PowerShell combines the Power of command-line shell and scripting language! PowerShell also provides an administrator full access to COM, WMI and supports API calls from several applications, Such as: SharePoint Exchange Server Windows Desktop OS, Server OS SQL Server SCOM/SCDPM/SVCMM VMWARE/Citrix  Office 365, Azure, etc. PowerShell runs on top of .NET framework, 2.0+. With PowerShell, we can automate almost every thing we do with GUI (some times, things which are not possible with GUI). Its not just command prompt or Script language, But its a Command-Shell, just like DOS shell, But more powerful . Problems with Existing scripting languages No common scripting for all the products .Net code COM Model Exe VBScript Scripts are r
PowerShell Quick Reference for SharePoint Administrators PowerShell Quick Reference for SharePoint Administrators Reviewed by Salaudeen Rajack on April 15, 2012 Rating: 5
Powered by Blogger.