Skip to main content

account_mfas

Creates, updates, deletes, gets or lists an account_mfas resource.

Overview​

Nameaccount_mfas
TypeResource
Idovh.ms_services.account_mfas

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
task_pending_idintegerPending task for Multi Factor Authentication (wire: taskPendingId)
activatedbooleanIndicates if Multi Factor Authentication is activated on this account
statestringCurrent status of Multi Factor Authentication feature (creating, deleting, disabled, modifying, ok, reopening, suspended, suspending)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectservice_name, user_principal_nameGet the account MFA. Returns whether MFA is activated on the Active Directory account, and its state.
createinsertservice_name, user_principal_nameCreate the account MFA. Creates MFA for the Active Directory account and returns the task. MFA is enabled by default when created.
deletedeleteservice_name, user_principal_nameDelete the account MFA. Removes the MFA of the Active Directory account and returns the task. The user signs in with a password only.
disableexecserviceName, userPrincipalName, periodDisable the account MFA. Disables MFA on the Active Directory account for period hours, and returns the task.
enableexecserviceName, userPrincipalNameEnable the account MFA. Enables MFA on the Active Directory account and returns the task. MFA is enabled by default when created.
resetexecserviceName, userPrincipalNameReset the account MFA. Resets the MFA of the Active Directory account, so that the user registers again at the next sign-in. Returns the task.

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
api_hoststringThe OVHcloud API host. Selected by OVH_ENDPOINT (ovh-eu, ovh-ca or ovh-us; default ovh-eu). (default: api.eu.ovhcloud.com, x-stackQL-envVarSelector: {"envVar":"OVH_ENDPOINT","default":"ovh-eu","values":{"ovh-eu":"api.eu.ovhcloud.com","ovh-ca":"api.ca.ovhcloud.com","ovh-us":"api.us.ovhcloud.com"}})
serviceNamestringThe internal name of your Active Directory organization
service_namestringThe internal name of your Active Directory organization (wire: serviceName)
userPrincipalNamestringUser Principal Name
user_principal_namestringUser Principal Name (wire: userPrincipalName)

SELECT examples​

Get the account MFA. Returns whether MFA is activated on the Active Directory account, and its state.

SELECT
task_pending_id,
activated,
state
FROM ovh.ms_services.account_mfas
WHERE service_name = '{{ service_name }}' -- required
AND user_principal_name = '{{ user_principal_name }}' -- required
;

INSERT examples​

Create the account MFA. Creates MFA for the Active Directory account and returns the task. MFA is enabled by default when created.

INSERT INTO ovh.ms_services.account_mfas (
service_name,
user_principal_name
)
SELECT
'{{ service_name }}',
'{{ user_principal_name }}'
RETURNING
id,
finish_date,
function,
status,
todo_date
;

DELETE examples​

Delete the account MFA. Removes the MFA of the Active Directory account and returns the task. The user signs in with a password only.

DELETE FROM ovh.ms_services.account_mfas
WHERE service_name = '{{ service_name }}' --required
AND user_principal_name = '{{ user_principal_name }}' --required
;

Lifecycle Methods​

EXEC variables use wire (API) names.

Disable the account MFA. Disables MFA on the Active Directory account for period hours, and returns the task.

EXEC ovh.ms_services.account_mfas.disable
@serviceName='{{ serviceName }}' --required,
@userPrincipalName='{{ userPrincipalName }}' --required
@@json=
'{
"period": {{ period }}
}'
;