Custom GPO Lab - Zacham17/my-tech-journal GitHub Wiki
- In this lab, I used RSAT to connect to one of my domain controllers and create a custom GPO using batch and PowerShell scripts.
- In this lab, I installed the Group Policy Management tools for RSAT on wks02 using the command,
DISM.exe /Online /add-capability /CapabilityName:Rsat.GroupPolicy.Management.Tools~~~~0.0.1.0
- I then used RSAT on wks02 to manage group policies on ad01.
- I wrote a batch file and a PowerShell script, which create a file to tell a user when they logged onto the system.
- I created a group policy that uses the files I created to tell a user what time they logged on whenever they log on.
- This lab was the first time I created a custom GPO and it was also the first time I used a batch file and PowerShell script to do so.
- While writing my code, I learned about
$ENV:USERPROFILE
, which defaults to the path, C:\users\<username>, where <username> is the user that is logging on. This makes it so that I don't have to specify each user that could log on. - Something else new that I learned about was the
%~dp0
, which is a short way to specify the full path to the location of the script that it is used in.
The following are links to the code for the files I used to create the GPO for this lab: