Page 1 of 2 12>
Topic Options
#108889 - 2003-11-25 04:51 PM Running a login script not on the bdc/dc...
Rocco Capra Offline
Hey THIS is FUN
*****

Registered: 2002-04-01
Posts: 380
Loc: Mansfield Ohio
Sorry if this is in the wrong forum!

We are in the middle of a 2003 domain conversion where I work and plan to soon take the old nt4 bdc's out of remote locations. Which means that most remote users will auth to the main pdc. Of such we do not want them running the login script from there cause some of the locations have a slow connection. Our thoughts are to put the scripts on a local File and print server they will have and then 'Call' the script from there when the logon.

So, if my thinking is correct, The user logs in, auths. to the PDC starts the script on the PDC and the first thing the script does is check group membership then calls the propper script from thier fp server. ie:...
Code:
IF(InGroup('SUN_users')) CALL '\\sunfp1w2\netlogon\login.kix' QUIT(0) ENDIF



Does that make sence?

I just was wondering if there is a better way to acomplish that?

Thought?

Thanks,
Rocco
_________________________
I Love this board!! -------------------- My DEV PC is running KIX 4.22 WINXP Pro

Top
#108890 - 2003-11-25 05:29 PM Re: Running a login script not on the bdc/dc...
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
will the servers not replicate?
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#108891 - 2003-11-25 05:40 PM Re: Running a login script not on the bdc/dc...
Rocco Capra Offline
Hey THIS is FUN
*****

Registered: 2002-04-01
Posts: 380
Loc: Mansfield Ohio
Well,

What they are doing is only putting DC's in certian remote loactions. and only having File and Print servers in others. Can you replicate from a PDC/DC to a file and print server?

Also, another ?. Since I am not that familiar to AD, can you specify in the user manager to run the script from a server other thatn the one they auth. to?

Thanks,
Rocco
_________________________
I Love this board!! -------------------- My DEV PC is running KIX 4.22 WINXP Pro

Top
#108892 - 2003-11-25 05:56 PM Re: Running a login script not on the bdc/dc...
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
Quote:

Can you replicate from a PDC/DC to a file and print server?




nope

Quote:

can you specify in the user manager to run the script from a server other thatn the one they auth. to?



nope


_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#108893 - 2003-11-25 06:04 PM Re: Running a login script not on the bdc/dc...
Rocco Capra Offline
Hey THIS is FUN
*****

Registered: 2002-04-01
Posts: 380
Loc: Mansfield Ohio
So would me suggestion in the original post work like I think it will?
_________________________
I Love this board!! -------------------- My DEV PC is running KIX 4.22 WINXP Pro

Top
#108894 - 2003-11-25 06:22 PM Re: Running a login script not on the bdc/dc...
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
From what location are you going to execute KiX32.exe. This EXE is probably larger than your scripts.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#108895 - 2003-11-25 06:27 PM Re: Running a login script not on the bdc/dc...
Rocco Capra Offline
Hey THIS is FUN
*****

Registered: 2002-04-01
Posts: 380
Loc: Mansfield Ohio
Ah ha.

So a 'shell' may work better.(?)

Code:

SHELL '%COMSPEC% /C C:\SSI\kix32.exe \\SUNFP1W2\NETLOGON\login.kix'

...or...

SHELL '%COMSPEC% /C \\SUNFP1W2\NETLOGON\kix32.exe \\SUNFP1W2\NETLOGON\login.kix'



?

Rocco
_________________________
I Love this board!! -------------------- My DEV PC is running KIX 4.22 WINXP Pro

Top
#108896 - 2003-11-25 06:41 PM Re: Running a login script not on the bdc/dc...
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
To do a SHELL implies that you have already loaded Kix32.

I would suggest running Kix32 and the scripts from the client.

See this poat for how I do it: http://www.kixtart.org/ubbthreads/showthreaded.php?Cat=&Number=65284&page=&view=&sb=5&o=&vc=1

I then run the drive mapping script from the local resource domain server for W2K clients using

Code:
If ($OS = "WinNT" and ADSIinstalled() and Right($Domain, 7) = "-tyco-e") or $Domain = "tycoelectronics"
Dim $Obj, $Dpath, $path
$Obj = CreateObject("ADSystemInfo")
$ResDomDC = $Obj.GetAnyDCName
$Dpath="\\" + $ResDomDC
WriteLog ("AD aware client will execute 'computer account' based local scripts from: " + $Dpath)
for each $path in MakePathsFromADlocation($Domain, $wksta + "$$")
ProcessStdFiles($DPath + "\" + $path)
next
Else
WriteLog ("Client will execute 'computer account' based local scripts from: " + $Lpath + "\" + $Domain)
ProcessStdFiles($Lpath + "\" + $Domain)
Endif

_________________________
Home page: http://www.kixhelp.com/hb/

Top
#108897 - 2003-11-25 06:48 PM Re: Running a login script not on the bdc/dc...
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Quote:

Can you replicate from a PDC/DC to a file and print server?



Well, yes... sort of.
If you setup DFS, and put everything you need on the DFS, you could replicate it everywhere. That way, even if some of the users were mobile, they would still run a local copy.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#108898 - 2003-11-25 06:59 PM Re: Running a login script not on the bdc/dc...
Rocco Capra Offline
Hey THIS is FUN
*****

Registered: 2002-04-01
Posts: 380
Loc: Mansfield Ohio
Ok,

since we name all our PC's to include 3 chars of the remote site I could do something like this to K.I.S.S....

IF %COMPUTERNAME%=='SUN*' GOTO SUN
IF %COMPUTERNAME%=='APP*' GOTO APP
IF %COMPUTERNAME%=='MAN*' GOTO MAN
IF %COMPUTERNAME%=='LYN*' GOTO LYN
... ...

But I know that is not the way to parse a sting in BATCH, but have no idea how. Can ya help with that? Or a better way?

Rocco
_________________________
I Love this board!! -------------------- My DEV PC is running KIX 4.22 WINXP Pro

Top
#108899 - 2003-11-25 07:04 PM Re: Running a login script not on the bdc/dc...
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Well... it could work but mobile users could be bitten.
Code:
REM DOS code
ECHO ~%COMPUTERNAME% | FIND /I "~FF0"
...

_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#108900 - 2003-11-25 07:10 PM Re: Running a login script not on the bdc/dc...
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Rocco,
Given a choice, I would lobby your IT to use DFS. Does not address VPN or RAS users.
Second choice would be to deploy KiX the way Howard does, namely to cache a local copy of everything and validate it with CRC. That would have the added benefit of VPN or RAS users having good performance.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#108901 - 2003-11-25 07:26 PM Re: Running a login script not on the bdc/dc...
Rocco Capra Offline
Hey THIS is FUN
*****

Registered: 2002-04-01
Posts: 380
Loc: Mansfield Ohio
I got this to work...
ECHO %COMPUTERNAME% | FIND /I "SUN"

How do I ...

IF ECHO %COMPUTERNAME% | FIND /I "SUN" GOTO SUN
_________________________
I Love this board!! -------------------- My DEV PC is running KIX 4.22 WINXP Pro

Top
#108902 - 2003-11-25 07:38 PM Re: Running a login script not on the bdc/dc...
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
SHELL '%COMSPEC% /C ECHO %COMPUTERNAME% | FIND /I "SUN" '

IF @ERROR = 0
GOTO "SUN"
ENDIF


woops - sorry Rock, you wanted DOS commands ... never mind.


Edited by Shawn (2003-11-25 07:40 PM)

Top
#108903 - 2003-11-25 07:59 PM Re: Running a login script not on the bdc/dc...
Rocco Capra Offline
Hey THIS is FUN
*****

Registered: 2002-04-01
Posts: 380
Loc: Mansfield Ohio
Sorry for my ignorance...what is DFS?

Also, as a policy we do not have but a couple dialup or VPN users, and they do not run the login script. We do use SafeWeb(who unfortunatly just got bought by symantec ) for everyone else.

So basically..

Copy all the needed file to each PC then in the login.bat on the server....

CALL "C:\KIX\kix32.exe C:\KIX\login.kix"

Of course the same could be done...
CALL "\\SERVER\SHARE\kix32.exe \\SERVER\SHARE\login.kix"

I like the server one better. Only have to keep server updated with modified files.

Questin then remains how do I make that IF in %COMPUTERNAME% 'SUN' statement work?

Sorry, I jumed right into KiXtart when I started scripting and the only batch I know is...

rem start dos code
@ECHO OFF

CALL %0\..\KIX32.exe TestLogin.kix

:END
CLS
EXIT
rem end dos code


Rocco
_________________________
I Love this board!! -------------------- My DEV PC is running KIX 4.22 WINXP Pro

Top
#108904 - 2003-11-25 09:27 PM Re: Running a login script not on the bdc/dc...
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
This batch code should be close to what you want.

Code:
ECHO ~%COMPUTERNAME% | FIND /I "~Sun"

if %errorlevel% == 0 Set MyLoc=SUNServer

ECHO ~%COMPUTERNAME% | FIND /I "~Moo"
if %errorlevel% == 0 Set MyLOC=MOOserver

ECHO ~%COMPUTERNAME% | FIND /I "~Oth"
if %errorlevel% == 0 Set MyLOC=OTHserver

\\%MyLOC\netlogon\kix32.exe \\%MyLOC%\netlogon\Script.kix
:eof






Edited by Howard Bullock (2003-11-26 12:17 AM)
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#108905 - 2003-11-25 09:34 PM Re: Running a login script not on the bdc/dc...
JimRobinson Offline
Fresh Scripter

Registered: 2003-01-10
Posts: 42
Loc: Tempe, AZ
Rocco,
If you use the SAME three positions for a location name, and you are using Win2k (probably XP as well), try this sample:
Code:
 @echo off
set testvar=tmpPCName1
::set testvar=sjoPCName1
::set testvar=svlPCName1
call :%testvar:~0,3%
goto :eof
:tmp
echo/In TMP
goto :eof
:sjo
echo/In SJO
goto :eof
:svl
echo/In SVL
goto :eof



Un comment (the ::'s) the various set lines to see the effect.

%testvar:~0,3% strips out the first three characters of the variable testvar. Warning, I have not used this and tested it only briefly, but it should work. Translating it to KiX would be the hard part for me

How do I get some blank lines inside the CODE tags?
_________________________
Jim
--------------------

Top
#108906 - 2003-11-25 11:02 PM Re: Running a login script not on the bdc/dc...
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Rocco,
Don't take out the tilde '~'. It is there for a purpose. It forces the Find to match on the first char. Without it, it could possibly find a false match in the middle. I see Howard has answered your question.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#108907 - 2003-11-25 11:15 PM Re: Running a login script not on the bdc/dc...
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Quote:

Sorry for my ignorance...what is DFS?




FYI.

This is DFS : http://www.microsoft.com//WindowsServer2003/technologies/fileandprint/file/dfs/default.mspx
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#108908 - 2003-11-26 02:40 PM Re: Running a login script not on the bdc/dc...
Rocco Capra Offline
Hey THIS is FUN
*****

Registered: 2002-04-01
Posts: 380
Loc: Mansfield Ohio
Thanks all!!

After playing aroun I think I'm gonn stick with Howard's suggestion.

Les,
Thanks for the '~' note, I had no idea why that was there.


Later,

Rocco
_________________________
I Love this board!! -------------------- My DEV PC is running KIX 4.22 WINXP Pro

Top
Page 1 of 2 12>


Moderator:  Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 4873 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.107 seconds in which 0.018 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org