Is there a way of obtaining the server name with vbsript
In much the same way as you would use @@SERVERNAME in SQL
I need it just to tag it onto an e-mail
Wich server name do you want ?
http server, mail server, ... ???
Be more clear about your architecture. Water is not bad as long as it stays out human body ;-)
The http server
Basically it is the server I am operating on
I want to create a piece of vbsript that I can put on a number of servers and have this e-mail the free space at 7am for analysis
This e-mail should contain the relevant server being interogated
I can do everything bar obtaining the local server name to append to the message
Hope that explains it
If you run your script locally on each server, you can obtain computer name by reading this registry key : "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\ComputerName\ComputerName".
Note : use "WshShell.RegRead" method to read registry.
Water is not bad as long as it stays out human body ;-)
To retrieve the Hostname of the local PC, use the ComputerName property of the Network object.
Set oNetwork = CreateObject("WScript.Network"
WScript.Echo oNetwork.ComputerName
FWIW, if your servers or Win2k or later, you may want to explore using WMI to achieve your tasks remotely, ISO, having to drop this process on each server.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.