To unlock your Windows device, you can follow these steps:
- Get the Network Adapter ID: Use the following command to get the network adapter ID for your device:
account.currentNetwork.networkAdapter.networkAdapterId - Create an IMbnInterfaceManager Instance: You need to create an instance of the IMbnInterfaceManager.
- Advise to IMbnPinManagerEvents and IMbnPinEvents: Register for these events to get the PIN state and unblock/unlock results.
- Get the IMbnInterface: Pass the network adapter ID into
IMbnInterfaceManager::GetInterfaceto get an IMbnInterface for the device. - Get the IMbnPinManager: Call
IMbnInterface::QueryInterfaceto get an IMbnPinManager interface for the device. - Get the PIN State: Use
IMbnPinManager::GetPinStateto check the PIN state of the device. - Determine Lock Status: Check how the device is locked or blocked using the
MBN_PIN_INFO::pinStateparameter. - Get the IMbnPin Interface: Call
IMbnPinManager::GetPinto get the appropriate PIN. - Enter or Unblock the PIN: Depending on the lock status, call either
IMbnPin::EnterorIMbnPin::Unblock. - Listen for Results: Use
IMbnPinEventsto know whether the unlock or unblock operation was successful.
After unlocking your device, you can proceed to remove and unlink your Microsoft account if you wish.