Collapse the table of content
Expand the table of content
Expand Minimize

Determine if a device is PIN-locked

Updated: August 27, 2013

Applies To: Windows 8, Windows 8.1

Because the subscription information on a locked device (for example, ICCID or IMEI) might not be available, all locked devices enumerate an available network account. To know whether an account represents a locked device, query the NetworkDeviceStatus property of the CurrentDeviceInformation property for the account. NetworkDeviceStatus.DeviceLocked indicates a PIN lock, whereas NetworkDeviceStatus.DeviceBlocked indicates a PUK block.

For example:

var account = Windows.Networking.NetworkOperators.MobileBroadbandAccount.createFromNetworkAccountId(accountId);
if (account.currentDeviceInformation.networkDeviceStatus == Windows.Networking.NetworkOperators.NetworkDeviceStatus.DeviceLocked)
  // the pin is locked

See Also

© 2015 Microsoft