Tuesday, April 15, 2014

Useful STSADM Command



STSADM Command (SharePoint Team Services Administration)

Before you run to STSADM command, you are required to run command prompt with “Run as Administrator” .  In common prompt, you have to change directory to

C: \ Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\bin>

  • To backup SharePoint Team Site without user permission
    • stsadm -o export -url  <url of your team site> -filename <file location>
       You are able to see one .export file and multiple .cmp files in your  file location. In .export file, all logs will be recorded.
       
  • To backup SharePoint Team Site with user permission 
    •  stsadm -o export -url  <url of your team site> -filename <file location> -includeusersecurity
       You are able to see one .export file and multiple .cmp files in your  file location. in .export  file, all logs will be recorded.

  •  To restore SharePoint Team Site without user permission 
    • Create one Team Site in SharePoint 
    • import-spweb -identity “Create Team Site Url” -path <your exported file e.g D:\test.cmp>
       
  • To restore SharePoint Team Site with user permission 
    • import-spweb -identity “Create Team Site Url” -path <your exported file e.g  D:\test.cmp> -includeusersecurity

  •  To increate Team Site Template Limit 
    • stsadm -o setproperty -propertyname max-template-document-size -propertyvalue 524288000

Retracting and Deploying SP Solution in Sharepoint Server 2010



Yesterday, I encountered one problem when I tried to retracting farm solution in SharePoint Server.
. Here is the SharePoint Power Shell code to retract. 

Uninstall-SPSolution –Identity <Name of wsp file>.wsp –Webapplication “<your application name>”

But it stuck the status with “ Retracting(Scheduled ….)”. Then I cancelled the job and retract with force command

Uninstall-SPSolution –Identity <Name of wsp file>.wsp –Webapplication “<your application name>” –force -confirm:$false

It still stucking. Then tried to cancelled the job and remove with force command using following code.

Remove-SPSolution -identity <Name of wsp file>.wsp –Webapplication “<your application name>” -force -confirm:$false

The solution has been removed from server. Then tried to add the solution.

Add-SPSolution “File Location and File Name (e.g D:\test.wsp)”.

Solution has been successfully added. Then tried to install the solution to SharePoint Sever.

Install-SPSolution –Identity <Name of wsp file>.wsp –Webapplication “<your application name>”.

But still stuck. Then I restarted the sharepoint timer services.

Net stop sptimerv4.

When I run this in command prompt, the service cannot stop and it stuck in Stopping.
Then open Task Manager -> Processes Tab -> Select Show Processes from all Users
Kill all process of w3wp.exe and OWSTimer.exe.

After that I reset IIS Server in command prompt
 iisreset /noforce

Then tried to stop and start sharepoint timer services.

Net stop sptimerv4.
Net start sptimerv4.

SPTimer services is restarted successfully.
Then install spsolution to sharepoint server.
Now SPSolution deployed successfully in sharepoint server. JJJ



Wednesday, June 5, 2013

Generate Permission Report for all folder in all document libraries

Hi SharePoint Folks,

If you have difficulties to generate permission for all folders, sub folders from all document libraries within the site, don't worry. I have done one development for it.

 



Please download the following web part and install into your sharepoint  server.
http://www.sendspace.com/file/chtemc


Detail Instruction:

STEP 1 : Download wsp file from the above link:

STEP 2 : Run SharePoint PowerShell Management  with administrator account in sharepoint web server

STEP 3 : Type as below to add solution:
         Add-SPSolution “D:\Deploy\PermissionReport.wsp“

STEP 4 : Type as below to install solution:
         Install-SPSolution –Identity PermissionReport.wsp –WebApplication <http://yourwebapplink> –GACDeployment      

STEP 5 : Then Go to your sharepoint site. Then Add this webpart to your web page.

Finally, you are able to see the permission report for all folders in all document libraries in your site.




Tuesday, April 5, 2011

Get Distinct Value from Array

public static string[] RemoveDuplicates(string[] s)
{

HashSet set = new HashSet(s);
string[] result = new string[set.Count];
set.CopyTo(result);
return result;
}

When you use HashSet, you need to import System.Collections.Generic and add Reference (System.Core).


Thank you very much.

Thursday, January 13, 2011

Display Chinese Characters in Gmail

As some of my clients from china, they want to save Chinese characters in database and retrieve it in web page. It is a piece of cake to save and display those characters in web page.


To save Chinese character in database:


Insert into Table1 ( Field1, Field2) values ( Test1 , N'藏青')


But there is a function to send system generated email to customers. Here is the problem !!! I am very strange that the Chinese characters cannot display both of my gmail and outlook . There is ?????-???? instead of displaying Chinese characters. So I research online and I found some code from codeproject website that can able to see Chinese characters in Gmail. See the following code:


public string getCorrectCharacter(string str)
{
       Encoding iso = Encoding.GetEncoding("iso8859-1");
       Encoding unicode = Encoding.UTF8;
       byte[] unicodeBytes = unicode.GetBytes(str);
       return iso.GetString(unicodeBytes);
}

Although Gmail can display chinese character correctly, Outlook Email still cannot display. I will continue to find to display correctly in every email.

If you guys have the code, please share to me. Thanks in advance

Thursday, December 16, 2010

Introduction of SOA

What is SOA?

• Service Oriented Architecture
SOA = Enterprise Application Integration + Governance
• Abstracts software functionality as loosely-coupled, business-oriented Services
• Business Driven Approach is a key of SOA.
• Application can contain services which implement business process in flexible way without programming.
• IT Architecture style that supports Service Orientation

Service

• Repeatable business task
• Has Service Description
• Can be governed by declarative policies

Service Description

• Used by a service consumer for searching, binding and invocation.
• Used by service provider to deliver the quality of service requirements for service consumer.

Service Orientation

• A way of integration your business as linked service

SOA from Different Point Of View

Business - Capabilities that business wants to expose as a set of services to clients or partner organization.
Architecture - Architecture Style requires service provider, requestor, and service description.
Implementation - Programming Model completes with standard, tools, methods and technologies as Web Services.
Operation - A set of agreement between service provider and service consumer.

Monday, December 6, 2010

SharePoint 2010 Overview

Sharepoint Overview

• SharePoint 2010 is the business collaboration platform for the Enterprise and the Internet.
• When people need to work with other people, with content and information, or with line-of-     business data, they can use the rich, out-of-the-box set of integrated capabilities in the SharePoint 2010 platform.
• People can also customize these capabilities to address specific business needs and integrate them with other products and solutions.
• Using the same set of capabilities and tools, companies can deploy SharePoint 2010 both intranet and internet.


There are three main objectives of using SharePoint 2010. They are.
   o Deliver the best productivity
   o Cut costs with a unified infrastructure
   o Rapidly respond to business


Capabilities Area
SharePoint 2010 helps people work together in new and effective ways with a rich set of six integrated capabilities areas. 

Sites -Provides a single infrastructure for all your business Web sites.

Communities -Delivers great collaboration tools—and a single platform to manage them.

Search -Cuts through the clutter. Find the information and contacts.

Content -Makes Content Management easy. Such as document types, automatic content sorting.

Insight -Gives everyone access to the information in databases, reports, and business applications.

Composite - Offers tools and components for creating do-it-yourself business solutions.


I have just started to learn Sharepoint 2010. This is reference from SharePoint Evaluation Guide.

Thank you.