ChangeUserAccount (OP-09)¶
Request and response¶
| Part | Type | Description |
|---|---|---|
inUserId |
String |
The SamAccountName of the account to update. |
inGivenName |
String |
Written to GivenName only when non-empty, setting modified = True. |
inSurName |
String |
Written to Surname only when non-empty, setting modified = True. |
inDescription |
String |
Written to Description only when non-empty, setting modified = True. |
inPhoneNum |
String |
Written to telephoneNumber only when non-empty, setting modified = True. |
inMailAddr |
String |
Written to mail only when non-empty, setting modified = True. |
inTitle |
String |
Written to title only when non-empty, setting modified = True. |
inInfo |
String |
Written to info only when non-empty; does not set modified. |
inCompany |
String |
Written to company only when non-empty; does not set modified. |
inFAXNum |
String |
Written to facsimileTelephoneNumber only when non-empty, setting modified = True. |
| Part | Type | Description |
|---|---|---|
<return> |
ADServiceResponse |
Response is Success, UserDoesNotExist, or Failure. Message carries the caught exception text on a Failure, otherwise empty. |
WebMethod attributes¶
<WebMethod()> — bare, no arguments supplied.
Steps¶
CheckAccess(); on denial returnAccessDenied()(BR-01).- Call H1
GetContextfor the external domain. - Initialize the response sentinel to
Success; set localmodified = False. - Open
Try. UserPrincipal.FindByIdentity(prinContext, inUserId)directly — this operation does not use H2, so aNothingcontext would fault here rather than being swallowed*.- If
Nothing, setResponse = UserDoesNotExist. - Else set
GivenName,Surname, andDescriptiononly when the matching input is non-empty, settingmodified = Truefor each write (BR-23). - If
modified, calluserPrin.Save(). - Reset
modified = False;de = userPrin.GetUnderlyingObject. - Write
company(without settingmodified— tech debt TD-19),telephoneNumber,mail,title,info(without settingmodified— tech debt TD-19), andfacsimileTelephoneNumber, each only when the matching input is non-empty (BR-13). - If
modified, callde.CommitChanges()(BR-24) — a request that changes onlyinCompanyand/orinInforeturnsSuccesshaving committed nothing (tech debt TD-19, HIGH — see Tech debt). Catch ex As Exception→ setResponse = Failure,Message = ex.Message.Finallyreleasesde,prinContext, anduserPrin.- Return the response sentinel.
Process flow¶
flowchart TD
A["Call ChangeUserAccount"] --> B{"CheckAccess<br>HasAccess?"}
B -->|"No"| C["Return AccessDenied"]
B -->|"Yes"| D["FindByIdentity direct<br>no H2 wrapper"]
D -->|"Nothing"| E["Set UserDoesNotExist"]
D -->|"Found"| F["Set GivenName/Surname<br>Description if non-empty"]
F --> G{"modified?"}
G -->|"Yes"| H["userPrin.Save"]
G -->|"No"| I["Skip Save"]
H --> J["Reset modified = False"]
I --> J
J --> K["Write company/info<br>without setting modified"]
K --> L["Write phone/mail/title/fax<br>setting modified"]
L --> M{"modified?"}
M -->|"Yes"| N["de.CommitChanges"]
M -->|"No"| O["Skip CommitChanges<br>company/info silently lost"]
N --> P["Return response"]
O --> P
E --> P
D -.->|"Exception"| Q["Set Failure + ex.Message"]
Q --> P
Shared state effects¶
None — this operation touches no process-wide state; all locals are per-request.
Error handling¶
The operation returns a sentinel ADServiceResponse for every outcome inside the Try block. It never surfaces a framework SOAP fault from a caught failure, but because FindByIdentity is called directly rather than through H2, a Nothing context (rather than a resolvable-vs-unresolvable user) would still be caught by the same Try/Catch and reported as Failure*. See Faults for the service-wide fault model.
Authorization¶
Gated by BR-01: the caller must pass the IP allow-list check enforced by CheckAccess. See Authentication and authorization.
Note: Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with ** could not be confirmed; treat as unknown until verified.
Related documentation¶
- Service index
- Overview
- Architecture
- Activation and hosting
- Operations
- Operations and processes
- Business rules
- Authentication and authorization
- Configuration
- Dependencies
- Faults
- Operational runbook
- Tech debt
Sources¶
src\ADUserServices\clsADUserServices.asmx.vb(lines 388-469)