August 4, 2017


Show user accounts with and without two-factor enabled
Get a list of users with two-factor authentication enabled/disabled.

To get a list of users with Two-Factor authentication enabled.

"""
@author Ryan TIffany
"""

import SoftLayer
from pprint import pprint as pp 

client = SoftLayer.Client()
mask = mask"[id,username,firstName,lastName,externalBindingCount,externalBindings]"
theFilter = {
'users': {
	'externalBindings':{
		'active':{
			'operation':'1'
		}}}
}

getUsers = client['SoftLayer_Account'].getUsers(filter=theFilter, mask=mask)
pp(getUsers)

To get a list of users without Two-Factor authentication enabled.

"""
@author Ryan TIffany
"""

import SoftLayer
from pprint import pprint as pp 

client = SoftLayer.Client()
mask = mask"[id,username,firstName,lastName,externalBindingCount,externalBindings]"
theFilter = {
'users': {
	'externalBindings':{
		'active':{
			'operation':'0'
		}}}
}

getUsers = client['SoftLayer_Account'].getUsers(filter=theFilter, mask=mask)
pp(getUsers)

Feedback?

We would love to hear it
Open an issue