注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

忘忧草的博客

品味人生--精通IT管理和技术

 
 
 

日志

 
 
 
 

sharepoint的常规操作  

2012-05-30 16:42:50|  分类: Moss2010 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

文章来之:http://www.fivenumber.com

Creating site collection 
static void Main(string[] args)    {       AdminService.Admin admService = new AdminService.Admin();    admService.Credentials = System.Net.CredentialCache.DefaultCredentials;    try   {    admService.CreateSite("http://fivenumber:5/sites/someothername", "SomeotherTitle", "SomeotherDescription", 1033, "STS#0", "Fivenumber\\g.vijaikumar", "GVijaiKumar", "g.vijaikumar@fivenumber.com", "", "");    Console.WriteLine("Site Collection Created:");    }    catch (System.Web.Services.Protocols.SoapException ex)    {    Console.WriteLine(ex);    }       Console.WriteLine("Press any key to continue.....");    Console.ReadLine();    }  

 

Deleting site collection

static void Main(string[] args)    {       AdminService.Admin admService = new AdminService.Admin();    admService.Credentials = System.Net.CredentialCache.DefaultCredentials;    try   {    admService.DeleteSite("http://fivenumber:5/sites/someothername");    }    catch (Exception ex)    {    Console.WriteLine(ex);    }    }  

Creating List  view plaincopy to clipboardprint? static void Main(string[] args)    {       List50.Lists listService = new List50.Lists();    listService.Credentials = System.Net.CredentialCache.DefaultCredentials;    try   {    XmlNode ndList = listService.AddList("List_Name", "List_Description", 100);    Console.WriteLine("List Created:");    }    catch (Exception ex)    {    Console.WriteLine(ex);    }    }  
 
Deleting List  view plaincopy to clipboardprint? static void Main(string[] args)    {       List50.Lists listService = new List50.Lists();    listService.Credentials = System.Net.CredentialCache.DefaultCredentials;    try   {    listService.DeleteList("List_Name");//, "List_Description", 100);    Console.WriteLine("List Deleted:");    }    catch (Exception ex)    {    Console.WriteLine(ex);    }    }  

Read sharepoint version
using (SPSite site = new SPSite(“<Central Administration Site URL…..>”)) { SPFarm farm = site.WebApplication.Farm; Console.WriteLine(SPWebService.ContentService.Farm.BuildVersion.ToString()); } Console.WriteLine(“Press any key to continue…..”); Console.ReadLine(); 

Add property in SPFarm level
image

View SPFarm property
image
 

Modify property in SPFarm level

image

 

Delete property in SPFarm level

image

 

Add property in SPWebApplication level

image

 

View SPWebApplication property

image

 

Modify property in SPWebApplication level

image

 

Delete property in SPWebApplication level

image

 

Add/retrieve SPSite property

image

 

Add/retrieve SPWeb property

image

  评论这张
 
阅读(336)| 评论(0)
推荐

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017