Some scripts to manage and monitor your users by Group policy on Windows server 2008

Hi everyone.
Today, I will share with you some script to manage and monitor your user in Domain controller by Group Policy on Windows server 2008.
Step 1: Make sure your server has been promoted to domain controller.
Step 2: Click Start button and search: Group Policy Management.
Step 3: Right click on Edit Domain/Your domain/Default Domain Policy to edit policy will apply on all Group, OU, User of your domain.


Step 4: Go to User Configuration/Polices/Windows Settings/Scripts (Logon/Login)


Step 5: Double click on Login or Logoff and add file corresponding.
a. Script to monitor your user login and logoff status from computer in your domain.
The content of Logon.bat
echo User: %username% logged on to %computername% at %time% - %date% >> "\\your_folder_address_shared_on_server\%username%.txt"
The content of Logoff.bat
echo User: %username% logged out from %computername% at %time% - %date% >> "\\your_folder_address_shared_on_server\%username%.txt"
b. Script to sync time between user's computer with domain controller.
The content of Logon.bat
net time \\ip_your_domain /set /y
c. Show notification before use their computer
The content of Logon.vbs
Set objShell = CreateObject("Wscript.Shell")
intMessage = MsgBox("Hello" & vbCr _
        & vbCr _
        & "Please read the rules before use.", _
        vbYesNo, "There is a problem...")
If intMessage = vbYes Then
    objShell.Run ("http://your_domain")
Else
    Wscript.Quit
End If

Updating...