Hot answers tagged people-picker
9
Alex,
This really is one of the more vexing issues of upgrading the branding/master page of a SharePoint site. Please try this solution:
I created a javascript file called entityeditor.ie9fix.js, added the javascript code that will follow, and saved it in /layouts/1033.
In my master page I added
<script type="text/javascript" ...
8
I'm working with my PeopleEditor control this way:
foreach (var loginName in peopleEditor.CommaSeparatedAccounts.Split(';',','))
{
SPUser user = SPContext.Current.Web.EnsureUser(loginName);
// user.LoginName is now returns "domain\login"
}
This code works fine for me.
Update:
Note 1: EnsureUser will add the user to your site (thanks Ivan Padabed ...
6
I havent tried this for claims in SP2010, but in SP2007 this was done for FBA by adding PeoplePickerWildCard element to membership provider in web.config
<PeoplePickerWildcards>
<clear />
<add key="AspNetSqlMembershipProvider" value="%" />
<add key="fbaMembers" value="%" />
</PeoplePickerWildcards>
...
5
I believe you might also be able to use:
SPUtility.ResolvePrincipal(webApp, null, login, SPPrincipalType.User, SPPrincipalSource.All, false);
That said, this is slower than the suggestions using EnsureUser, but does have the benefit of not adding the user to the site, and is a bit more flexible, if you need that sort of thing.
4
Where is your code running? Web part, application page etc?
Regardless, you can probably do something similar to the following
try
{
//first get the SPGroup you want to add users to
SPGroup addToGroup = SPContext.Current.Web.AssociatedVisitorGroup;
//now loop through each entity in your user picker
foreach (PickerEntity entity in ...
4
Here is a plain jQuery example. I can't take credit for it, I believe Marc Anderson came up with it. Just change the column variable with the display name of your column.
var columnName = 'Assignee';
// There's no easy way to find one of these columns; we'll look for the comment with the columnName
var searchText = RegExp("FieldName=\"" + columnName ...
4
To leverage your work, you can use SharePoint jQuery based library to work with your forms and fields:
jPoint - jQuery for SharePoint forms, lists, webparts, and webservices
And then you just do: jP.Form.readForm().MyUserField.val();
4
This is my solution: http://blog.vitalyzhukov.ru/peopleeditorand-internet-explorer-9.aspx (in russian). Translated page by Google translator: http://translate.google.com/translate?sl=ru&tl=en&js=n&prev=_t&hl=en&ie=UTF-8&layout=2&eotf=1&u=http%3A%2F%2Fblog.vitalyzhukov.ru%2Fpeopleeditorand-internet-explorer-9.aspx
4
If you just want to add all users, just add NT AUTHORITY\authenticated users
If you want to add every user individually, you have to get users (maybe as Principals) from AD, and add them to a group in SharePoint.
var principal...
var loginName = @"MYDOMAIN\" + principal.SamAccountName;
var name = principal.DisplayName;
...
4
The client object model uses the standard SharePoint security and don't allow you to run with elevated priviledges.
Who has access to see members of groups are defined at the group and the default is only members can see who are members.
You can change this by going to:
Site Actions -> Site Settings -> People and groups -> Click the Groups header in ...
3
You need to have Use Client Integration Features permission enabled. By default this is enabled for everybody, but your SharePoint permissions were probably customized and this was disabled.
To change this, contact you administrator and ask him to customize permission levels for your group(s).
3
Sounds like you want the PeopleEditor control. If you google around, you'll see some examples of it in use in an aspx page, but the principles are the same, it's just a .NET control.
3
I found a solution for this problem.
below code should be added to ascx file
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<SharePoint:ScriptLink name="clienttemplates.js" runat="server" LoadAfterUI="true" ...
2
you can use only AddFieldAsXml because Multiselect User Field is marked as non-UserCreatable :)
list.fields.AddFieldAsXml(<Field Type="UserMulti" DisplayName="My_User_Field" Required="FALSE" UserSelectionMode="PeopleAndGroups" UserSelectionScope="0" Mult="TRUE" Sortable="FALSE" ID="{7293d78b-f9b3-4cce-b85f-ac499fc4fcf2}")
2
Cast it to an SPFieldUser, or create an SPFieldUser in the first place, and set AllowMultipleValues to true.
2
I would assume that you have some custom CSS in place because this won't happen by default. It's hard to tell from your image, but the People Picker looks like it's not the normal size, so there's something custom. I'd peel back those customizations and layer them back in one step at a time until I found where I was going astray.
2
InfoPath PeoplePicker can i filter to show only People (user profiles only and no SharePoint Groups)
Short answer, no, you can only select users in the profile database.
The People Picker you get in InfoPath 2007 is an ActiveX control there's little option for customization. The selection of people comes from the users in the profile directory so you can't direct or configure it like you can with the browser picker. The two are different beasts so don't ...
2
You have alternative.
You can write your own Custom Claims Provider. Sole purpose would be to provide better People Picker experience. Your custom claim provider would be responsible for searching and People Picker look and feel but at the end it would save resolved entities as default FBA claims.
I did some researching in this direction and I even made ...
2
It took me some time and I lost some hair in process, but I managed to solve this one. And it's so simple that it hurts.
When developing custom claim provider you are overriding method FillSearch. Here you are filling search results with your custom entities. When creating new custom entity just add new key to your EntityData hashtable and call it .... ...
2
AFAIK, the send email activity will try to resolve the string into a principal and get its email address. Please try giving valid user names and check it.
There is also a OTB condition available in SharePoint Designer which checks if provided value is a valid sharepoint user. You may want wrap sending email under that condition.
UPDATE:
I tested that if ...
2
Looks to me like there are some rogue configurations in your web.config. Did you ever set a custom membership/role provider manually or in IIS? Did you ever use FBA?
The error message you're getting looks like there is a custom membership provider set which uses a non-existing (or no longer existing) connectionstring for a local SQL server instance. So when ...
2
Could you just override the style the people/group input field to be taller? I don't think you're going to be able to mimmic the functionality of the people picker easily.
Looking at both 2007 and 2010 person/group fields, you'd just need to apply a height property to the .ms-inputuserfield in your application page CSS to set a height to say 100 px. This ...
2
Sounds like maybe you didn't configure the People Picker Wildcards in the web.config file? (I'll delete my answer if this turns out to not be the case as FBA is VERY finicky about how its configured and it could be a million different things!)
http://msdn.microsoft.com/en-us/library/bb975136.aspx
<PeoplePickerWildcards>
<clear />
<add ...
2
Okay so here it is.
After few hours of banging my head I was able to get this. All you need to do is create a PickerEntity instance and add it to the entities collection of pickerItem to set the values.
peClient = new PickerEntity();
peClient.DisplayText = item["Client"].ToString();
peClient.Key = item["dbo_x002e_Customer_ID"].ToString();
...
2
Finally got this resolved, the issue was with spacing between parameters in setting the peoplepicker-searchadforests property.
I previously was using this:
stsadm -o setproperty -pn peoplepicker-searchadforests -pv "domain:domain.local, domain\username, password" -url http://spserver
I should have been using this:
stsadm -o setproperty -pn ...
2
I use the folowing to create my custom dialog in C#:
Try to override constructor of PickerDialog class
For example:
public class CustomPickerDialog : PickerDialog
{
public CustomPickerDialog()
: base(new SimpleQueryControl(), new TableResultControl(), new CustomPeopleEditor())
{
ArrayList columnDisplayNames = ...
2
The People Picker is populated from the local user data, not directly from AD. The local user data can come from AD (or other stores), but AD isn't ever queried directly.
In the case of Foundation (or equivalent), it's the User Information List. In the case of Server (or equivalent), it's the User Profile store.
2
People Picker is configured to
apply a custom AD filter (you can filter and restrict the results)
limit the search to within a site collection (use onlysearchwithinsitecollection attribute )
limit the search to within an AD Organizational Unit(OU) (Those settings will apply to every site within the site collection)
return only non-AD user accounts (if web ...
1
PeopleQueryControl using SPUtility.SortPrincipalInfo() method:
private static IList SortPrincipalInfo(IEnumerable principals)
{
SortedList list = new SortedList();
foreach (SPPrincipalInfo info in principals)
{
string str = info.LoginName.ToLowerInvariant();
string key = string.Concat(new object[] { info.DisplayName, " ", str, ...
Only top voted, non community-wiki answers of a minimum length are eligible