Link to home
Start Free TrialLog in
Avatar of jskfan
jskfanFlag for Cyprus

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';EXPRESSION={$_.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
ASKER CERTIFIED SOLUTION
Avatar of Qlemo
Qlemo
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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)?
Avatar of jskfan

ASKER

how do I determine which one is my smtp 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.
Avatar of jskfan

ASKER

I tried it, but it does not send email....it does not throw error, but does not send email
Avatar of jskfan

ASKER

it worked now...Thanks
Avatar of jskfan

ASKER

Thanks