Page 6 of 9 « First<45678>Last »
Topic Options
#73557 - 2003-03-04 09:07 PM Re: Problem with kixtart and NT4.0
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Add:

$script = $user.loginscript
? "Logon script error: @error @serror"

after the line "checking user"
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#73558 - 2003-03-04 09:10 PM Re: Problem with kixtart and NT4.0
DJ Ballistic Offline
Starting to like KiXtart

Registered: 2003-02-21
Posts: 185
Aww geez now I get this:

'\\Sussex1\NETLOGON'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.

Error = 0 - The operation completed successfully.
checking user: CN=Kix Test
ory - The directory property cannot be found in the cache.script" (Active Direct
) [-2147352567/80020009]

checking user: CN=Test User
ory - The directory property cannot be found in the cache.script" (Active Direct
) [-2147352567/80020009]

If no user was displayed, then no user was retrieved from the OU
C:\WINDOWS>

Top
#73559 - 2003-03-04 09:12 PM Re: Problem with kixtart and NT4.0
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
I have seen some ADSI COM calls fail and the text line used inconjuction with a "+$user.loginscript" will cause a failure is the property is not defined.

So to get around that issue assign it to a variable first and check @error to see if you got it or not.

I have updated the script to use this method. See below.

code:
Break ON
; uncomment the next line to step through the code
; Debug ON
; Example of LDAP call. GetObject("LDAP://ou=Users,ou=YourBusinessUnit,dc=YourCompany,dc=com")
; You need to know your LDAP connection. You can maybe find it by checking the propery details on the OU for your users.
$target = GetObject("LDAP://OU=Test,OU=Information Systems,OU=AdminBldg,DC=sussexcounty,DC=net")
? 'Error = '+@ERROR+' - '+@SERROR
$loginscript="logon.bat"
For Each $user in $target
? 'checking user: '+$user.name
$script = $user.loginscript
? Logon swcript error: @error - @serror"
? 'assigned login script: '+$script
If $Script <> $loginscript
? "Current Script for " +$user.name " is: " +$script+ " Should be: " +$loginscript
$user.loginscript=$loginscript ; Remove the semi-colon at the front of this line to enable actually resetting the logon bat.
? 'Error = '+@ERROR+' - '+@SERROR
$user.SetInfo ; Remove the semi-colon at the front of this line to enable actually resetting the logon bat.
? 'Error = '+@ERROR+' - '+@SERROR
? "Changed current Script for " +$user.name " to: " +$user.loginscript
EndIf
Next
? 'If no user was displayed, then no user was retrieved from the OU'

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

Top
#73560 - 2003-03-04 09:14 PM Re: Problem with kixtart and NT4.0
DJ Ballistic Offline
Starting to like KiXtart

Registered: 2003-02-21
Posts: 185
However the script is sort of working. If I manually assign kix32 in the user's logon script box. And if I then run this script it changes it to logon.bat, but if there is currently nothing in there it gives me what I posted previously.
Top
#73561 - 2003-03-04 09:17 PM Re: Problem with kixtart and NT4.0
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
You need to trap the fact (error) that the logon script has never been assigned.

Something like this should help the situation.
code:
Break ON
$rc=SETOPTION('WrapAtEOL','ON')

; uncomment the next line to step through the code
; Debug ON
; Example of LDAP call. GetObject("LDAP://ou=Users,ou=YourBusinessUnit,dc=YourCompany,dc=com")
; You need to know your LDAP connection. You can maybe find it by checking the propery details on the OU for your users.
$target = GetObject("LDAP://OU=Test,OU=Information Systems,OU=AdminBldg,DC=sussexcounty,DC=net")
? 'Error = '+@ERROR+' - '+@SERROR
$loginscript="logon.bat"
For Each $user in $target
? 'checking user: '+$user.name
$script = $user.loginscript
$loginscripterror = @error
? "Logon script error: @error - @serror"
? 'assigned login script: '+$script
If $Script <> $loginscript or $loginscripterror
? "Current Script for " +$user.name " is: " +$script+ " Should be: " +$loginscript
$user.loginscript=$loginscript ; Remove the semi-colon at the front of this line to enable actually resetting the logon bat.
? 'Error = '+@ERROR+' - '+@SERROR
$user.SetInfo ; Remove the semi-colon at the front of this line to enable actually resetting the logon bat.
? 'Error = '+@ERROR+' - '+@SERROR
? "Changed current Script for " +$user.name " to: " +$user.loginscript
EndIf
Next
? 'If no user was displayed, then no user was retrieved from the OU'

{edit} added quote on line 17

[ 04. March 2003, 21:23: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#73562 - 2003-03-04 09:17 PM Re: Problem with kixtart and NT4.0
DJ Ballistic Offline
Starting to like KiXtart

Registered: 2003-02-21
Posts: 185
With the newly changed script I get this now:

'\\Sussex1\NETLOGON'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.

Error = 0 - The operation completed successfully.
checking user: CN=Kix Test

ERROR : unknown command [Logon]!
Script: \\Sussex1\NETLOGON\LDAP Call.kix
Line : 17

C:\WINDOWS>

Top
#73563 - 2003-03-04 09:19 PM Re: Problem with kixtart and NT4.0
DJ Ballistic Offline
Starting to like KiXtart

Registered: 2003-02-21
Posts: 185
hold on don't post more yet. I am going to try that last code that was posted and report the results.
Top
#73564 - 2003-03-04 09:21 PM Re: Problem with kixtart and NT4.0
DJ Ballistic Offline
Starting to like KiXtart

Registered: 2003-02-21
Posts: 185
Ok last result here is what I got:

'\\Sussex1\NETLOGON'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.

Error = 0 - The operation completed successfully.
checking user: CN=Kix Test
Logon script error: 0 - The operation completed successfully.
assigned login script: logon.bat
checking user: CN=Test User
Logon script error: 0 - The operation completed successfully.
assigned login script: logon.bat
If no user was displayed, then no user was retrieved from the OU
C:\WINDOWS>

Top
#73565 - 2003-03-04 09:21 PM Re: Problem with kixtart and NT4.0
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Forgot a quote:

? "Logon script error: @error - @serror"
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#73566 - 2003-03-04 09:21 PM Re: Problem with kixtart and NT4.0
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
Ballistic.

From a Windows 2000 workstation or XP workstation.

Copy KIX32.EXE and your script to a folder locally on that box.

Then from a command line type as an example in the TEMP folder if you copied the file there.

C:\TEMP\KIX32.EXE LDAP.KIX

(or what ever the name of your script is) it should work.



Break ON
; uncomment the next line to step through the code
; Debug ON
$target = GetObject("LDAP://OU=Test,OU=Information Systems,OU=AdminBldg,DC=sussexcounty,DC=net")
'Error = '+@ERROR+' - '+@SERROR
$loginscript="logon.bat"
For Each $user in $target
  ? 'checking user: '+$user.name
  $script = $user.loginscript 
  ? 'Logon script error: @error - @serror'
  ? 'assigned login script: '+$script
  If $Script <$loginscript
    ? "Current Script for " +$user.name " is: " +$script" Should be: " +$loginscript
    $user.loginscript=$loginscript
     ? 'Error = '+@ERROR+' - '+@SERROR
    $user.SetInfo
     ? 'Error = '+@ERROR+' - '+@SERROR
     ? "Changed current Script for " +$user.name " to: " +$user.loginscript
  EndIf
Next
'If no user was displayed, then no user was retrieved from the OU'
 



Top
#73567 - 2003-03-04 09:25 PM Re: Problem with kixtart and NT4.0
DJ Ballistic Offline
Starting to like KiXtart

Registered: 2003-02-21
Posts: 185
Ok for Howard's post. I fixed the quotes and it works. It automatically added the logon.bat in each user's profile in that OU.

With what NTDOC is posting will that interfere with that you are already showing me Howard or is that in addition?

Top
#73568 - 2003-03-04 09:30 PM Re: Problem with kixtart and NT4.0
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
It's actually all the same, just different colors. alos, we've already talked about how to call KiXtart scripts, so there shouldn't be any open questions left (I hope [Smile] ).
_________________________
There are two types of vessels, submarines and targets.

Top
#73569 - 2003-03-04 09:35 PM Re: Problem with kixtart and NT4.0
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
Same code, only all the error logging removed.

Should run exactly the same. I posted this code using PostPrep which allows you to copy it directly from here and paste into your text editor and maintain the formatting of the code is all.



Break ON
$target = GetObject("LDAP://OU=Test,OU=Information Systems,OU=AdminBldg,DC=sussexcounty,DC=net")
$loginscript="logon.bat"
For Each $user in $target
  $script = $user.loginscript 
  If $Script <$loginscript
    ? "Current Script for " +$user.name " is: " +$script" Should be: " +$loginscript
    $user.loginscript=$loginscript
    $user.SetInfo
  EndIf
Next


Top
#73570 - 2003-03-04 09:38 PM Re: Problem with kixtart and NT4.0
DJ Ballistic Offline
Starting to like KiXtart

Registered: 2003-02-21
Posts: 185
I meant this part

Ballistic.

From a Windows 2000 workstation or XP workstation.

Copy KIX32.EXE and your script to a folder locally on that box.

Then from a command line type as an example in the TEMP folder if you copied the file there.

C:\TEMP\KIX32.EXE LDAP.KIX

(or what ever the name of your script is) it should work.

Why should I do or not do this?

Top
#73571 - 2003-03-04 09:46 PM Re: Problem with kixtart and NT4.0
DJ Ballistic Offline
Starting to like KiXtart

Registered: 2003-02-21
Posts: 185
Ok I tested it on XP Pro, Check
2000 Pro, Check
98SE, No good.
Says bad command or filename.
Is there something that needs to be changed in my logon.bat or my kixscript that maybe 98SE initially cannot read.

That is the last thing and I am finished.

Top
#73572 - 2003-03-04 09:53 PM Re: Problem with kixtart and NT4.0
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Why are you testing this script on all those operating systems? Only you will run this one time from your work station.

Or are you now testing the logon script on these computer? Please try to include enough info for us to follow exactly what is happening.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#73573 - 2003-03-04 09:54 PM Re: Problem with kixtart and NT4.0
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
I prefer to provide full paths whenever calling scripts, especially if it has to work cross-platform.
_________________________
There are two types of vessels, submarines and targets.

Top
#73574 - 2003-03-04 09:56 PM Re: Problem with kixtart and NT4.0
DJ Ballistic Offline
Starting to like KiXtart

Registered: 2003-02-21
Posts: 185
I am just testing it on a 98 box.
Full paths like C:\yadda\yadda, etc
like that not UNC's.
Hmm not sure how to do that for the 98 boxes
Because the netlogon folder on sussex1 which is the domain controller I am not mapping to any of the clients. It is just shared and that's it.

Top
#73575 - 2003-03-04 10:03 PM Re: Problem with kixtart and NT4.0
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
Windows 9x DOES NOT run KiXtart without the supporting .DLL files.

You also need to install ADSI on the NT/9x systems to run this type of script.

As I say though. It should only be run from your 2000/XP workstation or another Admins workstation. It is not for a normal user to run.

Top
#73576 - 2003-03-05 02:15 PM Re: Problem with kixtart and NT4.0
DJ Ballistic Offline
Starting to like KiXtart

Registered: 2003-02-21
Posts: 185
Ok I ended up using the overkill batch file in thread http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=1;t=006464

At any rate, it automatically copied kix32 and the supporting dll's to the 98 client. I login with the 98 client and the script runs. However one funny qwerky thing that is happening is that it only maps some of the drives and not all of them that are mapped using the same user logging into a 2000, NT, or XP box. Any thoughts?
I can see the light at the end of the tunnel I am almost finished with this whole thing.

Top
Page 6 of 9 « First<45678>Last »


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

Who's Online
0 registered and 373 anonymous users online.
Newest Members
Raoul, Timothy, Jojo67, MaikSimon, kvn317
17875 Registered Users

Generated in 0.076 seconds in which 0.026 seconds were spent on a total of 13 queries. Zlib compression enabled.

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