Posts

Showing posts with the label Scripting

Computer Management bat files - Part 4: User Management Script

In today's article we are going to take all of our work and combine it into one large management script. If you haven't read it you may want to start at article one  Computer management bat files - Part 1: Users ,   Computer management bat files - Part 2: Groups , and  Computer Management bat files - Part 3: Menu script Completed Script All the above scripts added into one with a menu system: @echo off :UserMenu CLS echo ============Users Menu============ echo. echo ============Users============ Net User echo. echo ============Groups============ Net Localgroup echo. echo Choose An option: echo 1. View a User echo 2. Add a User echo 3. Disable a User echo 4. Enable a User echo 5. Change User Password echo 6. Add User to group echo 7. List Users of a group echo 8. Remove User from group echo Q. Back To Main Menu SET INPUT= SET /P INPUT=Please select a number: IF /I '%INPUT%'=='8' goto REMGroup IF /I '%IN...

Computer Management bat files - Part 3: Menu script

Image
In today's article we are going over how to create a menu for our users and groups management script. If you haven't read it you may want to start at article one  Computer management bat files - Part 1: Users  and  Computer management bat files - Part 2: Groups Menu Script This is really simple we are just going to follow the same techniques we used in our other scripts but this time lay our a menu using echo, set, if, and a variable to let the user select a number on the menu. @echo off :UserMenu CLS echo ============Users Menu============ echo. echo ============Users============ Net User echo. echo ============Groups============ Net Localgroup echo. echo Choose An option: echo 1. View a User echo 2. Add a User echo 3. Disable a User echo 4. Enable a User echo 5. Change User Password echo 6. Add User to group echo 7. List Users of a group echo 8. Remove User from group echo Q. Back To Main Menu SET INPUT= SET /P INPU...

Computer Management bat files - Part 2: Groups

Image
In today's article we are going over how to manage groups with a set of simple batch files. If you haven't read it you may want to start at article one  Computer management bat files - Part 1: Users . Group Management Scripts The first part of our scripting is to create scripts for managing user accounts. We will create individual scripts for viewing, adding, enabling, disabling, user accounts as well as changing their passwords. How to list groups To list groups is a simple command Net Localgroup This will list all the groups on your computer as shown in the picture below. List users in a Group So know that we know how to list the groups, lets create a script that lists the users in those groups. @echo off :ListGroups Net localgroup setlocal EnableDelayedExpansion echo  Type Below Requirements: echo. :group set /p grp= Type Group: if [!grp!]==[...

Computer Management bat files - Part 1: Users

Image
So my game plan with this is a series of blogs on how to use bat files to create a bigger computer management script that could be used for hardening your system. I will be taking this by sections as a lot will go into this. The final article will be adding it all together to create one large script. In today's article we are going over how to manage users with a set of simple batch files. User Management Scripts The first part of our scripting is to create scripts for managing user accounts. We will create individual scripts for viewing, adding, enabling, disabling, user accounts as well as changing their passwords. How to list users To list users is a simple command Net User This will list all the users on your computer as shown in the picture below. View users account Script Now that we know the users names lets write a script that will allow us to view their user details. we want this script though to not just list a single user but be one we can continue...