Useful Logon Script Commands

active-directorylogon-scripts

Please post useful commands that you use in your logon script.

Here are some that I use:

map a network drive:
net use v: \fileserver\apps
map a network printer:
RunDll32.EXE printui.dll,PrintUIEntry /in /n
"\\printserver\Xerox DC1100 PCL"

delete a network printer:

RunDll32.EXE printui.dll,PrintUIEntry /dn /q /n
"\\printserver\HP LaserJet 2300"

disable windows firewall:
netsh firewall set opmode disable
install a new program:
if not exist "C:\Program Files\Antivirus\"
"V:\Antivirus\install.msi"


create a shortcut on users Desktop:
copy "V:\shortcuts\dictionary.lnk" "%USERPROFILE%\Desktop"

Best Answer

I might get down voted for this, but so be it. I've always considered logon scripts to be kind of hack'ish and try to only use them as a last resort. There are so many ways to manage systems and users these days with things like Group Policy, Group Policy Preferences, and SCCM/SMS. I mean, there's always going to be cases where there just isn't a better way to do things. But many of the examples provided so far can easily be done without a login script like installing software and mapping network drives.

Related Topic