New answers tagged

0

One option may be to replace spWeb.SiteUsers.GetByEmail with spWeb.EnsureUser. Even though the documentation indicates that EnsureUser accepts a user's domain\username as a parameter, in practice I've found that an email address works as well, although this may be dependent on your environment's configuration.


0

Try this. It works in all claims provider scenario's like Forms Based Auth, Windows Auth). And it works for normal users and sharepoint\system accounts. IClaimsPrincipal claimsPrincipal = System.Threading.Thread.CurrentPrincipal as IClaimsPrincipal; if (claimsPrincipal == null) { return; } IClaimsIdentity claimsIdentity = (IClaimsIdentity)...


0

You're doing a bit wrong. Replace the following code: while (userEnumerator.moveNext()) { var oUser = userEnumerator.get_current(); targetUsers += oUser.get_loginName() + ","; } WITH THE FOLLOWING CODE: while (userEnumerator.moveNext()) { var oUser = userEnumerator.get_current(); targetUsers.push(oUser.get_loginName()); } As Danny ...


0

You are declaring targetUsers as an Array: var targetUsers = []; Then appending Strings: targetUsers += oUser.get_loginName() + ",";


1

Move-SPUser is a farm wide operation, so you do not need to loop through each site, although you do need a list of users you're migrating. Get-SPUser expects the identity as it exactly matches, but passed in as a string. if using Windows Claims, it would be in the format of: $user = Get-SPUser -Identity "i:0#.w|domain\jdoe" -Web https://siteUrl You could ...


-3

You may also consider using a SQL query for this. It is minimally invasive, and quite effective. [Use] ContentDatabaseName SELECT tp_SiteId,tp_Login FROM UserInfo (NoLock) From there, export the data to a CSV file and trim the duplicates (tp_Login column). Add a 3rd column in the CSV file for the new identity, then run: $csvPath = 'C:\fileName....


1

It will not work as it is already mentioned in Codeplex comments & there is no solution mentioned over there as well. You need to make standard ajax call but it will give you XML with having all user's information in it using below code (As you required SPUser so i cleared the output). $.ajax({ url: "/_api/lists/getbytitle('User Information List')/...



Top 50 recent answers are included