|
Broadband - Exchange Login Scripts - Net Admin Outlook - Windows Mobile Windows
Contact - Advertise

Login Scripts
Getting Started
Creating the Initial File
Testing
Implementation
Basic Techniques
Mapping Network Drives
Connecting Printers
Section Labels
More Advanced Techniques
Domain Group Membership For Drive and Printer Mapping
Recording Script Results
Location Detection
Machine Identification
Operating System Detection
Limiting the Number of Logins
Registry Changes
Redirection of Internet Explorer Favourites
Checking for Existence of a File or Directory
|
Machine Identification
In Citrix or Microsoft Terminal Server environments it can be useful to detect what machine the client is connecting from. With Citrix and TS installations, the users might move around but the terminals themselves stay put.
In this example, there are thin clients in three offices - London, Cardiff and Edinburgh. Each thin client is named WBT<location letter>-<asset number> where <location letter> is the first letter of the place name (l, c or e) and asset number is a five digit number. Note: Numbers in the notes correspond with the numbers down the side of the example script.
- The script was written for a Citrix server, so it first checks whether the variable "Clientname" has been set. If it hasn't then it probably means some one logging in to this domain from a normal computer (not a Citrix/thin client) and skips a lot of the script.
- The next part is checking what the location letter is.
Of this section, the first line detects whether the first three letters are WBT, which further weeds out any desktops - for example people using the Citrix client from their own machine. You may want to adjust the naming of the host in the Citrix client to reneable this functionality.
- Then the location code is checked and the script sends them off to the relevant locations.
- If the script has managed to get through the other traps, then a message is sent to the screen.
- The destination of the script
If desired the script can be combined with other login script commands, such as ifmember which could be used to further control the access to the printers and drive mappings. Remember to put in a "goto" command to skip the rest of the location based information. Otherwise the script will just continue moving down and will execute the next set of commands as well.
| 1. |
if defined CLIENTNAME goto next echo This is not a thin client. GOTO end |
| 2. |
:next
rem Check where thin client is located.
SET v_part_name=%CLIENTNAME:~0,3% IF NOT %v_part_name%==WBT GOTO :desktop |
| 3. |
SET v_part_name=%CLIENTNAME:~0,4% IF %v_part_name%==WBTL GOTO :london IF %v_part_name%==WBTC GOTO :cardiff IF %v_part_name%==WBTE GOTO :edinburgh |
| 4 |
net send %username% "Your thin client doesn't have location information. Get the configuration checked" |
| 5. |
:desktop rem desktop settingsgoto :next
:london rem london settings
goto :next
:cardiff rem cardiff settings
goto :next
:edinburgh rem Edinburgh settings
goto :next
:next
:end |
Complete Sample - Ready to Copy and Paste.
Remember to turn off word wrap when working in notepad
|