Questions tagged [spuser]

Represents a user in Microsoft SharePoint Foundation.

14 questions
3
votes
2 answers

How to get SPUser object from SocialProfile in Sharepoint 2010?

How can I get the SPUser object associated to the profile from the SocialProfile in Sharepoint 2010? Thanks
empz
  • 11,509
  • 16
  • 65
  • 106
1
vote
1 answer

Sharepoint SPFx spuser getting addition fields

I'm using the SPFx with React in Typescript and able to get the SPUser, but it only has a couple of fields like displayName, email, and loginName. Is there a way to get the Department of the user? Or do I have to use PNP-JS? Example how I get the…
1
vote
1 answer

Not able to add SPUser as LimitedAccess programatically

I am trying to add a new user in SPWeb with "limited access" as roleDefinition. But it shows error. But if i give "full control", read, design i'm able to add the user. This is my code web.SiteUsers.Add(loginName, string.Empty, displayName,…
john
  • 121
  • 1
  • 3
  • 17
1
vote
1 answer

SPUser equivalency operator

Is there an operator, and if so what, to determine equivalence between two SPUser objects in PowerShell? My instance is looping through a list of sites to replace "domain/John Smith" with "domain/Jane Doe" in a certain site property. It's pulling…
joynoele
  • 393
  • 4
  • 16
1
vote
1 answer

How to tell if SPUser is Active Directory account

I'm working on a project where the client wants to restrict some content to only Active Directory users . Is there any way to identify that a SPUser is an AD user short of parsing the username string for the domain (or something along those lines).…
Jordan C.
  • 54
  • 7
1
vote
1 answer

SPuser to find group membership

I have a code in which I have to check if a user is a part of a certain group (lets say "GroupA"). I have the user details stored in the Sharepoint variable SPUser. Now I need to check if this user is a part of GroupA and then take some action. How…
user1534235
  • 161
  • 3
  • 16
0
votes
2 answers

Restrict users to view a particular page in sharepoint

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 of them can make any changes in page2.aspx. Now this…
John
  • 81
  • 1
  • 1
  • 10
0
votes
1 answer

Adding Collection of SPUsers into SPGroup

We can add an SPUser into an SPGroup by objSPGroup.Users.Add(objSPUser). I need to add SPUserCollection into one SPGroup. How can i do it?
john
  • 121
  • 1
  • 3
  • 17
0
votes
1 answer

Getting RoleCollection as a string

We can get the roles of an SPUser by SPUser.Roles. But it will return SPRoleCollection. If we want to list all the roles we need to loop that. For example an User has "Full Control","Read","Design" we need to loop the SPRoleCollection object. How…
john
  • 121
  • 1
  • 3
  • 17
0
votes
1 answer

How to get spuser by loginname without using SPWeb.EnsureUser()

I want to retrieve a SPUser object by Login Name in C#. In my program, I got a DataTable from the SPListItemCollection and trying to get a SPUser Object in a foreach loop. Here is the code snippet which shows how I am trying to get the…
MRWonderFuXker
  • 203
  • 3
  • 19
0
votes
1 answer

SPFieldUserValue and SharePoint Metadata

I am using SPFieldUserValue to fetch the users from sharepoint list which is having person column. But my metadata service is facing some problem and it is showing error in navigation of my sharepoint site as - "The Managed Metadata Service or…
Kalpesh
  • 149
  • 1
  • 2
  • 13
0
votes
2 answers

How can I list all SPUser objects in a SPGroup?

I need to retrieve all SPUser's from a SPGroup. Unfortunately, the group may contain Active Directory groups, so a simple SPGroup.Users is not enough (I'd just get a single SPUser for the AD group, with the IsDomainGroup property set to true). Does…
skolima
  • 31,963
  • 27
  • 115
  • 151
0
votes
1 answer

Get Sharepoint current userKey with Javascript

I have been trying to get current users key value with many different ways, but none of them has worked as I wanted. I need to get current SPUser key (i:0#.w|dev\user) to compare with the key on table. Closest thing I have at the moment is this…
Taurib
  • 451
  • 9
  • 26
0
votes
1 answer

how to match between a user in asp.net and a user in sharepoint

i need a asp.net function that takes username and password and a sharepoint link and return true if the username and password match a user in sharepoint i try make an object from spuser and check login name but still need to check user password but…