This usually requires enabling "USB Debugging" in Developer Options and using ADB commands (e.g., adb shell setprop sys.usb.config diag,adb ) to allow the PC to communicate with the phone's modem. Backup QCN:
This method uses a rooted phone and a simple terminal command. It works if your baseband is still visible. Nokia 7.1 Imei Repair