Use Powershell to read data from LDAP and create a modify-LDIF

I just stumbled about a problem to get a list of all users with a telephonenumber from LDAP to create an LDIF for those users. So I decided to use Powershell because it gave me an easy way to create this LDIF file to add an value to every user.

The first script just dumps the DN and the phone number of all objects

$Server= "LDAP://ldpahost.domain.local:389/DC=domain,DC=local"
$DirEntry =New-Object -TypeName System.DirectoryServices.DirectoryEntry -ArgumentList $Server, $DN, $Pw, "FastBind"
$DirSearcher =New-Object -TypeName System.DirectoryServices.DirectorySearcher -ArgumentList $DirEntry, $Filter
$DirSearcher.FindAll() | Select -ExpandProperty Properties | ForEach {
    Write-Output $ldapDN

The second script writes an ldif file to modify a a field on every user:

$Server= "LDAP://ldpahost.domain.local:389/DC=domain,DC=local"
Remove-Item -Path $destfile
$DirEntry =New-Object -TypeName System.DirectoryServices.DirectoryEntry -ArgumentList $Server, $DN, $Pw, "FastBind"
$DirSearcher =New-Object -TypeName System.DirectoryServices.DirectorySearcher -ArgumentList $DirEntry, $Filter
$DirSearcher.FindAll() | Select -ExpandProperty Properties | ForEach {
    Out-File -FilePath $destfile -InputObject "dn: $ldapDN" -Append
    Out-File -FilePath $destfile -InputObject "changetype: modify" -Append
    Out-File -FilePath $destfile -InputObject "add: ldapfield" -Append
    Out-File -FilePath $destfile -InputObject "ldapfield: newContent" -Append
    Out-File -FilePath $destfile -InputObject "" -Append

The resulting file can be used to import it to the directory using LDAPAdmin. But be aware that Powershell generates utf8-files and LDAPAdmin needs ASCII to import. The encoding-Option of OutFile didn’t work out because it killed german umlauts. So I converted it afterwards with notepad.

Only 6-bit color depth on Intel UHD 6xx Graphics and Dell Display

A while ago I noticed some color problems on my work display. It seemed to have problems with color gradients. I investigated a litttle and found information in the advanced display settings that my Dell-Display only supports 6-Bit color depth.

color depth in advanced display settings

Back than I found no clue what the problem could be. Except that at home with the same display I had no problems. Difference was: At home working with NVidia graphics card and at work with an Intel UHD 620 Chipset.

Some days ago I found at least two threads in the Intel forum with people with the same problem. They all have Dell displays and Intel UHD graphics. In one of the treads an Intel employee already said that the problem was found and a new driver will be released soon. As of now this did not happen but I will update this post than.

Update 2018-11-29: Yesterday a new driver was released wich fixes the problem. Beginning with driver version (UWD) full 8-Bit ist available again!

vSphere 6.7U1 update pre-check fails with “DRS should be enabled”

In vSphere 6.7U1 I could not update my ESXi-Hosts in my cluster because the new Remediation Pre-Check fails with  the following error: “DRS should be enabled”

It also has a big red banner:

“Pre-check found problems that will block remediation. See details below. The blocking problems may have caused the pre-check to complete prematurely. Therefore, after fixing the problems, please re-run this pre-check.”

So Host remediation is blocked with error message: “Pre-check has found 2 issues that will block remediation”

Here are my work arrounds so far that I also posted on the relevant spiceworks thread:

1: use the old flex/flash-client. There is no pre-check

2: remove the esxi server from the cluster (just drag&drop the the server in question from the cluster to the datacenter). Outside of the cluster there is no DRS, so the pre-check works and update is not blocked anymore

But I think the second is the easiest way to do it.

I also opened a support request with VMware. I will keep you updated.


/var runs full on VMware ESXi 6.7 on HP Gen8 Server

Today two of my ESXi 6.7 servers running on HP DL360p Gen8 didn’t behave as expected. VMotion and remote consoles quit with internal error.

In vspere syslog I found:

The ramdisk 'var' is full. As a result, the file /var/log/EMU/mili/mili2d.log could not be written.

On ESXi vdf -h revealed a full file system. The milid2.log was the problem and dumped the following errors:

CRITICAL:backend_init:OneConnect Adapter Not Found.
ERROR:rename all the configuration files!
ERROR:MILI_enumerate_elxiscsi:Failed to initialize User Init with status = 19
ERROR:MILI_enumerate_elx_nics:Failed to initialize USer Init with status = 19
ERROR:could not open device node /vmfs/devices/char/vmkdriver/be_esx_nic

In both servers no emulex hardware was installed.  So I removed 3 packages form those ESXis with a reboot between each. The last one solved the problem!

esxcli software vib remove --vibname elxnet

esxcli software vib remove --vibname elxiscsi

esxcli software vib remove --vibname

On my DL360 Gen9 this problem did not occur.

Update: As Gunnar pointed out in a comment this could also happen on a Gen9 on newer vSphere 6.7 Updates.

Update 2 (Thanks Pete): VMware resolved this problem with vSphere 6.7 U2 or Patch ESXi670-201904211-UG