accounts
Creates, updates, deletes, gets or lists an accounts resource.
Overview​
| Name | accounts |
| Type | Resource |
| Id | ovh.ms_services.accounts |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
id | integer | Account id |
task_pending_id | integer | Pending task for this account (wire: taskPendingId) |
display_name | string | Account display name (wire: displayName) |
first_name | string | Account first name (wire: firstName) |
last_name | string | Account last name (wire: lastName) |
sam_account_name | string | SAM account name (wire: SAMAccountName) |
user_principal_name | string | User Principal Name (wire: userPrincipalName) |
city | string | city |
company | string | Company name |
country_code | string | Country 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_date | string (date-time) | Creation date (wire: creationDate) |
description | string | Description |
entra_id_synced | boolean | Is synced to Entra ID (wire: entraIdSynced) |
fax | string (phone-number) | Fax number |
guid | string | GUID for user in active directory |
initials | string | Account initials |
job_department | string | Job Department (wire: jobDepartment) |
job_title | string | Job title (wire: jobTitle) |
last_logoff_date | string (date-time) | Last logoff (wire: lastLogoffDate) |
last_logon_date | string (date-time) | Last logon (wire: lastLogonDate) |
last_update_date | string (date-time) | Last update (wire: lastUpdateDate) |
mobile | string (phone-number) | Mobile phone |
office | string | Job office |
password_last_update | string (date-time) | Time of account's password last update (wire: passwordLastUpdate) |
phone | string (phone-number) | Phone number |
postal_code | string | Postal code (wire: postalCode) |
region | string | region |
state | string | Account state (creating, deleting, disabled, modifying, ok, reopening, suspended, suspending) |
street_address | string | Street address (wire: streetAddress) |
Active Directory Account
| Name | Datatype | Description |
|---|---|---|
id | integer | Account id |
task_pending_id | integer | Pending task for this account (wire: taskPendingId) |
display_name | string | Account display name (wire: displayName) |
first_name | string | Account first name (wire: firstName) |
last_name | string | Account last name (wire: lastName) |
sam_account_name | string | SAM account name (wire: SAMAccountName) |
user_principal_name | string | User Principal Name (wire: userPrincipalName) |
city | string | city |
company | string | Company name |
country_code | string | Country 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_date | string (date-time) | Creation date (wire: creationDate) |
description | string | Description |
entra_id_synced | boolean | Is synced to Entra ID (wire: entraIdSynced) |
fax | string (phone-number) | Fax number |
guid | string | GUID for user in active directory |
initials | string | Account initials |
job_department | string | Job Department (wire: jobDepartment) |
job_title | string | Job title (wire: jobTitle) |
last_logoff_date | string (date-time) | Last logoff (wire: lastLogoffDate) |
last_logon_date | string (date-time) | Last logon (wire: lastLogonDate) |
last_update_date | string (date-time) | Last update (wire: lastUpdateDate) |
mobile | string (phone-number) | Mobile phone |
office | string | Job office |
password_last_update | string (date-time) | Time of account's password last update (wire: passwordLastUpdate) |
phone | string (phone-number) | Phone number |
postal_code | string | Postal code (wire: postalCode) |
region | string | region |
state | string | Account state (creating, deleting, disabled, modifying, ok, reopening, suspended, suspending) |
street_address | string | Street address (wire: streetAddress) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | service_name, user_principal_name | Get an Active Directory account. Returns the identity, contact details, job information, state and last logon and logoff dates of the account. | |
list | select | service_name | company, id, user_principal_name, x_pagination_mode | List Active Directory accounts. Returns the user principal names of the accounts of the Active Directory service. Filter them by company, id or userPrincipalName. |
update | update | service_name, user_principal_name | Update an Active Directory account. Updates the user principal name, names, contact details and job information of the account. | |
change_password | exec | serviceName, userPrincipalName, password | Change 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.
| Name | Datatype | Description |
|---|---|---|
api_host | string | The 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"}}) |
serviceName | string | The internal name of your Active Directory organization |
service_name | string | The internal name of your Active Directory organization (wire: serviceName) |
userPrincipalName | string | User Principal Name |
user_principal_name | string | User Principal Name (wire: userPrincipalName) |
company | string | Filter the value of company property (like) |
id | integer | Filter the value of id property (like) |
user_principal_name | string | Filter the value of userPrincipalName property (like) (wire: userPrincipalName) |
x_pagination_mode | string | Sent as CachedObjectList-Pages by default so the list returns the full objects rather than their identifiers. (wire: X-Pagination-Mode) |
SELECT examples​
- get
- list
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
;
List Active Directory accounts. Returns the user principal names of the accounts of the Active Directory service. Filter them by company, id or userPrincipalName.
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 company = '{{ company }}'
AND id = '{{ id }}'
AND user_principal_name = '{{ user_principal_name }}'
AND x_pagination_mode = '{{ x_pagination_mode }}'
;
UPDATE examples​
- update
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_password
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 }}"
}'
;