Skip to main content

service_accounts

Creates, updates, deletes, gets or lists a service_accounts resource.

Overview​

Nameservice_accounts
TypeResource
Idovh.email_exchange.service_accounts

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
idintegerAccount id
authentication_policy_idintegerID of the authentication policy to apply on this account (wire: authenticationPolicyId)
custom_isolation_idintegercustom isolation apply on this account (wire: customIsolationId)
send_connector_idintegerCustom sendConnectorId used to send mails when SBR is configured (wire: sendConnectorId)
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)
account_licensestringExchange account type (basic, enterprise, standard) (wire: accountLicense)
citystringcity
companystringCompany name
configuredbooleanIndicates if the account is configured
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)
current_usageintegerMailbox usage (wire: currentUsage)
delete_at_expirationbooleandelete at expiration (wire: deleteAtExpiration)
delete_outlook_at_expirationbooleandelete outlook at expiration (wire: deleteOutlookAtExpiration)
descriptionstringDescription
domainstringEmail domain
exchange_guidstringexchangeGuid for manual configuration (wire: exchangeGuid)
expiration_datestring (date-time)expiration date (wire: expirationDate)
expiration_outlook_datestring (date-time)expiration date (wire: expirationOutlookDate)
faxstring (phone-number)Fax number
forwarding_emailstringEmail address to forward email (wire: forwardingEmail)
guidstringGUID for user in active directory
hidden_from_galbooleanHide account in Global Address List (wire: hiddenFromGAL)
initialstringAccount 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)
litigationbooleanLitigation hold feature enabled on this mailbox
litigation_periodintegerLitigation hold period in days (0 means unlimited). This setting covers all items in the mailbox. (wire: litigationPeriod)
loginstringAccount login
mail_sender_displaystringEmail display as sender (wire: mailSenderDisplay)
mailing_filterarrayEnable or disable anti-virus and anti-spam (wire: mailingFilter)
mobilestring (phone-number)Mobile phone
number_of_aliasesintegerCount the number of related aliases attached to this account (wire: numberOfAliases)
officestringJob office
outlook_licensebooleanOutlook licence (wire: outlookLicense)
owa_limitedbooleanOWA policy restriction is applied (wire: owaLimited)
password_last_updatestring (date-time)Time of account's password last update (wire: passwordLastUpdate)
phonestring (phone-number)Phone number
postal_codestringPostal code (wire: postalCode)
primary_email_addressstringDefault email for this mailbox (wire: primaryEmailAddress)
quotaintegerAccount maximum size
regionstringregion
renew_outlook_periodstringchange the renew period for outlook (monthly, yearly) (wire: renewOutlookPeriod)
renew_periodstringchange the renew period (monthly, yearly) (wire: renewPeriod)
sbr_destinationstringRelay domain address that will be used to all e-mails send from this account (wire: sbrDestination)
spam_and_virus_configurationobjectSpam and Antivirus configuration (wire: spamAndVirusConfiguration)
spam_detectedbooleanAccount was sending spam (wire: spamDetected)
spam_ticket_numberintegerTicket number of spam detection (wire: spamTicketNumber)
statestringAccount state (creating, deleting, internalMigration, ok, reopening, suspended, suspending)
store_copy_of_emailbooleanStore copy of email when forward is enable (wire: storeCopyOfEmail)
street_addressstringStreet address (wire: streetAddress)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectexchange_service, organization_name, primary_email_addressGet an email account. Returns the login, names, license, quota, usage, state, spam settings, forwarding, litigation hold and contact details of the email account.
listselectexchange_service, organization_nameaccount_license, company, id, primary_email_address, x_pagination_modeList email accounts. Returns the primary email addresses of the email accounts. Filter them by primaryEmailAddress, id, accountLicense or company.
createinsertexchange_service, organization_name, domain, license, login, passwordCreate an email account. Creates an email account from a login, a domain, a password and a license, and returns the task. Set quota in GB.
updateupdateexchange_service, organization_name, primary_email_addressUpdate an email account. Updates the names, license, quota, renewal, forwarding, litigation hold, spam settings, authentication policy and contact details of the email account.
deletedeleteexchange_service, organization_name, primary_email_addressDelete an email account. Deletes the email account and returns the task. On Hosted Exchange, the account is reset instead: its content is deleted and it becomes an unconfigured slot in configureme.me that keeps its subscription.
change_passwordexecexchangeService, organizationName, primaryEmailAddressChange an email account password. Changes the password and returns the task. Set forcePasswordChangeAtNextLogon to make the user change it at the next logon.
terminateexecexchangeService, organizationName, primaryEmailAddressTerminate an email account at expiration. Sets the email account to be suspended at its expiration date, and returns a message giving that date. Set deleteAtExpiration to false on the account to cancel.

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"}})
exchangeServicestringThe internal name of your exchange service
exchange_servicestringThe internal name of your exchange service (wire: exchangeService)
organizationNamestringThe internal name of your exchange organization
organization_namestringThe internal name of your exchange organization (wire: organizationName)
primaryEmailAddressstringDefault email for this mailbox
primary_email_addressstringDefault email for this mailbox (wire: primaryEmailAddress)
account_licensestringFilter the value of accountLicense property (=) (wire: accountLicense)
companystringFilter the value of company property (like)
idintegerFilter the value of id property (like)
primary_email_addressstringFilter the value of primaryEmailAddress property (like) (wire: primaryEmailAddress)
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 email account. Returns the login, names, license, quota, usage, state, spam settings, forwarding, litigation hold and contact details of the email account.

SELECT
id,
authentication_policy_id,
custom_isolation_id,
send_connector_id,
task_pending_id,
display_name,
first_name,
last_name,
sam_account_name,
account_license,
city,
company,
configured,
country_code,
creation_date,
current_usage,
delete_at_expiration,
delete_outlook_at_expiration,
description,
domain,
exchange_guid,
expiration_date,
expiration_outlook_date,
fax,
forwarding_email,
guid,
hidden_from_gal,
initial,
job_department,
job_title,
last_logoff_date,
last_logon_date,
last_update_date,
litigation,
litigation_period,
login,
mail_sender_display,
mailing_filter,
mobile,
number_of_aliases,
office,
outlook_license,
owa_limited,
password_last_update,
phone,
postal_code,
primary_email_address,
quota,
region,
renew_outlook_period,
renew_period,
sbr_destination,
spam_and_virus_configuration,
spam_detected,
spam_ticket_number,
state,
store_copy_of_email,
street_address
FROM ovh.email_exchange.service_accounts
WHERE exchange_service = '{{ exchange_service }}' -- required
AND organization_name = '{{ organization_name }}' -- required
AND primary_email_address = '{{ primary_email_address }}' -- required
;

INSERT examples​

Create an email account. Creates an email account from a login, a domain, a password and a license, and returns the task. Set quota in GB.

INSERT INTO ovh.email_exchange.service_accounts (
sam_account_name,
authentication_policy_id,
city,
company,
country_code,
description,
display_name,
domain,
fax,
first_name,
forwarding_email,
hidden_from_gal,
initials,
job_department,
job_title,
last_name,
license,
litigation,
litigation_period,
login,
mail_sender_display,
mailing_filter,
mobile,
office,
outlook_license,
password,
phone,
postal_code,
quota,
region,
sbr_destination,
send_connector_id,
spam_and_virus_configuration,
store_copy_of_email,
street_address,
exchange_service,
organization_name
)
SELECT
'{{ sam_account_name }}',
{{ authentication_policy_id }},
'{{ city }}',
'{{ company }}',
'{{ country_code }}',
'{{ description }}',
'{{ display_name }}',
'{{ domain }}' /* required */,
'{{ fax }}',
'{{ first_name }}',
'{{ forwarding_email }}',
{{ hidden_from_gal }},
'{{ initials }}',
'{{ job_department }}',
'{{ job_title }}',
'{{ last_name }}',
'{{ license }}' /* required */,
{{ litigation }},
{{ litigation_period }},
'{{ login }}' /* required */,
'{{ mail_sender_display }}',
'{{ mailing_filter }}',
'{{ mobile }}',
'{{ office }}',
{{ outlook_license }},
'{{ password }}' /* required */,
'{{ phone }}',
'{{ postal_code }}',
{{ quota }},
'{{ region }}',
'{{ sbr_destination }}',
{{ send_connector_id }},
'{{ spam_and_virus_configuration }}',
{{ store_copy_of_email }},
'{{ street_address }}',
'{{ exchange_service }}',
'{{ organization_name }}'
RETURNING
id,
finish_date,
function,
status,
todo_date
;

UPDATE examples​

Update an email account. Updates the names, license, quota, renewal, forwarding, litigation hold, spam settings, authentication policy and contact details of the email account.

UPDATE ovh.email_exchange.service_accounts
SET
account_license = '{{ account_license }}',
authentication_policy_id = {{ authentication_policy_id }},
city = '{{ city }}',
company = '{{ company }}',
country_code = '{{ country_code }}',
delete_at_expiration = {{ delete_at_expiration }},
delete_outlook_at_expiration = {{ delete_outlook_at_expiration }},
description = '{{ description }}',
display_name = '{{ display_name }}',
domain = '{{ domain }}',
fax = '{{ fax }}',
first_name = '{{ first_name }}',
forwarding_email = '{{ forwarding_email }}',
hidden_from_gal = {{ hidden_from_gal }},
initial = '{{ initial }}',
job_department = '{{ job_department }}',
job_title = '{{ job_title }}',
last_name = '{{ last_name }}',
litigation = {{ litigation }},
litigation_period = {{ litigation_period }},
login = '{{ login }}',
mail_sender_display = '{{ mail_sender_display }}',
mailing_filter = '{{ mailing_filter }}',
mobile = '{{ mobile }}',
office = '{{ office }}',
outlook_license = {{ outlook_license }},
phone = '{{ phone }}',
postal_code = '{{ postal_code }}',
quota = {{ quota }},
region = '{{ region }}',
renew_outlook_period = '{{ renew_outlook_period }}',
renew_period = '{{ renew_period }}',
sbr_destination = '{{ sbr_destination }}',
send_connector_id = {{ send_connector_id }},
spam_and_virus_configuration = '{{ spam_and_virus_configuration }}',
store_copy_of_email = {{ store_copy_of_email }},
street_address = '{{ street_address }}'
WHERE
exchange_service = '{{ exchange_service }}' --required
AND organization_name = '{{ organization_name }}' --required
AND primary_email_address = '{{ primary_email_address }}' --required;

DELETE examples​

Delete an email account. Deletes the email account and returns the task. On Hosted Exchange, the account is reset instead: its content is deleted and it becomes an unconfigured slot in configureme.me that keeps its subscription.

DELETE FROM ovh.email_exchange.service_accounts
WHERE exchange_service = '{{ exchange_service }}' --required
AND organization_name = '{{ organization_name }}' --required
AND primary_email_address = '{{ primary_email_address }}' --required
;

Lifecycle Methods​

EXEC variables use wire (API) names.

Change an email account password. Changes the password and returns the task. Set forcePasswordChangeAtNextLogon to make the user change it at the next logon.

EXEC ovh.email_exchange.service_accounts.change_password
@exchangeService='{{ exchangeService }}' --required,
@organizationName='{{ organizationName }}' --required,
@primaryEmailAddress='{{ primaryEmailAddress }}' --required
@@json=
'{
"forcePasswordChangeAtNextLogon": {{ forcePasswordChangeAtNextLogon }},
"password": "{{ password }}"
}'
;