<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>UI 網站 &#187; powershell</title>
	<atom:link href="http://ui.idv.tw/wordpress/?feed=rss2&#038;tag=powershell" rel="self" type="application/rss+xml" />
	<link>https://ui.idv.tw/wordpress</link>
	<description>個人雜亂筆記用</description>
	<lastBuildDate>Wed, 15 Oct 2025 10:08:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
		<item>
		<title>伺服器硬碟空間小於百分之10的情況下，自動化的發出警告mail</title>
		<link>https://ui.idv.tw/wordpress/?p=451</link>
		<comments>https://ui.idv.tw/wordpress/?p=451#comments</comments>
		<pubDate>Fri, 29 Mar 2019 09:04:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[未分類]]></category>
		<category><![CDATA[powershell]]></category>

		<guid isPermaLink="false">http://ui.idv.tw/wordpress/?p=451</guid>
		<description><![CDATA[$mythreshold = 10 $freespace = gwmi Win32_LogicalDisk -Filter "DriveType=3&#8243; &#124; select Name, FileSystem,FreeSpace,BlockSize,Size ForEach($item in $freespace) { $item.BlockSize=(($item.FreeSpace)/($item.Size))*100 $item.FreeSpace=($item.FreeSpace/1GB) $item.Size=($item.Size/1GB) if ($item.BlockSize -lt $mythreshold){ $from = "ithelp@athentek.com" $to = "ithelp@miniasp.com" $subject = "Low Disk Space!" $body = "Free Space Remaining: &#8230; <a href="https://ui.idv.tw/wordpress/?p=451">繼續閱讀 <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>$mythreshold = 10</p>
<p>$freespace = gwmi Win32_LogicalDisk -Filter "DriveType=3&#8243; | select Name, FileSystem,FreeSpace,BlockSize,Size</p>
<p>ForEach($item in $freespace)</p>
<p>{</p>
<p>$item.BlockSize=(($item.FreeSpace)/($item.Size))*100</p>
<p>$item.FreeSpace=($item.FreeSpace/1GB)</p>
<p>$item.Size=($item.Size/1GB)</p>
<p>if ($item.BlockSize -lt $mythreshold){</p>
<p>$from = "ithelp@athentek.com"</p>
<p>$to = "ithelp@miniasp.com"</p>
<p>$subject = "Low Disk Space!"</p>
<p>$body = "Free Space Remaining: " + "
</p>
<p>磁碟總容量(GB)：" + $item.size + "
</p>
<p>剩餘空間(GB)：" + $item.FreeSpace + "
</p>
<p>磁區：" + $item.name + "
</p>
<p>剩餘百分比：" + $item.BlockSize +"%"</p>
<p>$smtpServer = "192.168.2.3&#8243;</p>
<p>Send-MailMessage -From $from -to $to -Subject $subject -Body $body -SmtpServer $smtpServer -BodyAsHtml -Encoding UTF8</p>
<p>}</p>
<p>}</p>
]]></content:encoded>
			<wfw:commentRss>https://ui.idv.tw/wordpress/?feed=rss2&#038;p=451</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
