Page 1 of 1 1
Topic Options
#23996 - 2002-06-27 09:21 PM Kixtart script to read xx lines in
WirelessDJ Offline
Fresh Scripter

Registered: 2002-03-29
Posts: 12
I have been using a utilty called Dumpsec.exe it is wonderful for NT security audits. One task I have at hand is to dump every user account on every server I have.

Well I have been able to do that, but the output is another story. I need a kixtart script to be able to read in "Fixed width columns" (not comma or tab delimite). Does anyone know how to do this?

USERID Row 1-19
FullName Row 20-44
description Row 45-??

Ideally it would be nice to open the text file, read these in from a text file, and compare them to a variable

if $userID = Administrator then ...
if $FullName = Jenny then ...
etc

Any ideas how do this with kix 4? [Razz]

Thank you ahead of time for the response

Top
#23997 - 2002-06-27 09:30 PM Re: Kixtart script to read xx lines in
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
dj,
i assume that fixed width means fixed number of chars.
this is not tricky with kix.
if you want to get say 10th colmun in 25 char columns, read it with substr($line,10*25,25)

but I assume you have more to this.
it's not hard, you just need to specify just little more detail on the format and oh, it will be given to you.

cheers,
_________________________
!

download KiXnet

Top
#23998 - 2002-06-27 09:36 PM Re: Kixtart script to read xx lines in
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
If you want a comma delimited output of domain accounts, quick and easy checkout DumpDomain.exe

[ 27 June 2002, 21:36: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#23999 - 2002-06-27 09:58 PM Re: Kixtart script to read xx lines in
WirelessDJ Offline
Fresh Scripter

Registered: 2002-03-29
Posts: 12
I would love to use DumpDomain, but we are not allowed to use *any* utilities unless they are already in-house or custom written. [Frown] It's nutz, but I have gotten use to it. Actually, I just thought of something [Eek!]

Kixtart can't read text files over 64K?

some of my files are 5MB in size!

Top
#24000 - 2002-06-27 10:08 PM Re: Kixtart script to read xx lines in
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Well I can "customize" it for you.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#24001 - 2002-06-27 10:12 PM Re: Kixtart script to read xx lines in
WirelessDJ Offline
Fresh Scripter

Registered: 2002-03-29
Posts: 12
Howard, I really appreciate the offer but the place I work at has extremely strict rules. it takes them months to adopt new software, and even when they do, it has to go through tons of testing.

Guys, should I give up trying to use kixtart to do this task?

"It's amazing what you can accomplish with NOTHING"

Top
#24002 - 2002-06-27 10:14 PM Re: Kixtart script to read xx lines in
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
I have never opened such a large file with KiXtart. You could use COM to access the FileSystemObject from Kixtart. Do a search on the board for "FileSystemObject".
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#24003 - 2002-06-27 10:21 PM Re: Kixtart script to read xx lines in
WirelessDJ Offline
Fresh Scripter

Registered: 2002-03-29
Posts: 12
What do you mean? use COM to access the FileSystemObject from Kixtart to dump the users from the servers or to open the files that I have already dumped?

Kixtart would work if I had a way to dump all users on each server FROM a kix script. But I don't have any clue how that would be accomplished.

Top
#24004 - 2002-06-27 10:22 PM Re: Kixtart script to read xx lines in
WirelessDJ Offline
Fresh Scripter

Registered: 2002-03-29
Posts: 12
What do you mean? use COM to access the FileSystemObject from Kixtart to dump the users from the servers or to open the files that I have already dumped?

Kixtart would work if I had a way to dump all users on each server FROM a kix script. But I don't have any clue how that would be accomplished.

Top
#24005 - 2002-06-27 10:27 PM Re: Kixtart script to read xx lines in
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
You can use COM+ADSI to dump the users from a SAM database. There are many examples of that on the board. Or you can use COM and the FileSystemObject to open and read the files you already have.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#24006 - 2002-06-28 12:00 AM Re: Kixtart script to read xx lines in
kholm Offline
Korg Regular
*****

Registered: 2000-06-19
Posts: 714
Loc: Randers, Denmark
Wireless,
Don't give up [Smile]
Read the dumpfile line by line and split the lines like this:
code:
$RC = Open(1,'Dumpfile.txt')
$Line = ReadLine(1)
While @Error = 0
$UserID = Trim(Left($Line, 19))
$FullName = Trim(SubStr($Line,20,24))
$Description = SubStr($Line,45)
; Your code here : if $userID = Administrator then ... if $FullName = Jenny then ...
$Line = ReadLine(1)
Loop
$RC = Close(1)

-Erik

Top
#24007 - 2002-06-28 12:05 AM Re: Kixtart script to read xx lines in
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Kholm, have used KiXtart to open and Readline 5MB files like Wireless has? If so, how does it perform?

[ 28 June 2002, 00:14: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#24008 - 2002-06-28 02:07 PM Re: Kixtart script to read xx lines in
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
hoby, don't know about others but did some time ago...
with 3.55 a script which adapted exchange-servers address list parsed trough it and compared to one on a unix-server and then unified them.

exchange server had over 1MB file and the unix server 1,5MB which caused the result to be approx 2MB.

this was ran every week and took only 50 minutes to execute [Big Grin]
wrote that script in no time: 3 months!

anyway, don't know how kix2001 works on very large files.

cheers,
_________________________
!

download KiXnet

Top
#24009 - 2002-06-28 03:38 PM Re: Kixtart script to read xx lines in
BrianTX Offline
Korg Regular

Registered: 2002-04-01
Posts: 895
Hmm. just thinking... wondering if you could use the WSHPipe method to pass lines of text to KiXtart...

Brian

Top
#24010 - 2002-06-28 04:16 PM Re: Kixtart script to read xx lines in
WirelessDJ Offline
Fresh Scripter

Registered: 2002-03-29
Posts: 12
kholm,

that script seems to be reading a 5.5 mb file! [Smile] I have to check to see incase it blows up at the end

What about trailing spaces??

if the user ID is

"JOE"
and the text file shows "JOE "
then it will not match [Confused]

Top
#24011 - 2002-06-28 04:20 PM Re: Kixtart script to read xx lines in
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
That's when you use Rtrim(). Have you thought about using Kixtart to create your data files instead of just parsing them? that way you can create them anyway you desire.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#24012 - 2002-06-28 08:04 PM Re: Kixtart script to read xx lines in
WirelessDJ Offline
Fresh Scripter

Registered: 2002-03-29
Posts: 12
I would prefer to use kixtart to create the data files. but from what I understand, you need ADSI installed in order to query a server?
Top
#24013 - 2002-06-28 08:18 PM Re: Kixtart script to read xx lines in
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
ADSI is required on the machine running a script that uses the provider. Win2k has it built-in and NT would need to have it installed. The server doesn't need it unless the script is running on it.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#24014 - 2002-06-28 09:08 PM Re: Kixtart script to read xx lines in
WirelessDJ Offline
Fresh Scripter

Registered: 2002-03-29
Posts: 12
so then where do I get this to install on an NT 4 workstation?
Top
#24015 - 2002-06-28 09:32 PM Re: Kixtart script to read xx lines in
Howard Bullock Offline
KiX Supporter
*****

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

[ 28 June 2002, 22:12: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
Page 1 of 1 1


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

Who's Online
1 registered (Allen) and 641 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.071 seconds in which 0.023 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