Skip to main content

accounts

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

Overview​

Nameaccounts
TypeResource
Idovh.ms_services.accounts

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
idintegerAccount id
task_pending_idintegerPending task for this account (wire: taskPendingId)
display_namestringAccount display name (wire: displayName)
first_namestringAccount first name (wire: firstName)
last_namestringAccount last name (wire: lastName)
sam_account_namestringSAM account name (wire: SAMAccountName)
user_principal_namestringUser Principal Name (wire: userPrincipalName)
citystringcity
companystringCompany name
country_codestringCountry code (AC, AD, AE, AF, AG, AI, AL, AM, AO, AQ, AR, AS, AT, AU, AW, AX, AZ, BA, BB, BD, BE, BF, BG, BH, BI, BJ, BL, BM, BN, BO, BQ, BR, BS, BT, BW, BY, BZ, CA, CC, CD, CF, CG, CH, CI, CK, CL, CM, CN, CO, CR, CU, CV, CW, CX, CY, CZ, DE, DG, DJ, DK, DM, DO, DZ, EA, EC, EE, EG, EH, ER, ES, ET, FI, FJ, FK, FM, FO, FR, GA, GB, GD, GE, GF, GG, GH, GI, GL, GM, GN, GP, GQ, GR, GS, GT, GU, GW, GY, HK, HN, HR, HT, HU, IC, ID, IE, IL, IM, IN, IO, IQ, IR, IS, IT, JE, JM, JO, JP, KE, KG, KH, KI, KM, KN, KP, KR, KW, KY, KZ, LA, LB, LC, LI, LK, LR, LS, LT, LU, LV, LY, MA, MC, MD, ME, MF, MG, MH, MK, ML, MM, MN, MO, MP, MQ, MR, MS, MT, MU, MV, MW, MX, MY, MZ, NA, NC, NE, NF, NG, NI, NL, NO, NP, NR, NU, NZ, OM, PA, PE, PF, PG, PH, PK, PL, PM, PN, PR, PS, PT, PW, PY, QA, RE, RO, RS, RU, RW, SA, SB, SC, SD, SE, SG, SH, SI, SJ, SK, SL, SM, SN, SO, SR, SS, ST, SV, SX, SY, SZ, TA, TC, TD, TF, TG, TH, TJ, TK, TL, TM, TN, TO, TR, TT, TV, TW, TZ, UA, UG, UM, US, UY, UZ, VA, VC, VE, VG, VI, VN, VU, WF, WS, XK, YE, YT, ZA, ZM, ZW) (wire: countryCode)
creation_datestring (date-time)Creation date (wire: creationDate)
descriptionstringDescription
entra_id_syncedbooleanIs synced to Entra ID (wire: entraIdSynced)
faxstring (phone-number)Fax number
guidstringGUID for user in active directory
initialsstringAccount initials
job_departmentstringJob Department (wire: jobDepartment)
job_titlestringJob title (wire: jobTitle)
last_logoff_datestring (date-time)Last logoff (wire: lastLogoffDate)
last_logon_datestring (date-time)Last logon (wire: lastLogonDate)
last_update_datestring (date-time)Last update (wire: lastUpdateDate)
mobilestring (phone-number)Mobile phone
officestringJob office
password_last_updatestring (date-time)Time of account's password last update (wire: passwordLastUpdate)
phonestring (phone-number)Phone number
postal_codestringPostal code (wire: postalCode)
regionstringregion
statestringAccount state (creating, deleting, disabled, modifying, ok, reopening, suspended, suspending)
street_addressstringStreet address (wire: streetAddress)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectservice_name, user_principal_nameGet an Active Directory account. Returns the identity, contact details, job information, state and last logon and logoff dates of the account.
listselectservice_namecompany, id, user_principal_name, x_pagination_modeList Active Directory accounts. Returns the user principal names of the accounts of the Active Directory service. Filter them by company, id or userPrincipalName.
updateupdateservice_name, user_principal_nameUpdate an Active Directory account. Updates the user principal name, names, contact details and job information of the account.
change_passwordexecserviceName, userPrincipalName, passwordChange the Active Directory password. Changes the password of the Active Directory account and 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)
companystringFilter the value of company property (like)
idintegerFilter the value of id property (like)
user_principal_namestringFilter the value of userPrincipalName property (like) (wire: userPrincipalName)
x_pagination_modestringSent as CachedObjectList-Pages by default so the list returns the full objects rather than their identifiers. (wire: X-Pagination-Mode)

SELECT examples​

Get an Active Directory account. Returns the identity, contact details, job information, state and last logon and logoff dates of the account.

SELECT
id,
task_pending_id,
display_name,
first_name,
last_name,
sam_account_name,
user_principal_name,
city,
company,
country_code,
creation_date,
description,
entra_id_synced,
fax,
guid,
initials,
job_department,
job_title,
last_logoff_date,
last_logon_date,
last_update_date,
mobile,
office,
password_last_update,
phone,
postal_code,
region,
state,
street_address
FROM ovh.ms_services.accounts
WHERE service_name = '{{ service_name }}' -- required
AND user_principal_name = '{{ user_principal_name }}' -- required
;

UPDATE examples​

Update an Active Directory account. Updates the user principal name, names, contact details and job information of the account.

UPDATE ovh.ms_services.accounts
SET
city = '{{ city }}',
company = '{{ company }}',
country_code = '{{ country_code }}',
description = '{{ description }}',
display_name = '{{ display_name }}',
entra_id_synced = {{ entra_id_synced }},
fax = '{{ fax }}',
first_name = '{{ first_name }}',
initials = '{{ initials }}',
job_department = '{{ job_department }}',
job_title = '{{ job_title }}',
last_name = '{{ last_name }}',
mobile = '{{ mobile }}',
office = '{{ office }}',
phone = '{{ phone }}',
postal_code = '{{ postal_code }}',
region = '{{ region }}',
street_address = '{{ street_address }}',
user_principal_name = '{{ user_principal_name }}'
WHERE
service_name = '{{ service_name }}' --required
AND user_principal_name = '{{ user_principal_name }}' --required;

Lifecycle Methods​

EXEC variables use wire (API) names.

Change the Active Directory password. Changes the password of the Active Directory account and returns the task.

EXEC ovh.ms_services.accounts.change_password
@serviceName='{{ serviceName }}' --required,
@userPrincipalName='{{ userPrincipalName }}' --required
@@json=
'{
"password": "{{ password }}"
}'
;