jskfan
asked on
powershell to send an email
I have this powershell command that displays the free disk space on all drives in the remote computer.
gwmi win32_volume -computername remotecomputername -Filter 'drivetype = 3' | select driveletter, label, @{LABEL='GBfreespace';EXPR ESSION={$_ .free
space/1GB} }
I need to add something to the script so that it will send an email for the output of the powershell command
then I will schedule it in my task scheduler.
Thanks
gwmi win32_volume -computername remotecomputername -Filter 'drivetype = 3' | select driveletter, label, @{LABEL='GBfreespace';EXPR
space/1GB} }
I need to add something to the script so that it will send an email for the output of the powershell command
then I will schedule it in my task scheduler.
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
And why should you want to use an external script if there is a ready-to-use, simple cmdlet doing the same (and even more)?
ASKER
how do I determine which one is my smtp server?
is it the mailbox or hub /cas server ?
is it the mailbox or hub /cas server ?
Whatever server runs the SMTP receiver - usually the hub. You can use your public mail address, that should work at all times.
ASKER
I tried it, but it does not send email....it does not throw error, but does not send email
ASKER
it worked now...Thanks
ASKER
Thanks