#73498 - 2003-03-04 04:49 PM
Re: Problem with kixtart and NT4.0
|
DJ Ballistic
Starting to like KiXtart
Registered: 2003-02-21
Posts: 185
|
Oh Oh now I get it. Geez I feel dumb, now I get it. Okay I will run that on the Sussex1 DC. Do you think from what you can tell that I have that syntax right or is there anything missing on that code?
|
Top
|
|
|
|
#73499 - 2003-03-04 04:53 PM
Re: Problem with kixtart and NT4.0
|
Sealeopard
KiX Master
Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
|
In general, it does look okay to me. Also, it's always good to first test a script before letting it out into the wild.
You must run it under an account that has aD amdin privileges. Also, change the code to:
code:
Break ON ; uncomment the next lien 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=Users,ou=Test,dc=sussexcounty,dc=net") ? 'Error = '+@ERROR+' - '+@SERROR $loginscript="logon.bat" For Each $user in $target If $user.loginscript <> $loginscript ? "Current Script for " +$user.name " is: " +$user.loginscript+ " 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
to provide mote insight into what's happening.
_________________________
There are two types of vessels, submarines and targets.
|
Top
|
|
|
|
#73500 - 2003-03-04 04:54 PM
Re: Problem with kixtart and NT4.0
|
DJ Ballistic
Starting to like KiXtart
Registered: 2003-02-21
Posts: 185
|
code:
Break ON ; Example of LDAP call. GetObject("LDAP://[B]ou=Users,ou=Test[/B],dc=sussexcounty,dc=net") ; 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=Users,ou=Test,dc=sussexcounty,dc=net") $loginscript="logon.bat" For Each $user in $target If $user.loginscript <> "$loginscript" ? "Current Script for " +$user.name " is: " +$user.loginscript+ " Should be: " +$loginscript ; $user.loginscript=$loginscript ; Remove the semi-colon at the front of this line to enable actually resetting the logon bat. ; $user.SetInfo ; Remove the semi-colon at the front of this line to enable actually resetting the logon bat. EndIf Next
Do I need the Users and Test OU's listed?
|
Top
|
|
|
|
#73502 - 2003-03-04 04:58 PM
Re: Problem with kixtart and NT4.0
|
DJ Ballistic
Starting to like KiXtart
Registered: 2003-02-21
Posts: 185
|
I run it from my workstation i get "there is no such object on the server".
Plus do I call this from a batch file because the DC isn't going to know what to do with a kix file.
|
Top
|
|
|
|
#73504 - 2003-03-04 05:03 PM
Re: Problem with kixtart and NT4.0
|
DJ Ballistic
Starting to like KiXtart
Registered: 2003-02-21
Posts: 185
|
But they are the names of the OU's. I am looking at it in AD
Here is the heirarchy structure:
sussexcounty.net ->AdminBldg ->Information Systems -> Test
|
Top
|
|
|
|
#73505 - 2003-03-04 05:04 PM
Re: Problem with kixtart and NT4.0
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
You can use the TranslateName() UDF and a @ldomain\@userid to return the distinguished name. From that you simply remove the CN=userid, and have the DN for the OU.
|
Top
|
|
|
|
#73506 - 2003-03-04 05:12 PM
Re: Problem with kixtart and NT4.0
|
DJ Ballistic
Starting to like KiXtart
Registered: 2003-02-21
Posts: 185
|
I added the UDF to my script to run first but I am not sure what needs to be changed to conform to my domain. So the syntax is correct.
|
Top
|
|
|
|
#73508 - 2003-03-04 05:16 PM
Re: Problem with kixtart and NT4.0
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
The use of the TranslateName UDF would be just to get the DN of one of your users since it appears that based on a previous post you could not find the user's OU.
Use this example: code:
$DN = TranslateName (3, "", 3, "@LDomain\@userid", 1) ? "DN = " + $DN[0] ? "Error = " + $DN[1] ? "ErrorText = " + $DN[2]
|
Top
|
|
|
|
#73509 - 2003-03-04 05:19 PM
Re: Problem with kixtart and NT4.0
|
DJ Ballistic
Starting to like KiXtart
Registered: 2003-02-21
Posts: 185
|
Here is what I get when I run it.
L : 0 = -2147016656 - There is no such object on the server. -- Extended Error: C:\Documents and Settings\mmontgomery\Desktop\Kixstart 2001 4.20>
|
Top
|
|
|
|
#73510 - 2003-03-04 05:22 PM
Re: Problem with kixtart and NT4.0
|
DJ Ballistic
Starting to like KiXtart
Registered: 2003-02-21
Posts: 185
|
I also added that example and I get this now.
L : 0 = -2147016656 - There is no such object on the server. -- Extended Error: ssexcounty,DC=net. Montgomery,OU=Users,OU=Information Systems,OU=AdminBldg,DC=su Error = 0 ErrorText = The operation completed successfully. C:\Documents and Settings\mmontgomery\Desktop\Kixstart 2001 4.20>
|
Top
|
|
|
|
#73511 - 2003-03-04 05:22 PM
Re: Problem with kixtart and NT4.0
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
What is the OS of your computer where you are running the script? What was the script use executed?
Have you tried the WinNT:// provider?
|
Top
|
|
|
|
#73512 - 2003-03-04 05:24 PM
Re: Problem with kixtart and NT4.0
|
DJ Ballistic
Starting to like KiXtart
Registered: 2003-02-21
Posts: 185
|
I am running the script on XP Pro
The script name is ldap.kix
NT4 not sure what you mean.
I am new at this.
|
Top
|
|
|
|
#73513 - 2003-03-04 05:26 PM
Re: Problem with kixtart and NT4.0
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Please only run the example posted. What is the result? Please post your test script as well. [ 04. March 2003, 17:27: Message edited by: Howard Bullock ]
|
Top
|
|
|
|
#73514 - 2003-03-04 05:27 PM
Re: Problem with kixtart and NT4.0
|
DJ Ballistic
Starting to like KiXtart
Registered: 2003-02-21
Posts: 185
|
If I use only that example posted I get this:
ERROR : expected expression! Script: \\Sussex1\NETLOGON\LDAP.kix Line : 0
|
Top
|
|
|
|
#73515 - 2003-03-04 05:30 PM
Re: Problem with kixtart and NT4.0
|
DJ Ballistic
Starting to like KiXtart
Registered: 2003-02-21
Posts: 185
|
I am running this script from the Kixscript Editor. Should I be running this from a batch file? If so what needs to go in it. I have tried creating a ldap.bat that has Kix32.exe ldap.kix and it doesn't run, it says unable to find/open script.
Man this is confusing. I thought this was easier.
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 373 anonymous users online.
|
|
|