Check user existence¶
UserExists is a lightweight existence probe used before other operations (such as account creation) to determine whether a given user ID already has an Active Directory entry. It retries once with a SAIF\ prefix if the bare user ID does not resolve.
| Field | Value |
|---|---|
| Operation ID | OP-SU-08 |
| Trigger | Caller calls clsSystemUser.UserExists(inUserId) |
| Inputs | inUserId — the user ID to check |
| Outputs | Boolean result |
| Primary components | clsSystemUser.UserExists(...) |
| Entry point | Business\SAIF.Business.Security.SystemUser\clsSystemUser.vb |
Steps¶
- Attempt the direct lookup.
UserExistscallsm_DirServer.GetUser(inUserId). - Retry with a SAIF-domain prefix. If the direct lookup returns
Nothing, the method retries withm_DirServer.GetUser("SAIF\" + inUserId). - Evaluate existence.
doesExistis set toTrueif either lookup resolved a non-NothingclsUserinstance. - Return the outcome. The method returns
doesExist.
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([Caller calls UserExists]) --> Direct[m_DirServer.GetUser inUserId]
Direct --> DirectFound{Found?}
DirectFound -->|Yes| Exists([Return True])
DirectFound -->|No| Retry[m_DirServer.GetUser SAIF\ + inUserId]
Retry --> RetryFound{Found?}
RetryFound -->|Yes| Exists
RetryFound -->|No| NotExists([Return False])
Failure and edge-case behavior¶
- The
SAIF\retry only helps when the caller's ID was passed without a domain prefix and the account actually resides in theSAIFdomain; a user that only exists under a different naming form (e.g., a UPN or a differently prefixed form) will not be found by either lookup.* - The method does not distinguish "user not found" from any underlying lookup error — both
GetUsercalls are assumed to returnNothingon failure rather than throwing.*
Related documentation¶
Note: Statements marked with
*were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts.
Sources¶
Business\SAIF.Business.Security.SystemUser\clsSystemUser.vb