RSS

查看某ou下所有计算机的硬盘空闲值

23 May

域内管理计算机的时候,不可能每天去查服务器的硬盘容量是否足够. 当然部署scom的确能解决该问题.

   1: ([ADSI]LDAP://OU=SQL Servers,DC=yourdomain,DC=com).psbase.Children | `
   2:  ?{$_.ObjectCategory -like "*computer*"} | `
   3: %{Write-Host $_.name; gwmi win32_LogicalDisk -comp $_.name -filter "DriveType=3" `
   4: | ft DeviceID, @{Label="Gb Free(Approx.)";Expression={[int]($_.Freespace/1GB)}} -a}

对于普通管理员而言,做个计划任务查查记录也不错嘛.

Advertisements
 
Leave a comment

Posted by on May 23, 2009 in Powershell

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: