Hi All

This is my first post so let me know if i'm not doing this right. I have a small problem, sometime when my users call with a problem I have to tell them how to get their IP address. I want to eliminate me having to tell them,,,ok so call me lazy. I was thinking about writing a script in which I can e-mail them, they then double click on it and it will get their IP address and e-mail it to me. I'm running Exchange 2000 as my e-mail server and all of my clients are running Outlook 2000 or better. Can someone get me started down the right path for this vbscript

Thanks

Jason Franks, MCSE

Re: How to E-mail an IP Address by ski

ski
Wed Jan 21 10:54:27 CST 2004

Depending on your SP level Outlook may block script attachments. There have
been posts that talk about renaming the My Computer icon to the computer
name with a logon script so I'm sure you could modify those to rename that
icon to the ip address. Then all your users would have to do is look at
that. Just a thought. Sometimes you can email a link to the script in a
word doc and tell the user to ignore the warning message since it is from
you although that sets a potential dangerous precedent.

Here is a very rough script that will get you started on the email part.
The loop that sets the AddressInfo isn't the best, won't grab multiple NICs
but is a start.

ComputerName = "."
set IPConfigSet = GetObject("winmgmts:{impersonationLevel=impersonate}!//"&
ComputerName &"").ExecQuery _
("select IPAddress from Win32_NetworkAdapterConfiguration where
IPEnabled=TRUE")
Set WshNetwork = WScript.CreateObject("WScript.Network")
Set objEmail = CreateObject("CDO.Message")

for each IPConfig in IPConfigSet
if Not IsNull(IPConfig.IPAddress) then
for i=LBound(IPConfig.IPAddress) to UBound(IPConfig.IPAddress)
AddressInfo = "IPAddress: " & IPConfig.IPAddress(i)
next
end if
next

objEmail.From = WshNetwork.username
' $$$ $$$
' $$$ PUT YOUR EMAIL ADDRESS HERE $$$
' $$$ $$$
objEmail.To = "your_email_address"
objEmail.Subject = "IP Address Info"
objEmail.Textbody = AddressInfo
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
' $$$ $$$
' $$$ PUT YOUR MAIL SERVER HERE $$$
' $$$ $$$
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
"mailserver.com"
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objEmail.Configuration.Fields.Update
objEmail.Send



"Jason Franks" <jason.franks@nucorsteelsc.com> wrote in message
news:E8FBB3F2-4AAB-4210-A282-BD20E72B498E@microsoft.com...
> Hi All,
>
> This is my first post so let me know if i'm not doing this right. I have
a small problem, sometime when my users call with a problem I have to tell
them how to get their IP address. I want to eliminate me having to tell
them,,,ok so call me lazy. I was thinking about writing a script in which I
can e-mail them, they then double click on it and it will get their IP
address and e-mail it to me. I'm running Exchange 2000 as my e-mail server
and all of my clients are running Outlook 2000 or better. Can someone get
me started down the right path for this vbscript.
>
> Thanks,
>
> Jason Franks, MCSE