mercoledì 19 dicembre 2018

Centralino IP PBX su Windows - 3CX Phone System which links here: http://www.3cx.it/centralino/index.html

 

 

RSS Feed RSS Feed

Login

Newsletter Newsletter

Registrati

RisorseGuide e Articoli

 

31

Questo script vi permette di inviare, via email, l'IP di una macchina remota.

 

machineName = "nome_macchina"
sender = machinename & " <postmaster@postamaster.it>"
destination = "email_a cui_inviare_IP"

Set objShell = WScript.CreateObject("WScript.Shell")
iReturn = objShell.Run("cmd /c ipconfig /all > " & script_path & "ipconfig_result.txt", 1, TRUE)

Set fsObject = Wscript.CreateObject ("Scripting.FileSystemObject")
Set listFile = fsObject.OpenTextFile (script_path & "ipconfig_result.txt")

do while listFile.AtEndOfStream <> True
    emailBody = emailBody & listFile.ReadLine
Loop

listfile.Close

'Invio email
Set objSMTP = Wscript.CreateObject("CDONTS.NewMail")
objSMTP.From = sender
objSMTP.To = destination
objSMTP.Subject = "IP Config " & machineName
objSMTP.Body = emailBody
objSMTP.Send


Scritto in: Script
AZIONI: E-mail | Permalink |
CONDIVIDI: del.icio.us   Facebook   Digg   Google   Live Bookmarks   Newsvine   StumbleUpon   Technorati   Yahoo   DotNetKicks
blog comments powered by Disqus

Copyright 2011 by SysAdmin.it