Represents a user in Microsoft SharePoint Foundation.

learn more… | top users | synonyms

0
votes
1answer
14 views

Compare two SPUser variable

I validate two SPUser values inside if condition. Both SPUser variables have values when my program runs, but when both SPUser values are same my app runs and enter inside if condition. Ideally it ...
2
votes
5answers
5k 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 ...
3
votes
2answers
55 views

Convert this display name to SPUser

How to convert this display name to SPUser type. My input is Sivakumar, Piratheban (ext)(domain\user)
0
votes
1answer
17 views

how to remove user from sharepoint Farm

I want to remove a user from SharePoint from all Web applications in SharePoint Farm. Like the user has never existed! is ti possible? I see there many users that don't exists in AD anymore. But I ...
0
votes
1answer
16 views

No Email in SPUser Object on Site Collection Level?

I am facing the issue that I do not have a value for email in SPUser object on Site Collection level but in Subsites. I tried web.EnsureUser as well, which loads the user correctly (-1# issue) but ...
0
votes
2answers
56 views

How to Get all SharePoint SpUsers from SpFarm with C#

How to get a list of all users in a certain Farm in SharePoint by code? Is there any away to do that without must iterate every SPgroup in every SPWeb in every WEApp?
1
vote
1answer
52 views

Get SPUser by passing Email address

i have an Email address of particular user. Now i want the SP username of that particular email address programatically. Thanks.
0
votes
2answers
74 views

How to give different permission programmatically on Document Library for different group users?

I have document library & 3 groups(AdminGroup,Reviewer,Distributor). I have already give a permission on groups, AdminGroup has Full Control, Reviewer has Reader & Distributor has None : ...
1
vote
1answer
411 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 ...
1
vote
1answer
21 views

Adding users to a Form-based authentication site

I'm using SharePoint Foundation 2013. I have created an Extranet where Active Directory and Form based users could log in (multi mode). I need to add users to this site via a windows service. My ...
1
vote
2answers
492 views

How to remove user from Sharepoint Group using JavaScript?

I want to add and remove user to/from Office 365 Group. I tried using C# code but got error : "User does not exist or is not unique". After searching on the web I can't find solution.So i tried ...
1
vote
2answers
63 views

Bind all users of office 365 except system users using C#

How to bind all the users of Sharepoint(office 365) except system users like : "System Account", "NT AUTHORITY\authenticated users", "_SPOCacheFull", "YLO001_spocrwl_142_11094". I want only ...
0
votes
0answers
230 views

Cannot send Email to Exchange Distribution list

I have this (shortened) piece of code, which does not work like it should and I can not figure out why: SPGroup group = web.SiteGroups["Some Notification Group"]; foreach (SPUser user in group.Users) ...
0
votes
4answers
3k 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!
3
votes
3answers
4k 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 ...
0
votes
1answer
845 views

Get SPUser information

I am trying to get a user's information off of SharePoint. I can see the user's information through the UI when I click their name. I can add them to groups and sites freely. But no matter what I ...
0
votes
1answer
360 views

Remove user from SPFieldUserValueCollection

I have a "person or group" type column in my calendar list as "Participants". I need to add and remove users from this column. Adding users works fine. When trying to remove a user it does not get ...
0
votes
0answers
142 views

Set-SPUser - not valid user object - 19;#username - powershell

I'm trying to add users to a custom "responsible" group that have the same permissions as owners group. I'm getting member from a list in SP (people and group). $Responsible = ...
0
votes
1answer
97 views

Sharepoint 2013 c# customise field data depending on user connected properties

I have some specific need here, and i don't know how to approach it. I explain : I have a SharePoint list to which i am adding a field in feature activated event reciever. I am adding a 3 choices ...
3
votes
3answers
7k 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 ...
3
votes
2answers
7k 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 ...
2
votes
2answers
4k 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 = ...
1
vote
1answer
101 views

Display SPUser Information on an application page

I have an application page (SP2010) where I have a SPUser object (the current user), now I would like to display this SPUser as an Hyperlink on the apsx, linked to his UserProfilePage (userdisp.aspx) ...
0
votes
2answers
101 views

How to get from DirectoryEntry to SPuser

I need to get the SPuser for a partcular directory entry. What I need to do is get all the users from an AD group and give them permissions to a list item. The code is: SearchResult result = ...
1
vote
4answers
5k 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?
1
vote
5answers
606 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 ...
1
vote
5answers
3k views

How do I get SPUser Object?

I'm unable to get SPUsers/user. As an example I have here a User (Approver): <User ID=\"31\" Sid=\"\" Name=\"Approver\" LoginName=\"i:0#.w|domain\\approver\" Email=\"approver@domain.se\" ...
1
vote
2answers
1k 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 ...
1
vote
1answer
942 views

Unable to get user field value in event receiver's afterproperties

I have a document library in which there is one field approver (multi - value). There is an event receiver for item updating of the document library that I want to validate user while changing the ...
2
votes
3answers
1k 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 ...
1
vote
1answer
407 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 ...
1
vote
1answer
1k 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 ...
2
votes
1answer
340 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 ...
0
votes
2answers
224 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 ...
1
vote
1answer
169 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 ...
0
votes
3answers
3k 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]); ...
1
vote
2answers
554 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 ...
3
votes
0answers
903 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 ...
1
vote
1answer
3k 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 ...
5
votes
1answer
1k 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 ...
0
votes
0answers
183 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 ...
1
vote
0answers
245 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 ...
2
votes
2answers
418 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 ...
1
vote
2answers
1k 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.
0
votes
4answers
2k 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 ...
1
vote
1answer
828 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 ...
2
votes
2answers
523 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", ...
1
vote
1answer
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 ...
1
vote
3answers
158 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 ...
1
vote
2answers
2k 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 ...