User Tools

Site Tools


networking:windows:logon_script

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
networking:windows:logon_script [2012/05/12 13:25]
gcooper
networking:windows:logon_script [2013/12/15 12:15] (current)
gcooper
Line 1: Line 1:
 ====== Login Scripts ====== ====== Login Scripts ======
 +
 +See also **[[networking:windows:logon_script_modular|Modular Logon Script]]**
  
 http://www.rlmueller.net/LogonScriptFAQ.htm http://www.rlmueller.net/LogonScriptFAQ.htm
Line 28: Line 30:
   - Create or edit an existing Group Policy Object (GPO)   - Create or edit an existing Group Policy Object (GPO)
   - Right-click the GPO -> Edit   - Right-click the GPO -> Edit
 +
 +**User Configuration -> Policies -> Windows Settings -> Scripts -> Logon -> Properties -> Add**
  
 **User Configuration -> Policies -> Windows Settings -> Scripts -> Logon -> Properties -> Show Files** **User Configuration -> Policies -> Windows Settings -> Scripts -> Logon -> Properties -> Show Files**
  
-===== Based on Workstation OS =====+===== Run Commands Based on Workstation OS ===== 
 + 
 +:!: This needs testing and updating.
  
 To execute commands based on the host OS, you can create an include and use the following code: To execute commands based on the host OS, you can create an include and use the following code:
  
 +<file>
 If instr(lcase(sOSCaption),"windows 7") then If instr(lcase(sOSCaption),"windows 7") then
-Call RunProcess("\\\\test\\netlogon\\exe\\test.cmd",true)+Call RunProcess("\\test\netlogon\exe\test.cmd",true)
 ElseIf instr(lcase(sOSCaption),"windows xp") then ElseIf instr(lcase(sOSCaption),"windows xp") then
-Call RunProcess("\\\\test\\netlogon\\exe\\test.cmd",true)+Call RunProcess("\\test\netlogon\exe\test.cmd",true)
 End If End If
- +</file>
-(ignore the extra backslashes) +
  
 ===== Groups and IDs ===== ===== Groups and IDs =====
Line 51: Line 56:
  
 http://ss64.com/nt/syntax-security_groups.html http://ss64.com/nt/syntax-security_groups.html
- 
-===== Modular Logon Script ===== 
- 
-{{ :networking:windows:modular_logon_assign.png?direct&400|}}Robb Dunn wrote this modular VBS logon script. 
- 
-Script: http://community.spiceworks.com/scripts/show/299 
- 
-Howto: http://community.spiceworks.com/how_to/show/1189 
- 
-==== Howto ==== 
- 
-  - Download and copy the logon.vbs file to the the appropriate folder on the domain controller where the script will be run. 
-    - Windows NT method 
-    - Group Policy method 
-  - Create two additional folders in the same directory called **'configs'** and **'includes'**. 
-  - Create a configuration file in the **'configs'** folder named **'global.conf'**. 
-  - Using either the Windows NT method or the Group Policy method, call the login script specifying the config file as an argument: ''logon.vbs config:global.conf'' 
-  - Use the detailed log files generated to troubleshoot and verify script execution.  
- 
-=== Sample global.conf === 
- 
-<file> 
-<order> 
-meta=1 
-drives=3 
-printers=2 
-processes=4 
-include=5 
-</order> 
- 
-<meta> 
-description=For all users 
-created=02/12/12 
-author=Gene Cooper 
-</meta> 
- 
-<drives> 
-m:\\WIN2008R2-PDC\company 
-p:\\WIN2008R2-PDC\users$\sUser  
-t:\\WIN2008R2-PDC\test|group:testgroup 
-rem z:\\server\share 
-</drives> 
- 
-<printers> 
-\\WIN2008R2-PDC\pdfcreator;default 
-rem \\server\hpprinter|group:Print Users 
-rem \\server\colorprinter|-group:domain users|group:Colorprint Users 
-rem \\server\faxprinter|ip:192.168.0.23 
-</printers> 
- 
-<processes> 
-rem c:\windows\write.exe 
-</processes> 
- 
-<include> 
-rem File1.inc 
-rem File2.inc|computerOU:OU=test,OU=domain computers 
-rem File3.inc|group:marketing 
-</include> 
-</file> 
- 
-==== Troubleshooting ==== 
- 
-**Start -> Run -> %temp%** 
- 
-  * Look for logon_<your-conf-file>.log for login details. 
-  * If you don’t see the logfile here, then you know that the script did NOT run. 
  
 ===== Sample Logon Scripts ===== ===== Sample Logon Scripts =====
networking/windows/logon_script.1336850714.txt.gz · Last modified: 2012/05/12 13:25 by gcooper