Recent Changes - Search:

Tips & Tricks

Windows Tips

Vista Tips

MS Server Tips

Apple Tips

Linux Tips

Networking Tips

Business

powered by PmWiki

LogonScriptDriveMapping

Mapping Drives Using Server Logon Scripts

  1. Decide the script name called something like logon.bat
  2. On the Domain Controller place the logon script in \\[server-name]\NETLOGON
  3. Create the mapping script similar to:
    • net use j: \\[server-name]\[mapped folder]
    • Go to the DC and open Active Directory Users and Computers and open all users (sequentially) you want to have their networked drives mapped by the logon.bat script > Open Profile tab > in the logon script field type in the name of the script i.e. logon.bat
    • Open Run on the DC and type in gpupdate
    • Log off the client and logon again to test the script is working

Note: This code could be placed into a logon script to find mapped folder (assuming that it is a shared folder) on a server and map it to the drive letter J:

Environmental Variables

  • An environment variable is a piece of data that Windows NT Server upwards knows about your computer. The advantage of using environmental variables is you can write one generic logon script that works for everyone, rather than writing a logon script for every user.

Types of Environmental Variables are:

  • %USERNAME% – variable that contains the name of the user who’s currently logged in.
  • %HOMEPATH % – variable that contains the path of the user’s home directory.
  • %OS % – variable that contains the name of your operating system.
  • %USERDOMAIN % – variable that contains the name of the domain that the computer is logged into.

How to Include Environmental Variables in a script:

  • echo Welcome %USERNAME%
    • This code could be placed into a logon script to display a message that welcomes all users. If a user named is Joan Smith , the above code will result in the words Welcome Joan Smith when this user logs on.

There are many ways to use variables which this article does not cover.

References

ASC Consultants - Written 20 Jan 2009


All text is available under the terms of the GNU Free Documentation License
Privacy Policy | About Wikitec | Disclaimer | Copyright

Edit - History - Print - Recent Changes - Search
Page last modified on 2009-01-20 03:18