Purposes:
-
Mapping network drives
-
Installing and setting a user’s default printer
-
Collecting computer system information
-
Updating virus signatures
-
Updating software
Implementation (2 methods)
1. Profile tab of the user properties dialog in the Active Directory Users and Computers (ADUC)
-
Place script here: %SystemRoot%\SYSVOL\sysvol\kimconnect.com\scripts
-
Give “Domain Users” permission to read+execute the script and “Domain Computers” group access to resources that the script requires
-
Run “dsa.msc” >> locate user >> right-click, select “Properties” >> go to “Profile” tab >> paste the path of the logon script into field next to “Logon Script:”
-
Test a user account logon & logoff to verify
2. Group Policy Objects (GPO)
-
Place script here: %SystemRoot%\SYSVOL\sysvol\kimconnect.com\Policies\{GUID}\User\Scripts\Logon
-
Give “Domain Users” permission to read+execute the script and “Domain Computers” group access to resources that the script requires
-
Add Group Policy Management console to the computer that is used to perform assignment of script to GPO
-
Run “gpmc.msc” >> Right-click the domain name and select Create and Link a GPO Here (if scope of script applies to entire domain) >> type in a name for the script >> press OK >> press F5 to refresh GPMC >> find and right-click on the newly created GPO to select Edit >> Group Policy Object Editor window opens, expand User Configuration > Windows Settings > Scripts >> double-click “Logon” >> click “Show Files” >> paste the logon script into the location (such as \\kimconnect.com\SYSVOL\kimconnect.com\Policies\{GUID}\User\Scripts\Logon >> back to Logon Properties windows, click ADD >> click Browse >> select the script >> click OK
-
Run CMD as Domain Administrator >> type “repadmin /syncall {DC1} dc=kimconnect,dc=com”
-
Test a user account logon & logoff to verify
REM "logon.bat"
@echo off
set HOME=\\SERVER01\users\home\%USERNAME%
net use * /delete /yes
net use i: \\SERVER01\ftp1\
net use h: \\SERVER01\Users\home\%username%
net use f: \\SERVER01\yamama\
NET USE [LPTx:] "\\PRINT01\HP LaserJet 8000 Series PCL" /PERSISTENT:YES
NET USE [LPTx:] "\\PRINT01\HP Color LaserJet 3700 PCL 6" /PERSISTENT:YES
NET USE [LPTx:] "\\PRINT01\HP LaserJet 4350 PCL 6" /PERSISTENT:YES
Any changes to print server and Data mapped drives will affect current logon scripts...
Systems Users
' -----------------------------------------------------------------'
Option Explicit
Dim objNetwork1, strRemotePath1, strRemotePath2
Dim strDriveLetter1, strDriveLetter2
strDriveLetter1 = "P:"
strDriveLetter2 = "T:"
strRemotePath1 = "\\FILESERVER01\public"
strRemotePath2 = "\\FILESERVER01\systems"
Set objNetwork1 = CreateObject("WScript.Network")
' Section which maps two drives, M: and P:
objNetwork1.MapNetworkDrive strDriveLetter1, strRemotePath1
objNetwork1.MapNetworkDrive strDriveLetter2, strRemotePath2
' Printer Section
' ------------------------------------------------------------------------------'
' Option Explicit
Dim objNetwork2, strUNCPrinter2
strUNCPrinter2 = "\\FILESERVER01\prt-sys-3010"
Set objNetwork2 = CreateObject("WScript.Network")
objNetwork2.AddWindowsPrinterConnection strUNCPrinter2
WScript.Quit
' End of script.
Accounting Users
' -----------------------------------------------------------------'
Option Explicit
Dim objNetwork1, strRemotePath1, strRemotePath2
Dim strDriveLetter1, strDriveLetter2
strDriveLetter1 = "P:"
strDriveLetter2 = "T:"
strRemotePath1 = "\\FILESERVER01\public"
strRemotePath2 = "\\FILESERVER01\accounting"
Set objNetwork1 = CreateObject("WScript.Network")
' Section which maps two drives, M: and P:
objNetwork1.MapNetworkDrive strDriveLetter1, strRemotePath1
objNetwork1.MapNetworkDrive strDriveLetter2, strRemotePath2
' Printer Section
' ------------------------------------------------------------------------------'
' Option Explicit
'Dim objNetwork2, strUNCPrinter
'strUNCPrinter = "\\FILESERVER01\underwritingprinter"
'Set objNetwork2 = CreateObject("WScript.Network")
'objNetwork2.AddWindowsPrinterConnection strUNCPrinter
WScript.Quit
' End of script.
Categories: