DeleteUser (OP-05)¶
Request and response¶
| Part | Type | Description |
|---|---|---|
inUserId |
String |
The SamAccountName of the account to delete. |
| Part | Type | Description |
|---|---|---|
<return> |
ADServiceResponse |
Response is Success (including when no principal was found) 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 into an unused local. - Call H2
GetUserPrincipalfor the external domain. - Initialize the response sentinel to
Success. - If a principal was found:
userPrin.Delete()insideTry.- On exception, set
Response = Failure,Message = ex.Message.
- On exception, set
Finallyreleases the principal.- If no principal was found, do nothing and fall through (BR-18) — a non-existent user and a directory-lookup failure both return
Success; deletion is reported as idempotent but is not distinguishable from a silent failure. - Return the response sentinel.
Process flow¶
flowchart TD
A["Call DeleteUser"] --> B{"CheckAccess<br>HasAccess?"}
B -->|"No"| C["Return AccessDenied"]
B -->|"Yes"| D["GetUserPrincipal<br>external domain"]
D -->|"Found"| E["userPrin.Delete<br>in Try/Catch"]
E -.->|"Exception"| F["Set Failure + ex.Message"]
E --> G["Return response"]
F --> G
D -->|"Nothing"| H["Fall through<br>leave Success"]
H --> G
Shared state effects¶
None — this operation touches no process-wide state; all locals are per-request.
Error handling¶
The operation always returns a sentinel ADServiceResponse. It never surfaces a framework SOAP fault from a caught Delete() 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.
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 270-295)