Tag Info

New answers tagged

0

An easier approach is to allow the user to update the property and just hide the value from their edit page. Then you don't need RWEP. Just a thought.


1

Run with Elevated privileges runs the Code in System Account/App pool account. So you will have to make sure that App pool account has "Manage Profile Permission" rights to the User Profile Service. Follow below steps: Go to Central Admin-->Choose Application Management --> Manage Service Applications--> Select the User Profile Service Application (do not ...


1

This is possible also in SharePoint OnLine. These are the steps that you have to do: (Go to) Sharepoint Admin -> User Profiles -> Manage User Properties -> New Property Here you have to choiche from some option. For sure you will need to make the property indexed Then go to Search -> Manage Search Schema -> New Managed Properties Here you have to ...


0

You can iterate through all user profiles and update them. The PowerShell script can look like this: [void][reflection.assembly]::Loadwithpartialname("Microsoft.Office.Server"); Add-PSSnapin Microsoft.SharePoint.PowerShell $site=Get-SPSite "https://yourSitecCollection" $serviceContext = Get-SPServiceContext $site; $upm = new-object ...


0

You can try something like this, Get-ADUser -Filter * -SearchBase "ou=TestOU,dc=domainController01,dc=com" | Set-ADUser -customProperty $true OR # Get all users in the SomeOU. $AllUsers = Get-ADUser -Filter * -SearchBase "OU=ChangeMeOU,OU=UserAccounts,DC=DomainController01,DC=COM" # Iterate the users and update the department and title attributes in AD. ...


0

You should not have to get the current user. Calling GetUserProfile(bool) will get the user profile of the current user, and optionally create the user profile if it does not exist. The user should have permission to update their own profile, so it is very bad practice to use RunWithElevatedPriveledges. You should only need the Service Context for the ...


1

When working with the User Profile Service you will find that uninitialized values are not sent via REST. Your code has to account for the fact that the user may "opt out" and not populate a value. In your code determine if the value is present and if not, determine the default, in your case "false". I like to believe that this is an "optimization". :)


2

This is definitely not a good practice. As someone has already pointed out, if the request keeps failing, you'll end up with an infinite loop. You said you don't know why the request sometimes fails. In order to investigate the underlying cause, the args arguments has all that you need: function onQueryFailed(sender, args) { console.log('Request ...


2

Instead of reloading the page I would suggest that you implement some actual error handling in that function. So instead of: function onRequestFail(sender, args) { window.location.reload(); } You should consider doing something like this: function onRequestFail(sender, args) { // Add OOTB status message to the page. var status = ...


0

It can be done using the UserProfile web service and/or SPServices, see here for an example. Bulk updates are also possible. I have tested both options successfully in SharePoint Online.


4

You cannot change any properties in the User Profiles via client OM code (neither .NET nor via JavaScript) with the exception of the user's profile picture. MSDN - Work with user profiles in SharePoint 2013 Not all functionality that you find in the Microsoft.Office.Server.UserProfiles assembly is available from client APIs. For example, you have ...



Top 50 recent answers are included