Page 1 of 1 1
Topic Options
#132448 - 2005-01-14 03:23 AM Retrieving "net use" info
Seks Offline
Fresh Scripter

Registered: 2002-10-31
Posts: 20
Currently, I have this line in the login script:

REDIRECTOUTPUT ("\\CORPDC01\LOGS$\user name\@USERID.txt", 1) ? "@DATE, @TIME, @USERID, @PRODUCTTYPE, @WKSTA, @ADDRESS, @IPADDRESS0, @IPADDRESS1, @DOMAIN, @LSERVER, $center_name"

So basically what it is doing is creating a text file with a filename based on the user name. In the text file, it will have the info that I wanted.

Is it possible to retreive "net use" info and put it in the same file? ie, mapped network drives, etc.?

Top
#132449 - 2005-01-14 03:36 AM Re: Retrieving "net use" info
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4574
Loc: USA
Try
Code:

USE List

_________________________
(... better days ahead)

Top
#132450 - 2005-01-14 09:47 AM Re: Retrieving "net use" info
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
If you want to re-format the "net use" data, use the WshPipe() udf from the UDF library to run the DOS net use and parse the output.
Top
#204348 - 2012-02-26 05:42 PM Re: Retrieving "net use" info [Re: Richard H.]
Seks Offline
Fresh Scripter

Registered: 2002-10-31
Posts: 20
Just goinng back to my old posting...

How can I append the output of "use list" to the redirectoutput textfiles that have been created?

Top
#204350 - 2012-02-27 03:38 AM Re: Retrieving "net use" info [Re: Seks]
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
What about using the UDF WSHPIPE?

That should do it too.

HTH,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#204351 - 2012-02-27 07:28 AM Re: Retrieving "net use" info [Re: Kdyer]
Seks Offline
Fresh Scripter

Registered: 2002-10-31
Posts: 20
I figured it out: I just added another line...

REDIRECTOUTPUT ("\\CORPDC01\LOGS$\user name\@USERID.txt", 0) ? USE LIST

Top
#204424 - 2012-03-08 04:24 PM Re: Retrieving "net use" info [Re: Seks]
Seks Offline
Fresh Scripter

Registered: 2002-10-31
Posts: 20
When I do a "wmic csproduct get vendor,name,identifyingnumber" in dos prompt on my laptop, I actually get the serial number, vendor, and model of my laptop.

How come the below doesn't work?

REDIRECTOUTPUT ("\\corpdc01\logs$\user name\@USERID.txt", 0) ? RUN "wmic csproduct get vendor,name,identifyingnumber"

Top
#204425 - 2012-03-08 04:55 PM Re: Retrieving "net use" info [Re: Seks]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4403
Loc: New Jersey
Because RedirectOutput() sets the output stream for Kix executable, not child processes. Use the following format:
 Code:
$Cmd = '%COMSPEC% /c wmic csproduct get vendor,name,identifyingnumber >> "\\corpdc01\logs$\user name\' + @USERID + '.txt'
Run $Cmd
Glenn
_________________________
Actually I am a Rocket Scientist! \:D

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
0 registered and 2312 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.065 seconds in which 0.029 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