网站建设资讯

NEWS

网站建设资讯

sharepoint管理 sharepoint

SharePoint.ps1干什么的 可以在C#中调用powershell管理sharepoint2010么

Powershell是微软的新一代脚本,可以理解为用来替代CMD的,微软新版的所有软件,包括Hyper-v,Exchange,2008R2的AD,都是可以通过Powershell管理的,Sharepoint当然也可以。

成都创新互联是一家集成都网站设计、网站建设、网站页面设计、网站优化SEO优化为一体的专业的建站公司,已为成都等多地近百家企业提供网站建设服务。追求良好的浏览体验,以探求精品塑造与理念升华,设计最适合用户的网站页面。 合作只是第一步,服务才是根本,我们始终坚持讲诚信,负责任的原则,为您进行细心、贴心、认真的服务,与众多客户在蓬勃发展的市场环境中,互促共生。

而且Powershell其实就源自C#,很多类直接就是C#改的,甚至就是C#的。

所以你的目标都是可以实现的。

PS1是powershell脚本的后缀,通过可以直接双击或在CMD中运行powershell *.PS1来运行脚本。

不过由于有权限控制,所以需要首先执行下面这个命令,才能使用脚本,否则会报错。

Set-ExecutionPolicy unrestricted

下面是C#调用Powershell脚本的代码示例,网上找的。

/*

* C#调用PowerShell代码示例

*

* 需要引用System.Management.Automantion.dll

*/

using System;

using System.Collections.Generic;

using System.Collections.ObjectModel;

using System.Management.Automation;

using System.Management.Automation.Runspaces;

using System.Text;

namespace ConsoleApplication

{

class Program

{

static void Main(string[] args)

{

string result = RunScript("get-process");

Console.Write(result);

Console.Read();

}

/// summary

/// 运行脚本信息,返回脚本输出

/// /summary

/// param name="scriptText"需要运行的脚本/param

/// returnsoutput of the script/returns

private static string RunScript(string scriptText)

{

// create Powershell runspace

Runspace runspace = RunspaceFactory.CreateRunspace();

// open it

runspace.Open();

// create a pipeline and feed it the script text

Pipeline pipeline = runspace.CreatePipeline();

pipeline.Commands.AddScript(scriptText);

// add an extra command to transform the script output objects into nicely formatted strings

// remove this line to get the actual objects that the script returns. For example, the script

// "Get-Process" returns a collection of System.Diagnostics.Process instances.

pipeline.Commands.Add("Out-String");

// execute the script

Collection results = pipeline.Invoke();

// close the runspace

runspace.Close();

// convert the script result into a single string

StringBuilder stringBuilder = new StringBuilder();

foreach (PSObject obj in results)

{

stringBuilder.AppendLine(obj.ToString());

}

return stringBuilder.ToString();

}

}

}

如何在 SharePoint 管理中心中激活报表服务器功能

在安装了用于 SharePoint 技术的 MicrosoftSQL Server 2008 Reporting Services 外接程序之后,应在 SharePoint 管理中心中配置报表服务器集成设置。若要配置报表服务器集成,请使用管理中心的“应用程序管理”选项卡中的 Reporting Services 页。

如果在“应用程序管理”中看不到 Reporting Services 部分,则要么尚未安装 Reporting Services 外接程序,要么尚未激活报表服务器集成设置。

若要验证是否已安装,请在“添加或删除程序”中查看已安装应用程序的列表。如果 Reporting Services 外接程序已安装,请按照本主题中的说明激活此功能。

默认情况下,为本地 SharePoint Web 应用程序的根网站集激活 Reporting Services 外接程序。如果未启用根站点或在安装 Reporting Services 外接程序时未定义网站集,则必须手动激活报表服务器集成设置。

激活网站集的 Reporting Services 集成

依次单击“开始”、“管理工具”和“SharePoint 3.0 管理中心”。

单击“站点操作”。

单击“站点设置”。

单击“网站集功能”。

在列表中找到“报表服务器集成功能”。

单击“激活”。

没有sharepoint的管理密码怎么迁移

1. 安装完补丁后运行配置向导完成sharepoint的配置。

2. 进入管理中心,开启Excel Caculation Service, Windows sahrepoint service help search, office sharepoint service

search服务.

3. 在SQL Server Enterprise Manager中,还原所有之前备份的SharePoint相关的数据库,除了配置数据库SharePoint_Config和管

理中心数据库SharePoint_AdminContent

4. 通过管理中心新建立web应用程序,并删除所关联的内容数据库

新建 Sharepoint -8080, Sharepoint- 8181, Sharepoint - 8180 应用程序

删除系统自动生成的关联内容数据库,附加上还原好的原内容数据库

5. 还原SSP:

这一步我按照参考链接里的步骤去做是始终会报错:

1) 开始是提示权限不够访问ssp的内容数据库,可能是因为附加过来的,所以sharepoint无法自动添加现有服务器场用户对该内容

数据库的权限。给场用户添加了数据库权限后不在提示这个错误

2) 设置好数据库权限后又会提示“未将对象引用到实例”,可能是我的个人网站HOST有问题吧,只有新建一个个人网站HOST。

设置好了,开始还原,将SSP Service database 和SSP Search database 设置为还原过来的对应数据库。

等待一会,提示成功。


网页题目:sharepoint管理 sharepoint
网页路径:http://cdweb.net/article/doeijjh.html