Ashwani Ashwin
Account does not have permission to open the attachment : Hyper-V VM Error
Category: #D365,Account does not have permission to open the attachment,D365Champs,Hyper-V,Microsoft Dynamics CRM,Others,Virtual Machine,VM Error Author: Ashwani Ashwin Date: 4 months ago Comments: 0

Hello Everyone, My CRM servers are distributed to 3 VM’s: Web, App and DB individually. All these 3 VM’s are …

Continue reading

Source: Ashwani Ashwin


D365 – Gmail Server Profile Settings
Category: #D365,#GmailServerProfile,D365Champs,Microsoft Dynamics 365 Author: Ashwani Ashwin Date: 5 months ago Comments: 0

Hello Everyone, Every time when I create a new Organization in Dynamics CRM, for the purpose of email testing I’ve …

Continue reading

Source: Ashwani Ashwin


You are attempting to create a user with a domain logon that is already used by another user : CRM User Creation Error
Category: D365Champs,Microsoft Dynamics 365 Author: Ashwani Ashwin Date: 6 months ago Comments: 0

Hello Everyone,

As a CRM Administrator for On-Premise, we all have come across this error once : “You are attempting to create a user with a domain logon that is already used by another user…

Generally, this error occurs when we are trying to create a user which already exists in the Organization i.e. in Backend, adding user with same AD-SID (Security IDentifier) under MSCRM_Config table.

There is a very nice blog which explains in detail about the different scenarios of this error and their solution: https://celedonpartners.com/blog/reconnect-active-directory-accounts-dynamics-crm/

However, I came across another different rare scenario which I would discuss here. I have a D365 multi-organization environment setup with a list of existing CRM users. For one of the Org-B, we added the user and hours later for some unspecified reasons (bad Integration data affecting multiple core tables :/ ) we had to do a quick DB Restore. After the DB restore, neither that recently added User was not able to login nor I wasn’t able to add the same user again; faced the similar error –  You are attempting to create a user with a domain logon that is already used by another user…

Cause:

So when we added the user to this Org-B, a new SystemUser record was created under the OrgB_MSCRM DB. And a related record was created for SystemUserOrganizations under MSCRM_Config DB referencing to the Organization-B and the UserID based on the AD-SID.

But after the Organization-B was restored, the new user record for SystemUser under OrgB_MSCRM went missing but the related record with Org-B and User-ID still exists in the MSCRM_Config DB. Due to this reference, I couldn’t add the same user again in Org-B and kept giving me the below error:

When the user try to logon to the CRM, the following error prompted:

Error Logging to CRM Org-B

Solution:

The only easier way
I could think of was deleting that additional reference from the SystemUserOrganizations under MSCRM_Config DB. Please note this approach is not recommended and highly
unsupported
and always keep a backup of the DB’s and the encryption keys
before performing any such action with the DB directly.

With few relational
queries I figured out the User-ID and the reference record which I needed to
delete for Org-B. Under MSCRM_Config DB, I ran the below query one last time to
confirm I was pointing to the correct record:

Select* from SystemUser

where Id = 'A6797AA8-4857-E911-9C2D-00155D00AB0C'

Select* from SystemUserAuthentication

where UserId = 'A6797AA8-4857-E911-9C2D-00155D00AB0C'

Select * from SystemUserOrganizations

where UserId = 'A6797AA8-4857-E911-9C2D-00155D00AB0C'

--and OrganizationId = '386CEC94-7CD6-E811-9C2B-00155D00AB0C'

After I ran the select query , you can notice the additional reference record to Org-B in the results.

I finally ran the
query below and deleted the reference record under MSCRM_Config DB.

/*

Delete SystemUserOrganizations

where UserId = 'A6797AA8-4857-E911-9C2D-00155D00AB0C'

and OrganizationId = '386CEC94-7CD6-E811-9C2B-00155D00AB0C'

*/

Everything went well and I was able to create the user record again in Org-B.

Hopefully this will
be helpful to someone who got caught in a rare situation like this.

Thanks! ?

Source: Ashwani Ashwin


LDAP Query : Fetch User information from Active Directory in different Domain Controller
Category: D365Champs,Others Author: Ashwani Ashwin Date: 6 months ago Comments: 0

Hello Everyone,

 

This week I got a task to perform a LDAP query and fetch few user information. Challenge was to perform the fetch action not from our current domain but rather a different domain; that too not with FQDN but with IP. This was not too tricky as all I need to do was configure the DirectoryEntity first and then pass it to the usual DirectorySearcher which we use to perform LDAP.

 

Let me explain that in detail, step by step:

 

1> I started with creating a new Console App in Visual Studio.

 

2>  To begin with, I needed to add the System.DirectoryServices (for LDAP) and System.Configurations (for configuration file) as assembly references. 

 

3> Initialize the DirectoryEntity object with the following:

    • Authenticating accountId
    • Authenticating Password
    • LDAP path (can either be Server IP containing AD <“LDAP://10.10.10.10”> or the FQDN of AD <“LDAP://DC=mscrm,DC=com,DC=sg”>)

 

4>  Initialize the DirectorySearcher object with the DirectoryEntry.

This would do a DNS lookup to find a DC where the AD resides.

I used the DirectorySearcher.SearchRoot.Path to check if the path is set correctly for LDAP.

 

5> Now it’s time to set the filter properties of the DirectorySearcher with the LDAP query.

I’ll pass on the LDAP query to Configuration Manager AppSettings as the query will change from time-to-time.

 

6> Once everything is set, it’s time for the results. Results are captured using SearchResult with:

    • FindOne() – when fetching a specific user details with 1 results only. Something like in SDK we have IOrganizationService.Retrieve Method
    • FindAll() – when fetching multiple users with a filter criteria. Something like in SDK we have IOrganizationService.RetrieveMultiple Method 

 

 

7> Build the code and .exe is ready to be executed in the server. ?

The App.config file will be like this

 

8> And the final Result of query, if everything falls in place correctly.

 

Hope this was helpful. Thank much!  ?

 

Source: Ashwani Ashwin


List all advanced configuration options in MSSQL with sp_configure
Category: Microsoft Dynamics 365,SQL / SSRS Author: Ashwani Ashwin Date: 1 year ago Comments: 0

Hello Everyone,

While writing the Technical document, we all would need to specify the configuration options details of the SQL Server which was Installed on Dynamics Server along with the version and the Instance Name.

 

The SQL configuration options can be fetched from the master table using the query:

Exec sp_configure

sp_configure_1

 

However, this is not all the options. To show all the advanced options need to run the following query:

1. EXEC sp_configure 'show advanced option', '1'

sp_configure_2

Upon successful query execution, the result will show the following message as in image above.

 

2. RECONFIGURE; 

sp_configure_3

 

Now when I execute the query sp_configure, I see many result rows.

sp_configure_4

 

Many other syntax and features about sp_configure are documented in MS article. Hope this will be helpful.

Thanks ! ?

Source: Ashwani Ashwin