Questions tagged [spuser]

Represents a user in Microsoft SharePoint Foundation.

Filter by
Sorted by
Tagged with
3 votes
4 answers
4k views

How to know SPUser.LoginName is System Account?

I am trying get the Modified By column value. And I want to check my PeoplePicker control contains the value same as the Modified By column value. I am stuck in the problem that Modified By column'...
Rahul Gokani's user avatar
  • 1,074
1 vote
1 answer
2k views

Check user read access to a particular list item

I need to check if a user has read level access to a particular list Item. What would be the best approach 1) listItem.DoesUserHavePermissions(currentUser, SPBasePermissions.ViewListItems); //here ...
Shaamil's user avatar
  • 708
1 vote
1 answer
4k views

SPFieldUserValue User is null

I have a list in which I can also view the version of each item. Suppose I have an item ItemX which has been modified by UserX, I then delete UserX and try to view the version item of ItemX which had ...
ceee's user avatar
  • 23
3 votes
1 answer
1k views

Force create SPUser for disabled AD account

I am trying to get SharePoint to create an SPUser for a disabled active directory account. The reason for this is that I am archiving items across site collections. As the items are copied I am ...
LukeP's user avatar
  • 299
1 vote
1 answer
338 views

Save conflict error when handling user deletion from group programmatically

I have a site in which unique permission group are there. I want to update the list item as per the changes made in the user group in site, i.e. if user is removed from the site user group then the ...
users1100's user avatar
  • 3,230
0 votes
3 answers
10k views

Unable to cast object of type 'System.String' to type 'Microsoft.SharePoint.SPFieldUserValue'

I want to get the user value from the Person or Group column in code behind. My code is: List<string> manager = GeneralMethods.GetUsers((SPFieldUserValueCollection)item[FieldNames.Manager]); ...
users1100's user avatar
  • 3,230
0 votes
2 answers
816 views

SPUser have logon into Site Collection?

Possible to loop through all Site Collection Users and check if they have ever logon into the Site Collection and when? db table dbo.UserInfo tokens info can be useful? this script can retrieve the ...
fallout's user avatar
  • 1,015
1 vote
2 answers
1k views

spfielduservaluecollection.remove not working

I want to remove the user from the list item from the column of type person or group and it is multi-valued. My code is: private void DeleteUserFromList(SPUser userDeleted, string fieldName,...
users1100's user avatar
  • 3,230
0 votes
0 answers
472 views

Getting a SPUser's title (as it is on Active Directory)

I need to get the Titles (eg: Mr, Mrs, Dr) for SPUsers which are stored in a list. The Title is not available on the SPUser object, is it possible to somehow get this information, assuming it is ...
Mahendran Govender's user avatar
3 votes
4 answers
19k views

How to know the exact loginname of the user who operates as system account?

If current logged user operates as "System Account", SPContext.Current.Web.CurrentUser.LoginName will return "sharepoint\system", so I want to know the exact loginname of the user. Here is what I ...
Xiaodan Mao's user avatar
1 vote
0 answers
409 views

Get manager of current user in workflow

how can I get the current user's manager's phone information. I select the current user id like this: public Guid workflowId = default(System.Guid); public SPWorkflowActivationProperties ...
sultannur can's user avatar
2 votes
2 answers
979 views

Get all SPUser groups?

I have a SPUser and I want to get all the user groups in which the SPUser exists. How can i get all the SPGroups containing the SPUser programatically?. Sample codes and useful links would be very ...
anantharengan's user avatar
5 votes
5 answers
20k views

Error in Web.EnsureUser(user) :- User Not Found

Hey Friends I am trying to develop a web part in that I am fetching the user name. But doing this I am getting the error that User cannot be found. But the main thing is that in the line where I ...
Rahul Gokani's user avatar
  • 1,074
1 vote
1 answer
851 views

How to set a UserMulti field via a UserField Control?

I have a list similar to the usual Tasks Sharepoint List and I introduced the field assigned to as a multi user field like this (I have read somewhere that with Mult option should always be set to ...
Glolita's user avatar
  • 419
1 vote
2 answers
4k views

Getting SPUser Last login date / time

Is there a way to get the last login time from an SPUser object? I don't want the last login time to Active Directory, but specifically for the sharepoint site.
BlueBird's user avatar
  • 1,850
1 vote
6 answers
6k views

How to check if the current user is equal to some spuser?

I am using sp2010. I get the current user from the context. And I would like to check if it is equal to the creator of an list item. But the code says it is not equal. Why? Is there some other ...
Ola's user avatar
  • 4,405
2 votes
2 answers
3k views

Email property is empty on SPUser object, how to fill?

I have a piece of code which gets the email address of a SPUser object. The email property is empty. Where I can fill the email address of this user? Is it in SharePoint or somewhere in AD? I dont ...
Ola's user avatar
  • 4,405
1 vote
1 answer
7k views

How to check if current user is exist in a AD group inside a Sharepoint group

I have a sharepoint permission group with some permissionslevels. The name is: "SPProgress". Inside this group I have inserted a AD usergroup with the name "ADProgress". I would like to check in ...
Ola's user avatar
  • 4,405
2 votes
2 answers
855 views

Is possible to rename a SPUser(IsDomainGroup) LoginName?

I want to rename SPPrincipals that are ADGroups. I've tried with $SPFarm = Get-SPFarm #$SPFarm.MigrateGroup("loginName", "newLoginName") $SPFarm.MigrateUserAccount("loginName", "newLoginName", $...
fallout's user avatar
  • 1,015
1 vote
3 answers
265 views

Adding members to groups i am not a member of

I have a process which runs in a event receiver, this involves adding users from ad to groups based on the contents of a custom list. The problem occurs when i try to add a user into a group that i ...
user1786107's user avatar
1 vote
2 answers
3k views

SPUserCollection class

So I created a custom list with a person field. The person field has multiple names of people. What I want to do is get an Item' [person field] data and put it into a SPUserCollection, I tried to do ...
will's user avatar
  • 329
4 votes
0 answers
1k views

How to get SPUser from FBA login name

I have a Form Based Authentication login name login_name how to get an SPUser object for that login name. I have tried the Web.EnsureUser(string.Format("c:0-.f|role|{0}", name)); but it gives me ...
Nitin Chhajer's user avatar
1 vote
1 answer
608 views

How to find permission level date(Last Modifed or Created) for a user and group?

How to find permission level date(Last Modifed or Created) which applying permission level for a user and group?
Hitesh Chandegara's user avatar
3 votes
4 answers
15k views

How to find permission level for specific user using visual studio?

How to find permission level for specific user in site collection and subsite using visual studio?
Hitesh Chandegara's user avatar
0 votes
2 answers
4k views

How to get extra User properties?

A few custom properties have been added to the user object via CA. I would I retrieve these fields programmatically? Solution: UserProfileManager mgr = new UserProfileManager(SpServiceContext....
user13186's user avatar
  • 886
1 vote
1 answer
2k views

Set-SPUser not adding SPUser

Adding a user trough the following PS command line works just fine: Set-SPUser -Identity "Domain\LoginName" -Web $Web.Url -Group "GroupName" The problem occurs when the user is deleted and then the ...
fallout's user avatar
  • 1,015
3 votes
2 answers
8k views

Trying to get user's manager: Getting SPServiceContext with SiteSubscriptionId of {00000000-0000-0000-0000-000000000000}

I am trying to get a user's manager with this code: SPSecurity.RunWithElevatedPriviliges(delegate { SPSite site = new SPSite(SPContext.Current.Site.Url); SPServiceContext context = ...
Jeremy's user avatar
  • 313
1 vote
4 answers
4k views

How to programatically change the login name of an SPUser

I'm facing a problem with Sharepoint as I must change the Login name of my users. I'm in a claim based installation and I decide to use GUID as unique identifier. By Sharepoint PowerShell I found how ...
Ziba Leah's user avatar
  • 1,987
0 votes
1 answer
2k views

Find SPUser Preferred Name from UserPrincipal

I am looping through a group of UserPrincipal that was retrieved from Active Directory. I need to get find a SPUser using the properties of the UserPrincipal. Once the SPUser is found I will get its ...
Jonathan Eckman's user avatar
2 votes
3 answers
7k views

How to get claims from SPUser object

Is it possible to read claims by using the SPUser object only? STS is used as claimsprovider. All examples I have found use: var claimsPrincipal = Page.User as IClaimsPrincipal; claimsIdentity = (...
moregardh's user avatar
0 votes
1 answer
257 views

How can I return user-values as a SPUser (Hyperlink) in a visual webpart in C#?

I'm developing a visual webpart (TreeView). If I click on a node (folder), it gives me the credentials of the folder. Now, the values are all appearing in a label. How can I return the users and ...
grekko's user avatar
  • 47
1 vote
4 answers
26k views

How do I restrict access to a particular page in SharePoint?

I want two pages from my site to be restricted from viewers until its contents are thoroughly checked by my team. How do I accomplish this? Thank you very much!
Juliana Marie's user avatar
1 vote
2 answers
921 views

Sort SPList on derived value of e.g. SPFieldUser column

What I want to achieve is: get a bunch of SPListItems from an SPList, using SPQuery, and have the items ordered by an SPFieldUser column. Just referencing the SPFieldUser column appears to sort on the ...
claesv's user avatar
  • 305
3 votes
2 answers
13k views

Determine if SPPrincipal is SPUser, SPGroup or AD User

Context I have a List<SPPrincipal> that is a mix of SPGroup, SPUser and AD Users. Problem I'm trying to find out how to determine if an SPPrincipal I have is an SPUser, SPGroup or an AD user....
user avatar
12 votes
4 answers
10k views

What is the best way to determine if CurrentUser is System Account?

Traditionally I use: if (web.CurrentUser.Name == "System Account") Is there a possibility the System Account Name could be something other then "System Account". Is there a more reliable way to ...
Meyer Denney's user avatar
  • 2,864
4 votes
2 answers
13k views

Get User Profile from email address

I was using SPUtility.ResolvePrincipal to resolve the email address but it only seems to work if the user is already in the User Information List. Is there any way I can resolve users based on email ...
James Grizzle's user avatar
1 vote
2 answers
973 views

EnsureUser not working in Job

Background: sharepoint 2010 custom membership provider custom job to create users Job is deployed by code and executed first time from some WinForms exe, executed by local Administrator. Users are ...
Francois's user avatar
  • 119
5 votes
6 answers
1k views

SharePoint 2007 : How to sign out user?

I've an application build on SharePoint 2007 platform, the problem is in Mozilla FireFox, the sign out button does not successfully sign out the current login user, I believe SharePoint 2007 is not ...
sams5817's user avatar
  • 423
1 vote
1 answer
2k views

SPUser vs. UserProfile vs My Settings

I've been working woth FBA now, and my site uses both windows login and FBA login. They both work fine, and I've setup a MySite successfully to view profiles, and setup content sites for either kind ...
SatBav's user avatar
  • 61
0 votes
2 answers
4k views

Error using SPContext.Current.Web.AllUsers in Visual Studio workflow

I have the following code running in a Visual Studio workflow. I am trying to specify the user who is adding list items in the code because I guess the system account (default for VS) will not allow ...
Steve W's user avatar
  • 33
2 votes
3 answers
17k views

How to convert string into SPUser?

I have a string "System Account", how can I convert the string into SPUser? I've tried SPContext.Current.Web.EnsureUser("System Account") and also web.AllUser["System Account"] but hit error. Please ...
sams5817's user avatar
  • 423
0 votes
2 answers
1k views

How to grant permission to use specific Application Page in SharePoint

I have custom application page, now what I want to do, is to allow users ( or SPGroup ) to view and use application page. How this should be done ? Currently only administrator can view application ...
Michael's user avatar
  • 407
-2 votes
2 answers
2k views

Ensure User from multiple domain for user that has never access to sharepoint

This is my situation. I have a farm in which an instance of Sharepoint Foundation is installed.. Windows Server is configure to accept users from 3 trusted domain (xxx, yyy and zzz) Suppose i have ...
Ziba Leah's user avatar
  • 1,987
3 votes
6 answers
2k views

Logged in user name in SharePoint 2010

I am trying to retrieve the display name('firstname lastname') of a user who logs in the SharePoint site. When I log into my SharePoint site I could see at the top right --'domain/user name'. So when ...
SandeshR's user avatar
  • 1,992
1 vote
5 answers
1k views

Restrict full control user to view a particular page

I have a sharepoint site http://spp/sitepages/page2.aspx I have a group called "Group1" with full control. There are two users "User1" and "User2". So both the users will have full control and both ...
John's user avatar
  • 41
2 votes
2 answers
3k views

Adding SPUsers to SPGroups programmatically changes User ID

In a SharePoint Online (Office 365) environment we created a Sandboxed WebPart to put SPUsers in SPGroups. The SPGroup is created on rootlevel and has been given permissions on a subsite. This Subsite ...
Cas van Iersel's user avatar
0 votes
1 answer
920 views

How to create a SPUser object from its XML representation

I have the following XML representation for a user: <pc:Person xmlns:pc="http://schemas.microsoft.com/office/infopath/2007/PartnerControls"> <pc:DisplayName>John Dodo</pc:...
JohnDoDo's user avatar
  • 1,169
5 votes
1 answer
2k views

How to remove "orphaned" users from a site collection?

We recently performed a domain migration where we migrated several forests and domains into a single domain. From speaking to the AD admins, this was done using a tool from Quest and it maintained SID ...
shufler's user avatar
  • 1,603
2 votes
1 answer
3k views

Get all users from active directory to sharepoint

I have to populate my autocomplete PeopleEditor-like control based on brililant ASPTokenInput with all people from my AD domain. Reflecting PeopleEditor shows a real mess in their Active Directory ...
Bassist's user avatar
  • 41
0 votes
2 answers
1k views

Inherit field editor control from SPUserField

I need to implement AutoComplete feature for People Editor in custom field type derived from SPUserField. To do this, I have to customize both render template and field editor control (and other ...
Bassist's user avatar
  • 41