Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Determine what computer(s) is/are running a script file

Posted on 2016-09-07
3
Medium Priority
?
63 Views
Last Modified: 2016-09-11
I have a client that is running some VB Script to download files from an FTP site via windows task scheduler.

Unfortunately, they are not entirely sure what computer(s) are running this script.  As part of the script, we are creating a log file every time the script is run, and storing that in a folder on their server.

What I would like to do is determine what computer ran the script.  Is there a way to capture either the computer name or userID of the user that actually ran the script, even if that script is located on a network server
0
Comment
Question by:Dale Fye
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 25

Accepted Solution

by:
SStory earned 2000 total points
ID: 41788438
I may be wrong, but I don't think it would matter where the script is "located" but where it is executed.

Dim WshNetwork
Set WshNetwork = CreateObject("WScript.Network")
WScript.Echo WshNetwork.ComputerName
WScript.Echo WshNetwork.UserName

Open in new window

0
 
LVL 57

Expert Comment

by:Bill Prew
ID: 41791435
As mentioned in prior post, you can get the info you want.  Then you could just add that to the other info that is being logged in the log file.  Yes?  Or need more?

~bp
0
 
LVL 48

Author Closing Comment

by:Dale Fye
ID: 41793497
Thanks, that did the trick
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently I finished a vbscript that I thought I'd share.  It uses a text file with a list of server names to loop through and get various status reports, then writes them all into an Excel file.  Originally it was put together for our Altiris server…
Welcome, welcome!  If you are new to the series and haven't been following along, please take a brief moment to review the first three installments: Part 1 (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/A_266-VBScri…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question