If you get errors when attempting to e-file with an empty box D, you can try entering any number in this format: 5 digits, space, 5 digits (for example, 12345 67890). The IRS doesn't care what's in box D.
You could try asking your employer/payroll company for the number.
Click here for I have no box D or Control Number on my W-2