Posts Tagged site

SharePoint 2013: Hide Newsfeed / SkyDrive / Site Link

Scenario:

We need to hide Newsfeed / SkyDrive / Site link from the right top of the page.

Resolution:

Add the following CSS class in the style sheet of master page and we are done

.ms-core-suiteLinkList {

display:none;

}

Advertisements

Comments (1)

MOSS 2007: Enabling Anonymous Access

Steps are: 

  • Central Administration -> Application Management -> Authentication Providers (under “Application Security” heading)
  • Select the web application and click on “Default” zone.
  • Check “Enable anonymous access”
  • Move to the site on which you want to enable anonymous access.
  • Site Action -> Site Settings -> Advance Permissions -> Settings – > Anonymous access
  • Select the desired option.

Leave a Comment

SharePoint / MOSS: Creating Site Programmatically

I was interested in creating MOSS 2007 site using code. I end up with the following code:

 

SPSite oSiteCollection = new SPSite(http://servername/SiteDirectory”);            

SPWeb oWebSite = oSiteCollection.OpenWeb();

SPWebCollection oSitesCollection = oWebSite.Webs;

SPWeb newWebSite = oSitesCollection.Add(“abc”, “Document Library                 Template”, “This is site created through code.”, 1033, “STS#2”, true, false);

 

We will only explore SPWebCollection Add Method. The Add method has following parameters:

 

strWebUrl:

 

A string that contains the new Web site URL relative to the root Web site in the site collection. For example, to create a Web site at http://MyServer/sites/MySiteCollection/MyNewWebsite, specify MyNewWebsite, or to create a Web site one level lower at http://MyServer/sites/MySiteCollection/Website/MyNewWebsite, specify Website/MyNewWebsite.

 

strTitle

 

A string that contains the title.

 

strDescription

 

A string that contains the description.

 

nLCID

 

An unsigned 32-bit integer that specifies the locale ID. You can find a complete list of local ID at the following URL:

 

http://www.microsoft.com/globaldev/reference/lcid-all.mspx

 

We have used “1033” for English – United States.

 

strWebTemplate

 

A string that contains the name of the site definition configuration or site template. The following table shows the values for the default site definition configurations that are included in an installation of Windows SharePoint Services

 

Value

Site Definition

STS#0

Team Site

STS#1

Blank Site

STS#2

Document Workspace

MPS#0

Basic Meeting Workspace

MPS#1

Blank Meeting Workspace

MPS#2

Decision Meeting Workspace

MPS#3

Social Meeting Workspace

MPS#4

Multipage Meeting Workspace

WIKI#0

Wiki

BLOG#0

Blog

 

For more MOSS/WSS SiteTemplate codes, visit the following URLs:

 

http://mystepstones.wordpress.com/2008/02/14/sitetemplate-codes/

 

http://stevenjohnevans.co.uk/blogs/dotnet/archive/2007/11/25/standard-site-definitions-within-sharepoint-2007-moss.aspx

 

useUniquePermissions

 

true to create a subsite that does not inherit permissions from another site; otherwise, false.

 

bConvertIfThere

 

true to convert an existing folder of the same name to a SharePoint site. false to throw an exception that indicates that a URL path with the specified site name already exists.

   

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spwebcollection.aspx

Comments (6)

MOSS: Send email to all site users

The trick is simple with one prerequisite. The prerequisite is that one ocument library should exist which can be access by all users of the site.

Upload and open or open an existing MS Word Document. It will have Shared Workspace on the left of the screen. If not, click on “Shared Workspace” under “Tools” menu. “Shared Workspace” select “Members” tab and it has option “Send an email to all members…”. Click on it and get email address of all the users of the site.

Leave a Comment

MOSS:Back up and Restore Site Collection / Sites Using STSADM Utility Export / Import

STSADM.EXE utility export and import operations are used to backup and restore site collections and sites. These operations are limited to site collections and sites only.  

STSADM.EXE is usually located at “C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN”. No GUI interface for the STSADM utility is available. The old and trusted command line is used for the utility. 

The backup contains library content, list content, navigation, user information, security settings, personalize settings like views and content types and customization but does not contain alerts, workflows and properties.  

BACKUP 

For backup, we use export operation which has the following syntax: 

stsadm -o export 

-url <URL name>

-filename <export file name>

[-overwrite]

[-includeusersecurity]

[-haltonwarning]

[-haltonfatalerror]

[-nologfile]

[-versions] <1-4>

[-cabsize] <integer value>

[-nofilecompression]

[-quiet] 

Parameter Description
url URL of the site collection / site
filename Name of the backup file
overwrite Overwrite the already existed backup file
includeusersecurity Maintain the security settings
haltonwarning Stop the export operation when a warning occur
haltonfatalerror Stop the export operation when an error occur
nologfile No log file will be generated at the end of the export operation.
versions Values ranges from 1 to 41-          Default value, last major versions of the files and list items included.2-          The current version, either the major or the last minor version included.3-           Last major and last minor version of the files and list items included.4-          All versions of the files and list items included.
cabsize Value ranges from 1 to 1024. set the total size of cabinet file. Once  size limit is reached, another cabinet file is created.
nofilecompression Disable file compression. If compression is allowed, export operation can increase by 30%
quiet Export operation information will not be displayed and operation will end with success message.

The command that I use to run is  

stsadm –o export –url htpp://URL –filename E:\backup\test.cab –includeusersecurity –versions 4 –cabsize 1024 –nofilecompression  

This command will create a directory test.cab. 

RESTORE 

First you have to create an empty website to restore. This can be done using Microsoft Office SharePoint Designer 2007.

For this, open Microsoft Office SharePoint Designer 2007 and move from File menu to New and click on Web Site. In the New Dialog box, select Web Site tab, then select General and then Empty Web Site. Give the desired URL  in the text box at the bottom of the dialog box and click OK. Microsoft Office SharePoint Designer 2007 will create a new empty web site.  

To restore, we use import operation which has the following syntax: 

stsadm -o import

-url <URL name>

-filename <import file name>

[-includeusersecurity]

[-haltonwarning]

[-haltonfatalerror]

[-nologfile]

[-updateversions] <1-3>

[-nofilecompression]

[-quiet] 

Parameter Description
url URL of the site
filename Name of the restore file
includeusersecurity Maintain the security settings
haltonwarning Stop the export operation when a warning occur
haltonfatalerror Stop the export operation when an error occur
nologfile No log file will be generated at the end of the export operation.
updatversions Values ranges from 1 to 31       Default value, will add new version to the current file.2        Overwrite the file and all of its versions.3       Ignore the file if it exists of the destination.
nofilecompression Either enables or disables file compression in the import package. The import package is stored in the folder specified by the -filename parameter. It is recommended to use this parameter for performance reasons. If compression is enabled, it can increase the import process by approximately 30%.
quiet Export operation information will not be displayed and operation will end with success message.

The command that I use to run is  

stsadm –o import –url htpp://URL –filename E:\backup\test.cab –includeusersecurity –updateversions 3  –nofilecompression  

Exception: 

Error occurred while exporting the web http://site URL

Access is denied.(Eception from RESULT:0x8007005(E_ACCESSDENIED)) 

Reason: 

You are not the administrator of the site collection. 

Resolution: 

Add yourself as site administrator. For this, open SharePoint Central Administration. Move from “Application Management” to “Site collection administrators” under  “SharePoint Site Management”. Add yourself as administrator in the appropriate site collection. 

 

http://office.microsoft.com/download/afile.aspx?AssetID=AM102424831033

 

http://technet2.microsoft.com/Office/en-us/library/1178aa35-20b1-45b0-bcb6-4249aa34ea481033.mspx?mfr=true

 

http://technet2.microsoft.com/Office/en-us/library/65788bb9-0345-42c8-a216-e99e558b173d1033.mspx?mfr=true

 

 

Comments (14)