My first XrmToolBox plugin for managing user’s security – User Security Manager

Prashant Maurya

For past few weeks I have been thinking to add my bit to XrmToolBox, the most loved tool by me and the entire Dynamics 365 Community.

Here is my first plugin “User Security Manager”. Which I developed along with Nishant Rana.

User Security Manager

This tool will help in efficiently managing User’s security in Microsoft Dynamics 365 Customer Engagement. Below is the list of features it has

  • View all the security roles that assigned to the user either directly or through the team that the user is member of.
  • View all the Teams the selected user is part of.
  • With just a single click, remove all the security roles assigned to the user.
  • With just a single click, remove user from all the teams that user is part of.
  • Easily assign and unassign single or multiple security roles to the user.
  • Easily add or remove user from a single…

View original post 43 more words

User Security Manager – My first XrmToolBox Plugin

Being one of the biggest fan and the most frequent daily user of XrmToolBox, always had this wish to write a plugin for it.

Thanks to Prashant Maurya  (a dear friend and ex-Microsoft Employee) for making this wish come true. (Who played the major role in developing it).

The tool is called – User Security Manager.

The Plugin make it easy for the administrators to manage all the security related aspects of the system users. The tool also gives 360-degree information of the user in correspondence to business unit, security roles and teams.

In our current project we had around 180 users using the system divided into more than 50 business units, which involved frequent update of their business unit, changes in the security roles assigned, update in team assignment and also during testing we had to assign the same BU and roles to the test users in the org, which wasn’t that easy to do from the user interface.

So, the idea was to come up with a tool that will let an administrator to

  • View all the security roles that assigned to the user either directly or through the team that the user is member of.
  • View all the Teams the selected user is part of.
  • With just a single click, remove all the security roles assigned to the user.
  • With just a single click, remove user from all the teams that he is part of.
  • Easily assign and unassign single or multiple security role to the user.
  • Easily add or remove user from a single or multiple team.
  • Change the Business Unit of the user.

User Guide: –

Load all the users

After connecting to the organization, we can click on Load Users to load all the system users of the organization.

List details of the user selected

  • For the selected user, in User Detail Tab’s General section, we can get the general information of the user like First Name, Last Name, Title, Primary Email and Access Mode.
  • Next to the General section, we can see all the security roles assigned to the user either directly or through the teams the user is member of.
  • The Roles tab shows all the Roles assigned to the user and also the roles that are available in the business unit to which user belongs in Assigned and Available section along with their counts.
  • The Teams tab shows all the teams user is member of and also the teams that are available in the organization in Assigned and Available section along with their counts.

Remove all security roles of the user.

To remove all the security roles of the user, click on Remove All Roles button.

Remove user from all teams.

To remove the user from all the teams, click on Remove All Teams button.

Assign Security role to the user.

To assign security role to the user, check the security roles from the available security roles section and click on “<<” button.

To remove security role from the user.

To remove security roles from the user, select the roles from the Assigned section and click on “>>” button.

Assign User to Team(s).

To assign user to team(s), select the teams from the available section and click on “<<” button.

Remove user from Team(s)

To remove user from Team(s), select the team from the Assigned Section and click on “>>” button.

Change the business unit of the user.

To change the business unit of the user, select the Business Unit from the Business Unit drop down in General Section of User Details.

Please install it, use it and share your feedback which would help us to improve it

https://www.xrmtoolbox.com/releases/

Hope it helps..

When does the Plugin registered on SetState message fires in Dynamics 365?

Hi,

Recently we were writing a plugin that should fire when a record is activated.

In this kind of scenario, it is suggested\recommended to register plugin in both SetState and SetStateDynamicEntity message.

https://community.dynamics.com/crm/f/117/t/184070

https://blogs.msdn.microsoft.com/crm/2008/03/07/developing-plug-ins-for-crm-4-0/

Interestingly we had the following observations

  • The Plugin fires only for SetStateDynamicEntity message.
  • The Plugin fires even if the SetState message step is disabled or not registered.
  • Only SetStateDynamicEntity message is fired when the record is Activated or Deactivated. For incident entity also, it was the only message fired on Reactivating the record. The plugin didn’t trigger in case of Resolve or Cancel Case.
  • Only SetStateDynamicEntity message is fired, even if we are updating the state of the record using SetStateRequest of SDK.
  • As SetStateRequest message is deprecated, if we use UpdateRequest to update the state of the record, the plugin that is registered on SetState and SetStateDynamicEntity will not fire. It will trigger only if registered for Update message.

Plugin Trace log records :-

We are yet to figure out when exactly the SetState will be fired. Please share your thoughts and experience around the same.

Hope it helps..

Sample Plugin code to run on Reactivate Case (Incident) in Dynamics 365

Just sharing a sample code that runs on the Activation of case (incident) record and updates one field in it.

We need to register the plugin in both SetState and SetStateDynamicEntity message. Interestingly what we found was the plugin runs perfectly even if it is registered only for SetStateDynamicEntity. It triggers properly either we update it from CRM UI or through the CRM SDK for SetStateDynamicEntity message.


protected override void ExecuteCrmPlugin(LocalPluginContext localContext)
{
if (localContext == null)
{
throw new InvalidPluginExecutionException("localContext");
}

// TODO: Implement your custom Plug-in business logic.

var context = localContext.PluginExecutionContext;
var tracingService = localContext.TracingService;

if (context.InputParameters.Contains("EntityMoniker"))
{
tracingService.Trace("Inside Entity Moniker");

var targetEntity = (EntityReference)context.InputParameters["EntityMoniker"];
if (targetEntity.LogicalName == "incident")
{
tracingService.Trace("Inside Incident");

int state = ((OptionSetValue)context.InputParameters["State"]).Value;

tracingService.Trace("State = " + state);

// if status is active
if (state == 0)
{
tracingService.Trace("State Active");

// update one field in the record
Entity incident = new Entity("incident");
incident.Id = context.PrimaryEntityId;incident.Attributes["sab_fash_casestatusid"] = new EntityReference("sab_fashioncasestatus", new Guid("6F456BDC-CD7D-E811-813C-5065F38B15F2"));
localContext.OrganizationService.Update(incident);
tracingService.Trace("Record Updated");
}

}
}

}
}

Hope it helps..

MVP’s around the World

Interesting data !

EighTwOne (821)

mvpUpdated July 3rd:  Includes newly registered awardees and awardees who changed category. Added overview of Office Servers and Services numbers over last couple of years.

With the latest annual award cycle, one might be curious which impact it had on the MVP population. I performed a similar exercise last year to compare the impact of the start of the new award cycle. This year, all the MVP’s previously on the January and October cycles were also included in the reviews, making this year the first one where MVP leads and others had to perform the dauntless task of reviewing community contributions of over 3,500 people.

For comparison, I had a look at the public MVP statistics of July 1st against those of June 26th, to exclude significant noise from the monthly awardees. To start, let us first have a look at the total population of MVP’s. From the numbers…

View original post 618 more words

{Quick Tip} Manage your Entity Forms when your CRM is exposed to Web and Mobile App

Debajit's Dynamic CRM Blog

Spoiler alert! Unlike other blogs, I am not going to update you about any new feature. Rather I am going to share my project experience in handling multiple forms designed for your Web and Mobile layouts.

You have exposed you CRM recently to Mobile Apps. When you expose your CRM to Mobile Application development, in most of the scenarios you would end up designing separate forms. Let’s take the example of Account entity. Say you have designed two forms

  • Account Web Form – This form is displayed to users while accessing CRM to Web
  • Account Mobile Form – Form displayed to users while browsing CRM on Mobile

And you have your users who will just access CRM through desktop and then some users accessing CRM through both Desktop and mobile.

First of all, as I have been across client locations, I find that some consultants still assume that to expose…

View original post 415 more words

My Interview at MSDynamicsWorld.com

Check out my interview at MSDynamicsWorld.com

https://msdynamicsworld.com/story/nishant-rana-goes-man-series-cricket-dynamics-mvp

2018-06-16_0941

Thanks MSDynamicsWorld.com and Linda Rosencrance.

Fixed – Invalid Export Business Process Not Activated error while exporting solution in Dynamics 365

While exporting a solution from our DEV, we got the below exception.

As the messages suggests to fix it we need to activate the process (which will create the corresponding entity for the BPF and add the entity in the solution). Or if already created simply add that entity if missing in the solution.

So we Activated the BPF.

Added the BPF specific entity.

Which then allowed us to export the solution.

Hope it helps..

PLAN PROPERLY before using Back and restore and Copy instances in Dynamics 365

Update – 25 June 2018 – Took nearly 20 days to get both the instances up.

Update – 12 June 2018Support Engineer has been not been able to resolve either of the support ticket which were raised last Thursday 7th June. One instance is not opening and the other instance is not restored with the backup we had requested. They are unable to find the backup till now.

Recently we tried copying our DEV to one of the TEST instances. The idea was we were upgrading the click dimensions solution in our DEV so we wanted to make sure everything works fine after the upgrade and in case it didn’t we could then again copy it back from the TEST.

We had faced back and restore issues (instance failed) in the past so decided to go the Copy instance way this time.

However, we got the Instance Failed error on the TEST instance to which we were copying DEV to.

Interestingly the Edit, Reset, Delete etc option were still available and we could open the TEST instance (the original, as the copy of DEV had failed) without any issues.

Then we thought of giving a try again and started copy from DEV to TEST again. This time again it failed. And with no option of Edit, Reset, delete etc. and the Instance was also not opening.

The error à

Along with that we also tried Restoring the Backup in one of the other TEST instances, that also expectedly failed.

So basically, we ended up with 2 unusable instances.

A few weeks back also we faced the same with our Dev environment and the only way out was to raise the support ticket with Microsoft. That time it took 5 days for DEV to be restored. Imagine the development activity that came to halt.

Last year also we had faced this issue in Production and had to work with the support team for 16 – 20 hours continuously to get it restored.

So, if we have some critical activity planned like Production Deployment and we are counting on Back and Restore or Copy an instance to rescue us in case anything goes wrong after production deployment, we need to plan for this Instance Failure as well while restoring or copying.

Basically, be ready to raise a support ticket with the highest severity to restore things back, which could take hours or in worst case days and do all the production deployment over the weekend or have enough downtime allocated.

Hope it helps..