21

If you have direct access to the database, you can run the following from SQL Management Studio: UPDATE aspnet_Membership SET IsLockedOut = 0, FailedPasswordAttemptCount = 0 WHERE UserId IN (SELECT UserId FROM aspnet_Users WHERE UserName = 'sitecore\Admin') Run this from the Core database.


13

In addition to the answer above, if you have the misery of forgetting the Sitecore password then this will save you: UPDATE [aspnet_Membership] SET [Password]='qOvF8m8F2IcWMvfOBjJYHmfLABc=', [PasswordSalt]='OM5gu45RQuJ76itRvkSPFw==', [IsApproved] = '1', [IsLockedOut] = '0' WHERE UserId IN (SELECT UserId FROM dbo.aspnet_Users WHERE UserName = 'sitecore\...


11

There is also an admin page: URL: http://www.yoursite.com/sitecore/admin/unlock_admin.aspx By default, it's disabled so you need to edit the aspx file to set enableUnlockButton to true.


11

One option is to hook into Sitecore's user:updated event (and optionally user:updated:remote). This event is raised when a user has been updated, the remote event handler is raised when a user was updated on a remote Sitecore instance. EDIT: As pointed out in the comments by @SzymonKuzniak, you can also hook into the roles:usersAdded[:remote] event to ...


11

I propose hiding users through the use of filtering in the membership provider. Consider using the customFilter attribute used by the Active Directory membership and role providers. Examples shown below. Active Directory supports the following filter for excluding disabled users: (!(UserAccountControl:1.2.840.113556.1.4.803:=2)) You can find more details ...


10

This is a pretty complex issue and question, but you have broken it down excellently to allow me to attempt and pinpoint the issue. I believe the issue you are suffering from is what I have called "The Library Computer Problem" Question 1 With the usage of ExM and Engagement Plans we are heavily relying on contacts and the relation from contacts to ...


10

As @Balaji Kuppuswamy stated in comments, you simply need to include the domain name into the full user name when creating a user: System.Web.Security.Membership.CreateUser(@"sitecore\myuser", "b", "myuser@sample.com"); Please note that the domain column on UI is fulfilled only if an existing domain is specified:


10

Yes, "admin" is not a role and cannot be assigned to a role. You shouldn't do that either. If you need that many admin users, there might be something fishy with your security requirements. You might want to check the overview of the Sitecore roles (https://doc.sitecore.net/sitecore_experience_platform/setting_up_and_maintaining/security_and_administration/...


7

To get a user by a username you can use : public class UserRepository { public static User GetUser(string domainName, string userName) { if (User.Exists(domainName + @"\" + userName)) { return User.FromName(domainName + @"\" + userName, true); } return null; } } To get a user roles you can use Sitecore....


7

You will need to use component personalization for this. That means all users get access to the page, but on the personalization rules for components you set exceptions based on security. For example: Here is a walkthrough on how to set up component personalization: https://doc.sitecore.net/sitecore_experience_platform/digital_marketing/personalization/...


7

This message is a dictionary entry in the core database in Sitecore. Go to Sitecore Desktop, switch to core database and find the item: Path: /sitecore/system/Dictionary/F/Failed to set the password Possible reasons are 1 The old password is incorrect 2 The new p_1 ID: {098CF1DA-CF18-412A-9EE9-A82E14BA3731} Enter any Phrase value you want: I ...


7

You could consider running a script that fires with the user:created event. Try the following: Step 1 Create a patch which tells SPE to run scripts for the Sitecore event. <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:role="http://www.sitecore.net/xmlconfig/role/" xmlns:security="http://www.sitecore.net/xmlconfig/security/"> ...


6

You can get this info the other way around. Check the !user.IsApproved property. But first you need to get the user through the membership provider like this: var provider = System.Web.Security.Membership.Provider; var user = provider.GetUser(username, false); if (!user.IsApproved) {...}


6

The problem could be is that you are using the following: virtualUser.Profile.SetCustomProperty("Wallpaper", "/sitecore/shell/themes/backgrounds/Field.jpg") Try to use the following: virtualUser.Profile["Wallpaper"] = "/sitecore/shell/themes/backgrounds/Field.jpg" Explanation The SetCustomProperty does not check if the user is virtual user or not, but ...


5

Here is the correct code: var user = Sitecore.Security.Accounts.User.FromName("sitecore\\test", true); RemoveRoles(user); protected void RemoveRoles(Sitecore.Security.Accounts.User user) { Sitecore.Security.Accounts.UserRoles.FromUser(user).RemoveAll(); Sitecore.Security.UserProfile profile = user.Profile; profile.IsAdministrator = false; ...


5

I think Sitecore PowerShell Extensions could help address both the workflow action feature, as well as finding the users. The following query would provide enabled users in a given domain: Get-User -Filter "training\*" | Where-Object { $_.IsEnabled } The following query provides enabled users in a given role: Get-RoleMember -Identity "training\editor" | ...


4

This code is execute when you click this button : [Serializable] public class ResetSettings : Command, ISupportsContinuation { /// <summary> /// Executes the command in the specified context. /// </summary> /// <param name="context">The context.</param> public override void Execute(CommandContext context) { ...


4

As the other suggested answers suggest is correct. When you are creating a new user programmatically, you can get the Full name by using the following code: string domainUser = Sitecore.Context.Domain.GetFullName("some@example.com"); This will give you the full user which would include the current context domain. This is what you should pass to your ...


4

As @Gatogordo mentions, you likely shouldn't be using Administrator. This should be a checkbox you use on your 'emergency' account which you use to access things that nobody should access. Inheriting default roles It is very common to have a group of Sitecore System Administrators who need to be able to do things like set security on users, have access to ...


4

You can't directly set permissions to restrict user to only be able to add certain roles. But you can use Sitecore local managed domain to sort of workaround this issue. Basically, you would have One or more Locally managed Domain Within each local domain, the user with local administrator role can only assign it's own domain level roles to a user. ...


3

To make this work you need to follow these 5 steps: Create your own GeneratePassword() method.It should do exactly the same as System.Web.Security.SqlMembershipProvider.GeneratePassword(), but instead of using modulo 87, it should use your custom logic to generate valid passwords. Create your own SqlMembershipProvider and let it inherit from System.Web....


3

User Manager uses /sitecore/layout/Layouts/Security/SecurityManager layout. Path to aspx page is /sitecore/shell/Applications/Security/UserManager/UserManager.aspx. Layout uses Grid component from ComponentArt.Web.UI.dll However, rendering process has difficult structure and works with hardcoded js files, including code for render search box: window....


3

There is, but none of the ways I know of will go via the standard API. The "problem" is; while the standard API will allow you to paginate through the user base, it will not allow you to filter based on profile properties. Which, from your code, is what you need here. This leaves you with a few options. Option 1, the SQL route Turns out, even this ...


3

It does not exist now. For that you would need an web API which also contains some backend validation to not blow up your user database. In backend you can easily create users using Sitecore API. At some point maybe they will have such a function in JSS. I can imagine this function as part of Sitecore Forms support by JSS in the future.


3

Since you mention the use of TDS, you can manage the synchronization of all Roles and security on item using features available in TDS. This has the advantage that both Roles and the security becomes part of your solution and can be deployed both locally and across all environments in a consistent manner. Serializing Roles It is possible to serialize any ...


2

Updated Response After looking into more details, your issue can be addressed by updating the RenderingLayoutGridBuilder method located inside Sitecore.Shell.Applications.ContentManager.Dialogs.LayoutDetails.LayoutDetailsForm Create a copy of LayoutDetailsForm.cs class in your local assembly. Add logic to the method RenderLayoutGridBuilder in such a way ...


2

Show Field Read Field Write columns in security editor, navigate to /sitecore/templates/System/Templates/Sections/Layout/Layout/__Renderings item and deny field write.


2

One solution to achieve the desired functionality you can override the Sitecore.Shell.Applications.ContentManager.Dialogs.LayoutDetails.LayoutDetailsForm class. Here is an example of how to do this: Create an assembly with the class that has the same code as defined in the LayoutDetailsForm class. Add the following code to the end of the OnLoad method: ...


2

Based on your description, I would assume that you have a page that contains a significant amount of content that is visible to anonymous users (and search engines) but you also want to be able to have additional content that is displayed if the user is authenticated. Differentiate Between URL Security and Content Security Given the above scenario, the ...


2

The "Reset Settings" button in the User Manager calls the usermanager:resetsettings command, which in turn executes the Sitecore.Shell.Framework.Commands.UserManager.ResetSettings command class. On confirmation ("[Yes, I want to reset the settings of the user]"), the command loops through all of the custom properties of the UserProfile of the selected user ...


Only top voted, non community-wiki answers of a minimum length are eligible