Intellegent Login Scripts

Akai

Well-Known Member
Joined
Jul 17, 2008
Messages
127
Hey Guys,

I need some help quickly please with Windows Server 2008 Login scripts.

We have to two sites, Johannesburg & Cape Town, running login script its own login scripts. Cape Town login scripts mapping network drives pertaining to Cape own and JHB login scripts mapping network drives pertaining to JHB. HOWEVER the sames drives letters gets mapped F:, I: and T: for both sites.

Here is where it gets interesting... THere are a few Cape Town people who logs on to Terminal Server that needs to JHB I-Drive mapping ONLY WHEN THEY LOGON on the Terminal Server. When they logon to the Cape Town machine, the normal Cape Town Login scrips still runs as normal.

I know one can make the login script a bit more intellegent with IF and ELSE and whatnot statement, but I need help though.

It should read something along the lines of:

IF machinename = (terminal server name) then map I: \\(JHB SERVER NAME)\SHARENAME\
ELSE map I: to (NORNAL CAPE TOWN SHARE)

Hope this makes sense to some of you :) :p
 

Akai

Well-Known Member
Joined
Jul 17, 2008
Messages
127
Mods, Please feel free to remove this double post :)
 

Asha'man X

Expert Member
Joined
Aug 31, 2006
Messages
1,401
For what it's worth, if the servers are in the same AD Domain, you could use Group Policy Preferences feature to map the drives. All you do is put the relevant users into groups like Cape Town and Joburg, and set that certain drive mappings only happen to those groups. You can also set mappings based on computer name I think, but I don't know how this would work with Terminal Services unfortunately.
 

Random717

Expert Member
Joined
May 30, 2006
Messages
2,121
if %computername% == (terminal server name, all caps) net use i: \\(jhbserver)\share
if %computername% == (cape town server name, all caps) net use i: \\(cptserver)\share

without the ()
 

bekdik

Honorary Master
Joined
Dec 5, 2004
Messages
12,860
Wouldn't the existing shares work provided that the remote user logged in to the correct TS? ie a Capetown user logged into the Capetown TS irrespective of his actual location?

After all a Capetown TS user would de facto run the Capetown script (because the user's login is in fact running on the Cape Town server) and thus map to the Capetown share.
 
Top