The electronic transport properties of molecular device based on photochromic diarylethene with carbon nanotube electrode are investigated by density functional theory and non-equilibrium Green’s function. The devices with open and closed configurations show a switching effect. It is found that doping of different amounts of nitrogen atoms on left electrodes results in different electronic transport properties. In addition, we discuss the observed oscillation of current in the devices induced by doping using transmission eigenstates and transmission spectra of the device. The local density of states of the device is calculated to analyze the observed rectifying behavior. The results suggest that doping of nitrogen atoms on the left electrode can be considered as a factor to modulate the electronic transport properties of molecular device.