Tag Info

Hot answers tagged

7

You should use SPSite constructor override for this purpose. The code will look something like this: SPUser user = // grab the SPUser object somewhere using (SPSite site = new SPSite("http://localhost", user.UserToken)) { using (SPWeb web = site.OpenWeb()) { // do whatever you need here } } This will work in Foundation, too.


4

SPWeb.Users.GetByEmail() and SPWeb.Users.GetById() is only going to return the users that have logged in to your site. Try the method SPWeb.EnsureUser(). MSDN says the following: Checks whether the specified logon name belongs to a valid user of the website, and if the logon name does not already exist, adds it to the website.


4

Our solution was to go to SP Central Admin > System Settings > Services on Server and start the "Claims to Windows Token Service". We also found this error in the logs which helped lead us to this as the solution: SPSecurityContext.WindowsIdentity: Could not retrieve a valid windows identity for NTName='PRMM-SP\polyadmin', ...


3

customer.Collaboration.Provisioning.SPI.EventReceivers.ProjectProvisioningEventReceiver.ProjectProvisioningEventReceiver.ItemAdded(SPItemEventProperties properties) This means that your ItemAdded Receiver for ProjectProvisioning feature fails. It will report site creation as failed because it rolls back and throws an exception. Take out all custom ...


3

Kerberos and NTLM will not allow this though it could be done via Forms authentication but you would have to write your own provider and install your own "back door" to enable this behavior. It could also possibly be done via Claims authentication. However, doing something like this pretty much violates every security standard out there. I can understand ...


2

I use UserProfile to access this type of data. http://msdn.microsoft.com/en-us/library/microsoft.office.server.userprofiles.userprofile.aspx here's some sample code of using it with people picker private UserProfile GetExistingEmployee(string CurrentWebSiteURL) { UserProfile profile = null; using (SPSite site = new SPSite(CurrentWebSiteURL)) { ...


2

Assuming SP2010 here... As far as I know no one other than a Site Collection Admin can delete a SP Group. I know it says the Group Owner can delete the group in the UI when you create a group, but I think that's either a mis-print or the assumption is the Group Owner will be a Site Collection Owner. If you look at the privileges associated with Full ...


2

This is due to the double-hop issue. You cannot inherit the user credentials all the way to your database by using NTLM. You have several options though: User Kerberos and delegation Impersonation Use specific db-credentials (optionally using the SSO service) Use SQL login instead of Windows login and specify the credentials in the connection string and ...


2

When you impersonate, you need to recreate the SharePoint objects that you are working under the context of the impersonator. For example, if you are impersonating the System User using RunWithElevatedPrivileges, you can use the code below to recreate some of the SharePoint objects that you may need to manipulate: public override void ...


2

The short answer is that Office and SharePoint do not share the same context in IE and thus, do not share the same credentials. All office apps open up a new instance of Internet Explorer internally and then connect to the SharePoint site using that. If the site is such that it can pass windows/domain credentials (i.e. it is listed as in the Intranet Zone) ...


1

Can you try following, I have just kept new SPSite and SPWeb object outside RunWithElevatedPrivileges string siteStr = "http://mywebSiteUrl/"; SPUserToken userToken; SPSecurity.RunWithElevatedPrivileges(delegate() { using (SPSite site = new SPSite(siteStr)) { using (SPWeb web = site.OpenWeb()) { userToken = web.AllUsers[4].UserToken; ...


1

Is this code running on the SharePoint server? If so try using the default SharePoint API and the runwithelevatedpriviledges rather than an impersonator and clientcontext. http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spsecurity.runwithelevatedprivileges.aspx


1

_ Hi Bernd My draft post became over 2 pages, so I decided to cut some details, to get any replies at all. I have tried AllowNtlm = false, but for some reason I get the error message "The remote server did not satisfy the mutual authentication requirement." when I run. In IIS-Manager on the IIS-app I have only "Windows Authentication" and ...


1

You have two main options: Give the AppPool access to the database and run your database code inside SPSecurity.RunWithElevatedPrivileges Use Windows impersonation LogonUser around your database code. See section 3. Using Win32 API in Impersonation in SharePoint : An Extreme Overview. The big question is then where to store the username/password. It can ...


1

I think we found the issue. It is caused by the workflow itself, because the workflow fires on item change and on item create. The item is changed within the worklfow and causes a recursion. I found this article (which is for 2007) which describes it in detail. However, it is strange that it worked sometimes and sometimes not. Maybe a timing issue somewhere. ...


1

Reading Technet and other sources it appears to be a well know issue. The suggestion I can give to who is in my same problem is to implement a Custom Security trimmer: use the token to access file is working, only pass it to the claim is not. So if you do a thing like: Loop with SPRunWithElevatedPrivileges Collect all results Open a Site with User Token ...


1

I believe you've already asked this question: Please see link Get single user from multiple domain problem


1

Either You need to add the yourself (or username you logged in with) to the SSP which hosts Project Web Access, or the SSP is not configured to process the user's account. Try either or both step 1 or 2. Step 1 Add the user to the SSP site with contribute access. Step 2 To enable the SSP to process accounts, run the following stsadm Command. stsadm ...


1

Yes. It's called RunWithElevatedPrivileges. Code in the following delegate will run as the application pool account for your web application - so it should have full rights on the list you're dealing with. string webUrl = ... SPSecurity.RunWithElevatedPrivileges( delegate { using(SPSite secSite = new SPSite(webUrl)) { using(SPWeb ...


1

One can use conditions inside Impersonation steps, but you can't run whole impersonation step under a condition. The only pitfall is the it runs under the identity of the workflow publisher, so whichever account you are using to publish the workflow, it should have necessary rights to performs all the permissions related operations in Impersonation step It ...


1

Asside from logging on as them (which I do not recommend) you could create a test user and assign it the same permissions. I should mention that there are many good free screen sharing tools available now. One of them is SharedView by Microsoft. These will allow you to see the user's exact desktop as you talk with them.


1

It sounds as though need to go into your Business Data Connectivity Service Application, and set the permissions on the object. First, go to Central Administration->Application Management->Manage service applications. Find your Business Data Connectivity service application and go to the Manage page. Select the external content type and go to Set Permissions ...


1

Is your SQL server running on the same server? If not you will run into the double-hop authentication issue and you will need to configure Kerberos. If SQL is on the same box and you have SharePoint configured for Windows Integrated authentication then integrated security should just work - no special configuration required.



Only top voted, non community-wiki answers of a minimum length are eligible