Logon Status Code Definitions

cap08
New Contributor II

Hello, where can I find the definitions of the LogonStatus codes in the UserLogonActivity table? I checked the design document and didn't see them there.

Thanks! 

2 ACCEPTED SOLUTIONS

JJones
New Contributor II

These are not documented in the OneStream documentation, however I can provide some of them here for you:

Logged On: 0

Failed Logon Attempt: 1

Logged Off by User: 2

Logged off By System: 4

 Hope this is able to answer your question.

View solution in original post

MarcusH
Contributor III

You can get the items in an Enum type object with this code:

Dim msg As String = String.Empty

Dim enumType As Type = GetType(LogonStatus)
Dim names As String() = System.Enum.GetNames(enumType)
Dim values As Integer() = System.Enum.GetValues(enumType)				
For I As Integer = 0 To names.Length-1
    msg &= $"{vbCrLf} - {names(I)}, {values(I)}"
Next
BRApi.ErrorLog.LogMessage(si, msg)

That gives a list like this:

- LoggedOn, 0
- FailedLogonAttempt, 1
- LoggedOffByUser, 2
- LoggedOffByAdmin, 3
- LoggedOffBySystem, 4
- ImportedItem, 99999
- Unknown, -1

You can then use it for other Enum objects such as TaskActivityType and TaskActivityStatus.

There is an example in the System Diagnostics app in OSD_SolutionHelper (the unencrypted one obviously).

View solution in original post

4 REPLIES 4

JJones
New Contributor II

These are not documented in the OneStream documentation, however I can provide some of them here for you:

Logged On: 0

Failed Logon Attempt: 1

Logged Off by User: 2

Logged off By System: 4

 Hope this is able to answer your question.

cap08
New Contributor II

Thanks JJones!

MarcusH
Contributor III

You can get the items in an Enum type object with this code:

Dim msg As String = String.Empty

Dim enumType As Type = GetType(LogonStatus)
Dim names As String() = System.Enum.GetNames(enumType)
Dim values As Integer() = System.Enum.GetValues(enumType)				
For I As Integer = 0 To names.Length-1
    msg &= $"{vbCrLf} - {names(I)}, {values(I)}"
Next
BRApi.ErrorLog.LogMessage(si, msg)

That gives a list like this:

- LoggedOn, 0
- FailedLogonAttempt, 1
- LoggedOffByUser, 2
- LoggedOffByAdmin, 3
- LoggedOffBySystem, 4
- ImportedItem, 99999
- Unknown, -1

You can then use it for other Enum objects such as TaskActivityType and TaskActivityStatus.

There is an example in the System Diagnostics app in OSD_SolutionHelper (the unencrypted one obviously).

cap08
New Contributor II

Thank you so much! 

Please sign in! cap08