SSH Key based authentication for vCenter using Putty
December 9, 2023
SSH Key based authentication for vCenter using Putty
December 9, 2023

Exporting and viewing LDIF from vCenter using SSH / JXplorer

If there is an requiremnt to collect the LDIF from vCenter, it can be done via 2 methods.

Export using SSH

  1. Login to vCenter using SSH
  2. Type shell and hit enter to enter the bash shell
  3. Enter the below command to export the ldif and exter the password when prompted
# /opt/likewise/bin/ldapsearch -b "dc=vsphere,dc=local" -s sub -D "cn=Administrator,cn=Users,dc=vsphere,dc=local" -W > $(hostname)_"`date +"%d-%m-%Y"`".ldif

Note: The command command contains the domain and if you are not sure of your SSO domain, you can run the below command

/usr/lib/vmware-vmafd/bin/vmafd-cli get-domain-name --server-name localhost

Export using JXplorer

  1. Download and install JXplorer.
  2. Open JXplorer and click File -> Connect
  3. Enter the below details
    Host: IP or FQDN_of_vCenter
    Protocol: LDAP v3
    Base DN: dc=vsphere,dc=local
    Security Level: User + Password
    Security User DN: cn=administrator,cn=users,dc=vsphere,dc=local
    Security Password: administrator password
  4. Select LDIF > Export Full Tree
  5. Click Ok and save the file.

Viewing offline the LDIF exported from JXplorer

  1. Open JXplorer and click LDIF -> View Offline
  2. Select the LDIF file and select Import
  3. JXplorer validates for errors in the ldif and once done, click Yes
  4. The LDIF can be viewed

Viewing offline the LDIF exported from SSH

An additional step is required if the LDIF is exported via SSH.
If you view the LDIF exported from SSH without performing this steps, you would see some containers missing.

  1. Open the LDIF in notepad
  2. Do a Find and Replace and change the CN of domain from Uppercase to Lowercase
  3. Replace All and now save the ldif

Now you can open the LDIF via JXploer using the previous step

Leave a Reply

Your email address will not be published. Required fields are marked *