Page 2 of 2 <12
Topic Options
#29849 - 2002-09-27 07:12 PM Re: Extracting Username in TXT file
Stephen Wintle Offline
Seasoned Scripter

Registered: 2001-04-10
Posts: 444
Loc: England
For some reason it now putting a zero on the end of all my users.. Also is their a way I can write a setsting of chars to the end of each username?

Steve..
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!

Top
#29850 - 2002-09-27 07:16 PM Re: Extracting Username in TXT file
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
See Why does the console display zeros and ones (amongst others)?
_________________________
There are two types of vessels, submarines and targets.

Top
#29851 - 2002-09-27 07:21 PM Re: Extracting Username in TXT file
Stephen Wintle Offline
Seasoned Scripter

Registered: 2001-04-10
Posts: 444
Loc: England
Ok I now know how to append my text string...
The zeros thing didnt happen when I ran it in debug mode...

Steve.

[ 27. September 2002, 19:22: Message edited by: Stephen Wintle ]
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!

Top
#29852 - 2002-09-27 09:08 PM Re: Extracting Username in TXT file
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
steve, that's why we have multiple days in our lifes... to learn every day something new and perhaps at the end know that "we don't know a sh*t" (quote modified)
 
_________________________
!

download KiXnet

Top
#29853 - 2003-05-20 12:55 AM Re: Extracting Username in TXT file
Stephen Wintle Offline
Seasoned Scripter

Registered: 2001-04-10
Posts: 444
Loc: England
Hi,

Im revisting a problem that I had sometime ago where I had to extract userIDs and USernames from the SAM. I am getting that problem over again when running the script,
code:
 


Microsoft(R) Windows 98
(C)Copyright Microsoft Corp 1981-1999.

X:\>c:

C:\WINDOWS>kix32.exe c:\extract.kix
Script error: unknown or unexpected command []!
$domain.filter = "user",""


C:\WINDOWS>

I had it working before and now its seems to have reverted back to the problem I was originally getting when ASDI for win98 wasnt installed. I installed the addin that Howard points to but im still getting the above message.
code:
 
$DomainName="RMNETNT"
$domain = GetObject("WinNT://$DomainName,domain")
$domain.filter = "user",""
for each $user in $domain
? $user.name
next

The only thing I can think of thats been changed is the version of Kix that im running (a later version).

[ 19. May 2003, 12:57: Message edited by: Stephen Wintle ]
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!

Top
#29854 - 2003-05-19 01:00 PM Re: Extracting Username in TXT file
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
What version of KiXtart?
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#29855 - 2003-05-19 01:04 PM Re: Extracting Username in TXT file
Stephen Wintle Offline
Seasoned Scripter

Registered: 2001-04-10
Posts: 444
Loc: England
Hi Howard,

Its ver 4.10 do you think its the ver. then?

Steve.
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!

Top
#29856 - 2003-05-19 01:08 PM Re: Extracting Username in TXT file
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
One of those versions around 4.1x had some issue with COM, but I wouldn't have expected that type of error.

Try the original KiXtart to see if the problem goes away then try 4.21.

[ 19. May 2003, 13:09: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#29857 - 2003-05-19 01:23 PM Re: Extracting Username in TXT file
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
that error just looks like it's unable to get the object and thus the array get spilled to console and thus the error as arrays can't be outputted to console.
_________________________
!

download KiXnet

Top
#29858 - 2003-05-19 04:38 PM Re: Extracting Username in TXT file
Stephen Wintle Offline
Seasoned Scripter

Registered: 2001-04-10
Posts: 444
Loc: England
Tried the earlier version but no good. Nothings changed on the Domain side which is strange..

Steve.
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!

Top
#29859 - 2003-05-19 04:57 PM Re: Extracting Username in TXT file
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
what error messages do your get?


$DomainName="RMNETNT"
$domain = GetObject("WinNT://$DomainName,domain")
? "GetObject: @error @serror"
$domain.filter = "user",""
? "Set Filter: @error @serror"
for each $user in $domain
? $user.name
? "Print name: @error @serror"
next
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#29860 - 2003-05-20 01:50 PM Re: Extracting Username in TXT file
Stephen Wintle Offline
Seasoned Scripter

Registered: 2001-04-10
Posts: 444
Loc: England
I get the following errror each time
code:
 GetObject: -2147221014 Moniker cannot open fileScript error: unknown or unexpec
ed command []!
$domain.filter = "user",""


C:\WINDOWS>

Steve
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!

Top
#29861 - 2003-05-20 02:02 PM Re: Extracting Username in TXT file
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
I suggest you reinstall ADSI and try again. What version of ADSI were you using? Did you stated that this issue cropped up after moving from an NT4 domain to W2K AD domain?
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#29862 - 2003-05-20 02:18 PM Re: Extracting Username in TXT file
Stephen Wintle Offline
Seasoned Scripter

Registered: 2001-04-10
Posts: 444
Loc: England
Tried reinstalling ADSI but no good... The w2k server is new but the PDC is still NT4.

Steve.
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!

Top
#29863 - 2003-05-20 03:14 PM Re: Extracting Username in TXT file
Stephen Wintle Offline
Seasoned Scripter

Registered: 2001-04-10
Posts: 444
Loc: England
Tried it on another machine, same spec, software and it worked...

Doh!

Incidently can I use the same script to extra the "full names" of each user?

Thanks

Steve
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!

Top
#29864 - 2003-05-20 03:15 PM Re: Extracting Username in TXT file
Stephen Wintle Offline
Seasoned Scripter

Registered: 2001-04-10
Posts: 444
Loc: England
Ignore that last request.. Sorry i worked out how to do it!

Not completly useless then...

Thanks for help

Steve.
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!

Top
Page 2 of 2 <12


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

Who's Online
0 registered and 1471 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.068 seconds in which 0.027 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