代码改变世界

备份还原 Sharepoint 2010 站点集 的Powershell脚本

2012-05-28 16:46 by 贾龙江, 276 阅读, 0 推荐, 收藏,
摘要:PowerShell 备份sharepoint站点命令Backup-SPSite-Identity"http://Mysharepoint.com"-Path" C:\Temp\backup1.bak"-ForcePowerShell 将备份文件还原到sharepoint站点命令Restore-SPSite"http://sharepoint.company.com"-PathC:\backup1.bak -Force 阅读全文

Get list.RootFolder by Internal Name using ECMAScript / JavaScript Object Model

2012-03-06 10:41 by 贾龙江, 495 阅读, 0 推荐, 收藏,
摘要:I suppose you mean list.RootFolder.Name as omlin mentioned. It is the nearest thing to internal name which SPListItem has.Why do you need this? Does your site exist in different languages, therefore different titles? The simplest way to provide the right id or title is to register client script from 阅读全文

Querying Document Sets Using SPSiteDataQuery

2012-02-29 09:59 by 贾龙江, 371 阅读, 0 推荐, 收藏,
摘要:In SharePoint 2010, a document set is just what it is shouting at us- a bundle of documents! Agnes (SharePoint MVP) has a nice and short post hereabout how to setup document sets. If you activate a site collection scoped feature called "Document ID Service", document sets, like any other d 阅读全文

The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your...again

2012-02-29 09:55 by 贾龙江, 545 阅读, 0 推荐, 收藏,
摘要:The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your operation again.The above error will be thrown at the time of updating Library or Lists items due to authentication problem, or We didn’t have the rights to update the items.By using the 阅读全文

Create SPFieldLookup programatically

2012-02-29 09:45 by 贾龙江, 468 阅读, 0 推荐, 收藏,
摘要:To read or write values to fields of type SPFieldUser or SPFielLookup is an annoying task because you have to create field value objects bevore you can write your values into a field. The following post descripes how you can encapsulate those tasks to extension methods and slim your code to make it 阅读全文

常用的stsadm命令

2011-07-15 14:59 by 贾龙江, 329 阅读, 0 推荐, 收藏,
摘要:常用的stsadm命令行参数有:1、installfeature、uninstallfeature:feature部署和卸载; 安装feature:stsadm -o installfeature -filename [feature文件夹下]"feature.xml 激活feature:stsadm -o activatefeature -filename [feature路径]"feature.xml -url http://[主机标头]:[端口]/sites/portol -force 特别注意的地方 -url 还有就是:“主机标头”可以不是计算机名,但是有时创建We 阅读全文

收藏一段小的.net下的验证码片段,以供以后参考。

2011-06-03 10:55 by 贾龙江, 323 阅读, 1 推荐, 收藏,
摘要:protected void Page_Load(object sender, EventArgs e){//先产生数字串string checkCode = this.CreateRandomCode(6);//用session保存Session["CheckCode"] = checkCode;//作图CreateImage(checkCode);}private void CreateImage(string checkCode){System.Drawing.Bitmap image = new System.Drawing.Bitmap(Convert.ToInt 阅读全文

用Gmail账户来代替Sharepoint2007邮件配置

2011-06-01 11:34 by 贾龙江, 955 阅读, 1 推荐, 收藏,
摘要:通常如果我们想在sharepoint配置邮件帐户,但又不想用域邮件配置,如我们想用gmail或其他第三方邮件系统来配置sharepoint邮件帐户,我们可以按下面步骤来配置。(当然以下这种配置也支持sharepoint服务器没有在域控制器上的情况)1 创建gmail账户,启动pop3在gmail设置,如图2 安装smtp服务。记得启动service中的对应服务项3 打开iis(如果是windows server 2008,则需要打开iis6),右键SMTP Virtual Server,选择accss(如下图左),再选中Relay...(如下图右)。4 选中delivery,然后选择outbo 阅读全文

打好WEB服务器安全攻坚战(转)

2011-04-12 11:56 by 贾龙江, 742 阅读, 0 推荐, 收藏,
摘要:一、 转换角色,把自己当作可能的攻击者 大部分时候,我们若只是站在WEB管理员的角度上考虑问题,可能就发现不了WEB服务器的漏洞。相反,我们此时若能够换个角度,把自己当作可能的攻击者,从他们的角色出发,想想他们可能会利用那些手段、哪些WEB服务器的漏洞进行攻击,或许,我们就可以发现WEB服务器可能存在的安全漏洞,从而早先一步,修补安全漏洞,防止被木马或者病毒攻击。 从公司外面访问自己的WEB服务器,进行完正的检测,然后模拟攻击自己的网站,看看,会有什么样的结果。这对于WEB的安全性来说,可能是一种很好的方法。如我们可以假当攻击者,利用扫描工具,对WEB服务器进行扫描,看看有否存在可以被攻击的. 阅读全文