sharepoint-2010

Using Sharepoint Word Automation to do a text replace

北城以北 提交于 2019-12-19 11:28:47
问题 I am working with sharepoint 2010, what I am trying to do is take a word document template, do a replace on a few key words (ex: replace ##ClientID## with the id of the client) and save it with a specific name in a library on sharepoint. I have figured out how to do this on a local computer with word interop, however the word interop library is not designed to be run as a service. I then discovered Word Automation Services which appear to do what I need to do. However every example I find on

GroupPrincipal method FindByIdentity throw strange exception

穿精又带淫゛_ 提交于 2019-12-19 10:02:29
问题 I am trying to get all users by group name and dispalay it in sharepoint webpart. adGroupName something like = "CompanyGroup". GroupPrincipal grp = GroupPrincipal.FindByIdentity(ctx, IdentityType.Name, adGroupName); Exception: In order to perform this operation a successful bind must be completed on the connection Why is that and what i am doing wrong? stack trace: at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail) at System.DirectoryServices.DirectoryEntry.Bind() at System

Upload file to SharePoint 2010 using PowerShell and the OData API

…衆ロ難τιáo~ 提交于 2019-12-19 08:51:29
问题 I'm attempting to upload a file to SharePoint 2010: Function Add-Attachments() { [CmdletBinding()] Param( [Parameter(Mandatory=$True)] [int]$Id, [Parameter(Mandatory=$True)] [string[]]$Paths ) BEGIN {} PROCESS { $url = "http://server/resource/_vti_bin/listdata.svc/TheList($Id)/Attachments" Foreach ($Path in $Paths) { Write-Verbose "Attaching $Path ..." $headers = @{ 'Slug' = "TheList|$Id|$(Split-Path $path -Leaf)" } $Payload = @{filename=(Split-Path $path -Leaf);filecontent=([IO.File]:

How to grant user permission to certain folders using Client Object Model?

邮差的信 提交于 2019-12-19 04:48:10
问题 So far I am able to grant user certain permission with the following code: ClientContext context = new ClientContext("http://myRealURL"); Principal user = context.Web.EnsureUser(@"myLoginAccout"); RoleDefinition readDef = context.Web.RoleDefinitions.GetByName("Read"); RoleDefinitionBindingCollection roleDefCollection = new RoleDefinitionBindingCollection(context); roleDefCollection.Add(readDef); RoleAssignment newRoleAssignment = context.Web.RoleAssignments.Add(user, roleDefCollection);

How to grant user permission to certain folders using Client Object Model?

会有一股神秘感。 提交于 2019-12-19 04:47:47
问题 So far I am able to grant user certain permission with the following code: ClientContext context = new ClientContext("http://myRealURL"); Principal user = context.Web.EnsureUser(@"myLoginAccout"); RoleDefinition readDef = context.Web.RoleDefinitions.GetByName("Read"); RoleDefinitionBindingCollection roleDefCollection = new RoleDefinitionBindingCollection(context); roleDefCollection.Add(readDef); RoleAssignment newRoleAssignment = context.Web.RoleAssignments.Add(user, roleDefCollection);

Call powershell script in post-built with parameters

十年热恋 提交于 2019-12-19 02:05:17
问题 I'm trying to get Powershell to run my PS script in post built - but somehow it doesn't work like it's supposed to: Following command in Post-Build: C:\WINDOWS\system32\windowspowershell\1.0\powershell.exe -Command "& $(MSBuildProjectDirectory)\CreateSite.ps1 'auto'" (inserted line break for better reading) The command executes the powershell script sucessfully, but what it can't do is run the commands within (Output from Build): Rund Post-Build Command: Add-PSSnapin : No snap-ins have been

How to give an SPGroup permissions for an SPItem?

删除回忆录丶 提交于 2019-12-18 05:09:07
问题 I tried to find a simple example how to give a certain Sharepoint group X, a permission level Y, for list item Z - but can't find example code. The shortest code I could come up with for assigning a specific user permissions ("Reader" in this case) for the item is the following: SPRoleDefinition spRole = spWeb.RoleDefinitions["Reader"]; SPRoleAssignment roleAssignment= new SPRoleAssignment("//myDomain/myUser", "none@example.org", "Name", "Notes"); roleAssignment.RoleDefinitionBindings.Add

How can I build a SharePoint 2010 package using command line?

限于喜欢 提交于 2019-12-17 16:23:01
问题 I have a Visual Studio 2010 SharePoint project. If I choose 'Package' from the project menu, a .wsp file is generated. How can I invoke the same build from command line (i.e. what /target is required for MSBuild)? 回答1: I got it to work, finally. The tricky part is the fact that the SharePoint targets do not exist when MSBuild loads the .sln file, you have to load the individual .csproj files. set msbuild="C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" set config=Debug set outdir=

how to integrate ofbiz with sharepoint

♀尐吖头ヾ 提交于 2019-12-14 04:14:07
问题 i need help.How to integrate the ofbiz with sharepoint 2010 回答1: There is no direct integration possible with Apache OFBiz and SharePoint. OFBiz is based on JAVA platform that you can run on TomCat or JBOSS, while SharePoint runs on IIS and .NET. You can do some primitive integration by using Portlets and WSRP webparts in SharePoint. I am not sure if OFBiz supports portlets/JSR168 but it is possible to setup WSRP Consumer and Provider and view them using WSRP WebParts. There are also some

Why does my no-submit (HtmlButton) still submit?

耗尽温柔 提交于 2019-12-14 03:17:53
问题 I want to dynamically make rows, which exist all along but are at first hidden, visible. I've tried the client-side (jQuery) route, but have had problems with that. I would prefer going down the server-side (C#) road, and I thought I had found the way to accomplish it based on this thread and this code: HtmlButton btnAddFoapalRow = null; . . . btnAddFoapalRow = new HtmlButton(); btnAddFoapalRow.Attributes["type"] = "button"; btnAddFoapalRow.InnerHtml = "+"; btnAddFoapalRow.ID =