Local User Management Menu

The menu consists of 4 script files:

  • main.ps1

  • Event-Log.ps1

  • String-Helper.ps1

  • Users.ps1

main.ps1 Has a command line menu that loops till the user chooses the option "Exit". It uses functions from other script files.

Event-Log.ps1 Has a function you have previously developed before: getLogInAndOffs. It also has an additional function called getFailedLogins which displays the failed logins. getFailedLogins also uses a function called getMatchingLines from String-Helper.ps1 (Read the instructions of the function) in order to parse the account name and account domain from the Message property of the failed login logs.

Users.ps1 Has functions that are related to users of the local system.

Instructions

  • main.ps1 has TODO items that are waiting to be implemented. Implement them.

  • Make sure that the final script works by testing it.

    • Test the flow, inputs validation, return of results

    • Create a new user and generate some logs with that user for testing

  • Upload your final scripts to GitHub and share the link.

You might want to get the file contents copy pasted to a notepad first and then copy pasted back into scripts files of your choosing (in order to get rid of the special characters that might have been added by GitHub)

checkUser in Users.ps1

checkPassword in String-Helper.ps1

Updates to Main.ps1

Password and User requirements

When creating a user, check if the user exists, and check if password meets requirements for new user.

Check if a user exists when trying to remove the username

Check if user exists when enabling a user

Check if user exists when disabling a user

Logs

Check if user exists and get number of days to search back for the user.

At Risk Users

List users who are a risk if they have more then 10 failed logins within the specified time range

Testing

Option 1: List Enabled Users

Option 2: List Disabled Users

Option 3: Create a User

Option 4: Remove a User

Option 5: Enable a User

Option 6: Disable a User

Option 7: Get Logins

Option 8: Get Failed Logins

Option 9: List of At-Risk Users

Last updated