.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How can I get a user list based on a specific profile property.

Posted By:      Posted Date: September 04, 2010    Points: 0   Category :ASP.Net
Hi,I am trying to query a DB and get a list of users based on a specific boolean property stored in the aspnet_profile for that user.I am aware that it wasn't possible a few years ago (http://forums.asp.net/p/988051/1277359.aspx), but was wondering whether that had changed in recent releases, or it was still not possible without trawling through the entire list of users and testing them one by one.  (My DB may become way to big for that.)Thanks in advance for any help.Regards,Ben

View Complete Post

More Related Resource Links

set the Report URL property to a specific report dynamically based on the selection in the list.

Hi I want to use  embedding the Report Viewer Web Part in a Web page, and I know we  should set the Report URL property to a specific report. but  is there a way by which we can set the url  dynamically based on the selection of the report  from  the list How can I customize this  feature Any Help on this is appreciated. Thanks

User Alert Management for a specific list versus entire SharePoint site?

It seems that to be able to manage User Alerts, one must have Full Access to the entire SharePoint site - and then use => Site Settings > User Alerts. Ideally, I would like to be able to grant access to users to only be able to manage alerts for a specific list. Is this possible (without having to do any programming) and, if so, how? If such access is only available at the site level, I will simply create a Permission Level that allows one to only "Manage Alerts" Thanks in advance for any assistance. Dave

Redirect to specific page based on user Roles

I am using Formsauthentication. My situation is as per below:the login form has codebehind :==============================protected void LoginButton_Click(object sender, EventArgs e)        {            TextBox uname = Login1.FindControl("UserName") as TextBox;            TextBox pass = Login1.FindControl("Password") as TextBox;            CheckBox rm = Login1.FindControl("RememberMe") as CheckBox;            Literal fail = Login1.FindControl("Literal1") as Literal;            if (Membership.ValidateUser(uname.Text, pass.Text))            {                /                FormsAuthentication.SetAuthCookie(uname.Text, rm.Checked);                            }        &

User Profile Property creation


I have inadvertently deleted the user profile property SPS-PhoneticDisplayName which means that users now get an error when trying to view their profile as the page tries to use this field. With cutom errors turned off in the web config file the message states  that the property must be created by an administrator using the profile administration tool.

When I try to re-create the property I get the following error Invalid Property name. Please enter a property name that matches the specification of URI schema name (RFC2396), which must begin with a letter, and must contain only letters, digits, and the characters ".", "+", or "-".

The property name appears to meet these requirements but it still fails. (if I remove the '-' from the name the property is created)

anyone know how I can recover the SPS-PhoneticDisplayName property?

How can I filter a Sharepoint 2007 libarry list based on current user login?


Hi all.

I would like to know how I can filter a SharePoint library list based on current user login.

Suppose I have created the followings:

1) A SharePoint form library containing bunch of uploaded InfoPath form data.

2) The InfoPath form template contains a promoted text field called "TargetUser" to store user domain login (ex: DOMAIN\JOE) and every InfoPath form file in the library has a valid domain name stored in the "TargetUser" field.

I have created a custom view for the form library and would like to filter this view so only items whose "TargetUser" field matches current user's login ID are displayed.

I went to Edit View page to customize the view and tried to use the [Me] function but I got a "Filter value is not a valid text string" message instead when clicking OK. Apparently [Me] returns a Person/Group data type and the filter cannot compare its value to that of "TargetUser".

I tried using text functions (ex: TEXT([Me],"") hoping to extract default string value from [Me]. The filter accepts the parameter without any error but the resulting fitlered list does not display any items at all.

I have googled this subject for hours but I have not found any solution.

It would be greatly appreciated if anyone can help me t

Add User Profile Property -- missing AD attribute


I am trying to add a user profile property, when I tried to map this field to a AD attribute, I realized not all the attributes are exposed. Is there anything I might be missing in SP, or something I have to setup in AD?

Please advice, your help would be greatly appreciated.

Adding back deleted User Profile Property


I've made a bit of an error. My SharePoint User Synchroniztion was all setup and working with My Sites and My Profile but the address was being duplicated. I removed one of the user profile properties under the contact collection. Now SharePoint can't render the My Profile pages. With logging turned up I get the following:

Unhandled exception caught during execution of Microsoft.SharePoint.Portal.PageBase::ErrorHandler()

Watson bucket parameters: SharePoint Server 2010, ULSException14, 06d8f9f3 "sharepoint portal server", 0e00129b "14.0.4763.0", b2be5063 "microsoft.office.server.userprofiles", 0e001294 "14.0.4756.0", 4b9b2905 "sat mar 13 05:56:21 2010", 0000082d "0000082d", 00000049 "00000049", 10bc7a81 "propertynotdefinedexception", 37706d61 "7pma"

Microsoft.Office.Server.UserProfiles.PropertyNotDefinedException: Property Not Defined: SPS-Location.  An administrator must create this property in the Profile Administration tool.    at

Problem is if I try to recreate a User Property with the name SPS-Location it won't let me so how do I get this back?



sharepoint 2010 user information list custom property



i added a custom property to the user list and wish to display it. when i go to "user info list" > "list settings" > "edit view" i see 39 properties to choose from. how can i remove these default values and add my own properties to the view.




How to hide the list column based on user login in SharePoint 2007

Hi, I have two different SharePoint group named 'Sales' group and 'HR' group. In a SharePoint list i have 10 columns. out of it i want to display 8 column for 'Sales' group and to show all the column for 'HR' group. I want to do this base on the user login. How can i achieve this?. Am using SharePoint 2007.

Programmatically adding user profile properties fails when adding a multivalued property


I have written a console application that adds a custom section to the User Profile Properties and then adds properties under that section. The code works fine when adding CoreProperties of type string (Single Value) and mapping each property to an Active Directory field. However the code always fails when mapping a string (Multi Value) property to an AD property. I have researched the errors I present below but cannot see what the solution might be.


    private static void AddCustomProperties(string strUrl)
      Console.WriteLine("Adding custom properties under section '" + DisplayName + "'.......");
      using (SPSite siteColl = new SPSite(strUrl))

        SPServiceContext serviceContext = SPServiceContext.GetContext(siteColl);
        UserProfileConfigManager upcm = new UserProfileConfigManager(serviceContext);
        CorePropertyManager cpm = upcm.ProfilePropertyManager.GetCoreProperties();
        ProfilePropertyManager ppm = up

User Profile property -- dropdown



Is it possible to create a user profile property (editable by user) with in a dropdown format?

Please advice. Thanks in advance

Automatic Filtering Based on User Profile


I need to filter the tables in my Dynamic Data based information from my user's profile (which I'm already using to security the tables - based on roles). 

Example: I have a profile object with a username, role and region(s) associated with each user.

I'm using the username (windows) to authenticate the user, the role (using a httpModule) to grant/deny access to each table in the dynamic data site. 

Now what I'm trying to do is to use the user's region(s) to automatically filter the table results (and the corresponding DropDownLists) to just that user's region(s). 

My questions is this: How or where do I override the built in filters (presumably the enum) - but only on the applicable tables that have a region component? 

Difference between UserProfile & User Information List Property Values?


If I checks the FirstName & LastName Property values in UserProfile it has someValue however the same properties does not have anyValue in User Information List, what would the reason behind this?

Even I could see comma (",") separated value for some Field in UIL however the same value is in UserProfile without comma (",") ....

ProfileSync and/or QuickSync will update the UIL with same Information avail in UserProfile, isn't it? In that case both should have the same value, right?

Karthikeyan | MCTS | India

Active Directory - List group managed by a specific user


Hello every body,

I need to know how I can find which groups of an active directory are managed by a specific user. The idea is to create a WinForm appication where the user enter a name and then, the code chek whicjh group of the AD is managed by the name entered.

Has someone any idea? I jusrt need specification about the Active Directory classes and methods...

Thanks ;-)

Why don't I see all of the AD properties when trying to map a user profile property

When I go to map user profile properties to AD, and click the AD property drop-down, I don't see all fields from AD. In particular, I am trying to find the ad field 'url' and it is not visible. Any ideas?

Web part to retrieve List Items based on configurable property


I want to create a web part that will do the following

1) Have a custom choice property based on teh Choice List Column in the list.

2) Return the records based on the custom choice selected by the user.


Is this possible?


Creating Sites/Lists/List Items under Current User Context in SharePoint By Using SPUserToken

Usually we do this by performing the action under RunWithElevatedPrivileges method and updating the listitem using SPListItem.SystemUpdate() method (see here). but this approach has its own flaws like (RunWithElevatedPrivileges will run under system account, we cannot use SystemUpdate for SPSite,SPWeb,SPList, since it runs under system we will "CreatedBy" by as SystemAccount).
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend