How to print special characters like Beta, alpha, Phi while using CSV writer in Python
Category: alpha,beta,csv,omega,Others,phi,Python,Special character Author: Debajit Dutta Date: 4 months ago Comments: 0

This is my second blog post and gosh, I am loving it here. So here it goes. I had a requirement where I had to print the special greek characters like Alpha, beta, omega, Phi etc in excel using CSV module. Since I am pretty new to the platform, I searched around in the wonderful […]
Source: Debajit

Blank row getting inserted between each row of excel while using CSV writer in Python
Category: blank row,csv,Others,Python Author: Debajit Dutta Date: 4 months ago Comments: 0

I have recently started working on phyton and I just love it. And now I wonder why I didn’t get an opportunity to start earlier. So here it is. I was trying to write a CSV file. Below is the sample code for the same. import csv with open(’emissions.csv’, ‘w’, encoding=”utf-32″) as csvfile:     filewriter = […]
Source: Debajit

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: 1 year 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

LDAP Query : Fetch User information from Active Directory in different Domain Controller
Category: D365Champs,Others Author: Ashwani Ashwin Date: 1 year 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://”> 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