-
Notifications
You must be signed in to change notification settings - Fork 906
Auto Disable the Service Accounts due to inactivity #1646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto Disable the Service Accounts due to inactivity #1646
Conversation
This schedule job script will help to auto disable the service accounts which has not been logged in or used for last 40 days.
This file gives the information about the above file for auto disabling the service accounts
ravichandra1998g
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello Abhishek,
Transaction logs table is one of the largest tables in the instance which stores all the user/background transactions.
querying it for the last 40 days would have performance implications on the system.
Can you optimize the script for the performance?
ravichandra1998g
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The script seems to print an array of user names,
Please modify it as per the description. (auto disabling)
This is for disabling the Service account due to inactivity
|
Hello @ravichandra1998g , Thanks for the validation. As requested, I have made some certain changes by optimizing the performance impact. Not this looks good from my end in terms of system performance. Please review it and let me know, if any changes are required. |
|
This applies to all the users as there is no filter to include only service accounts.. please add the filter. |
This code helps to disable the service account due to inactivity for last 30 days.
|
Hello @ravichandra1998g , Again, thanks for the validation. I have applied the filter for only service account. Please validate it and let me know, if anything needs to be changed. |
ravichandra1998g
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good now
This schedule job script will help to auto disable the service accounts which has not been logged in or used for last 30 days. This can be helpful for those who are looking to disable the accounts based on some certain time period.