Forum Discussion
BenStuart
2 years agoNew Contributor III
Hi Kevin,
We use something like this on an extender rule which we run from a data management job, which is on the task scheduler to run once a day.
Case Is = ExtenderFunctionType.ExecuteDataMgmtBusinessRuleStep
' Get Users
Dim userList As List(Of UserSummaryInfo) = BRApi.Security.Admin.GetUsers(si)
' Loop through users
For Each usr As UserSummaryInfo In userList
'Get UserName
Dim objUserInfo As UserInfo = BRApi.Security.Admin.GetUser(si,usr.ToString)
'Get Remaining Allowed Inactivty
Dim inactive As String = BRApi.Security.Admin.GetUserAndStatus(si,usr.ToString).LogonStatus.GetNumDaysOfRemainingAllowedInactivity()
'If the user is currently enabled
If objUserInfo.User.IsEnabled = True Then
'If no remaining allowed inactivty
If inactive = "0" Then
'Disable user
objUserInfo.User.IsEnabled = False
'Save User
BRApi.Security.Admin.SaveUser(si, objUserInfo.User, False, Nothing, TriStateBool.Unknown)
End If
End If
Next
Related Content
- 3 years ago
- 8 months ago
- 2 years ago
- 3 years ago