![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #2 (permalink) | ||||||||||||
| Guest
Posts: n/a
| Re: Query disk free space.... tke402 wrote:
that could be written though. -You need to query remote computers also? -Just a single email address or a collection? Marco -- Microsoft MVP - Windows PowerShell http://www.microsoft.com/mvp PowerGadgets MVP http://www.powergadgets.com/mvp Blog: http://marcoshaw.blogspot.com | ||||||||||||
| | #3 (permalink) | ||||||||||||||||||||||||
| Guest
Posts: n/a
| Re: Query disk free space.... Quering remote servers would be helpful. The email would be to a distribution list. i.e. ITDept@xxxxxx "Marco Shaw [MVP]" wrote:
| ||||||||||||||||||||||||
| | #4 (permalink) | ||||||||||||||||||||||||||||||||||||
| Guest
Posts: n/a
| Re: Query disk free space.... Hi TKE402, You can query remote server disks using get-wmiObject cmdlet: # replace <computerName> with the remote server name or ip # replace <smtpServer> with the smtp server name or ip $disks = get-wmiObject win32_logicaldisk -filter "DriveType=3" -computerName <computerName> | where { (([long]$_.freespace/[long]$_.size)*100) -lt 10 } | select systemName, DeviceID if($disks) { $smtp = new-object system.net.mail.smtpClient(<smtpServer>) $mail = new-object System.Net.Mail.MailMessage $mail.from = "me@xxxxxx" $mail.to.add("ITDept@xxxxxx") $mail.subject = "Low disk space" $mail.body = $disks $smtp.send($mail) } --- Shay Levi $cript Fanatic http://scriptolog.blogspot.com
| ||||||||||||||||||||||||||||||||||||
| | #5 (permalink) | ||||||||||||||||||||||||||||||||||||
| Guest
Posts: n/a
| Re: Query disk free space.... Maybe there is an error with my word wrap or the way I'm cutting and pasting. I am receivnig error that may be pertaining to syntax. Just to make sure, are the two references to computer name correct? -computerName <computerName> or do you just mean to have it there once? Thanks, TKE402 "Shay Levi" wrote:
| ||||||||||||||||||||||||||||||||||||
| | #6 (permalink) | ||||||||||||
| Guest
Posts: n/a
| Re: Query disk free space.... tke402 wrote:
-computerName <computerName> You should be inserting whatever computer you want to query, like so, for example: -computerName server1.domain Marco -- Microsoft MVP - Windows PowerShell http://www.microsoft.com/mvp PowerGadgets MVP http://www.powergadgets.com/mvp Blog: http://marcoshaw.blogspot.com | ||||||||||||
| |
| |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Query shared folder free space | David Kriz | PowerShell | 24 | 06-07-2008 04:12 PM |
| Misreported Used/Free Disk Space | Shade_C | Vista General | 3 | 04-17-2008 07:11 AM |
| RE: SP1 CREATES Free Disk Space! | Jason | Vista General | 1 | 03-25-2008 09:01 AM |
| Out of disk space error at installations, though 100 Gb free space | Evagoud | Vista General | 5 | 11-04-2007 02:48 AM |
| disk free space anomaly | dave4503 | Vista performance & maintenance | 2 | 06-15-2006 05:54 PM |