Who is draining your file server storage space? 【转载】【翻译】

本文介绍如何利用Windows Server 2003 R2中的文件服务器资源管理器(FSRM)功能来跟踪并设置存储配额,包括四种扩展FSRM的方法:命令行工具、图形界面、WMI监听及报表解析。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

该篇文章是我于2009年6月10日通过自己编写的工具,批量从位于在博客园的博客站点(http://chenxizhang.cnblogs.com)同步而来。文章中的图片地址仍然是链接到博客园的。特此说明!

陈希章

原文地址:http://www.cnblogs.com/chenxizhang/archive/2008/10/30/1323024.html
原文标题:Who is draining your file server storage space? 【转载】【翻译】
原文发表:2008/10/30 6:51:00

By Jabez Gan, ZDNet Asia
Tuesday, August 22, 2006 05:10 PM

The File Server Resource Manager feature in Windows Server 2003 helps system administrators keep track and set storage quotas.
Have you ever noticed that your file server storage space has quickly run out after upgrading the file server storage device?

Your management might say: "Our employees are doing a great job! They are doing loads more work!" But have you ever wondered what is actually stored in the server? Are they all work related files?

While working on a freelance basis for IT departments in many small companies, I have found, on browsing the file server, that computer users store non-work related files like MP3 or video files.

Although I don't personally mind that computer users store these files temporarily for the occasional viewing, it is not acceptable when each employee stories his or her own collection of music, jokes or videos without deleting them from time to time.

System administrators can save time spent monitoring the file types that users have by using the File Server Resource Manager (FSRM) which is a feature in Windows Server 2003 R2.

File Server Resource Manager offers: one, quota management; two, file screening; and three, storage report.

In this article, I'll show how you can extend FSRM.

In the current version of FSRM, which is included in R2, there is no public SDK. It provides four different ways for a developer to "express" themselves by:

  • Using the FSRM command line tools to develop configuration scripts
  • Using an executable as a notification action for quota or screening (configurable through the GUI of FSRM)
  • Listening to the WMI events which FSRM sends for quota/screening notifications
  • Writing an application which parse FSRM reports in XML or SCV format and adds extra value

Method 1:
FSRM command line tools include (located under %windir%/system32):

  • Dirquota.exe--Quota Management
  • Filescrn.exe--File Screening
  • Storrept.exe--Storage Reports

Here is a scenario: As a developer, you are told to create a custom application to ease the administrator's repetitive tasks. For developing this custom application, I would recommend Visual Studio 2003/2005.

Not going too deep into Visual Studio, I'll show you some sleek scenarios that the administrator would want the developer to create.

Let's say you want to generate storage reports in XML format and have your custom application parse the XML file (you can use system.diagnostics.process class when coding the custom application through VS .NET, but in this example I'll keep things simple and give a Command Prompt format) :

C:/>storrept reports generate /ondemand /report:mostrecentlyaccessed /scope:%userprofile% /format:xml

The above will generate the XML immediately with the search scope in the environment path %userprofile%, and the resulting XML file will be saved under %systemdrive%:/StorageReports/Interactive.

There are many tags that you can parse into your application.

On parsing the XML file with Visual Basic .NET, we can use either .NET Framework which includes XmlTextReader, XmlDocument, XmlSerializer, DataSet and XpathDocument. Again, this isn't a tutorial on parsing XML, so I'll leave that out for your research.

"We hire many newbies on a monthly basis!" This is another common scenario! Creating quotas will be another repetitive task for the administrator, so to ease his job, the custom application can take the username of the new user account created and run a command (or script through the custom application):

C:/>dirquota quota add /path:"C:/documents and
settings/newbie1/My Documents?/limit:50MB /type: hard

See ma! This newbie1 user will not be able to use up our space!

The above will add a new quota to the My Documents folder of user newbie1 with a folder quota of 50MB. If the above command doesn't suit you, you can actually modify the parameters through your custom application.

Method 2:
If you want an executable to run as a notification, this can be done all from the GUI of FSRM. But if you have many quotas configured, it isn't recommended that you use the GUI as it chokes up the system. Use the command line tools instead.

Method 3:
What about extending through WMI (Windows Management Instrumentation)? Good news and bad news: There is only support for WMI notifications but not WMI Management Interfaces. What does this mean? You will only be able to use WMI to monitor FSRM's notifications and not manage FSRM through WMI.

Here is a link to get you started on playing with WMI and FSRM through Monad (now renamed to Windows PowerShell):
http://mow001.blogspot.com/2006/01/watching-fsrm-quota-and-filescreen.html

Method 4:
Storage Reports support XML and CSV formats which allow extensibility. You can create some scheduled tasks to get the XML/CSV reports created and use your custom application to parse the XML or CSV files. We briefly touched on this topic in Method 1 above.

With just this single feature of R2, you should be able to identify the user who is using the most storage space in your file server.

Click on these links for more information about FSRM; XML File Parsing in VB.NET; and .NET Framework Class Library: System.Diagnostics.Process

Jabez Gan has been working on computers (clients and servers) on a freelance basis since he was 14 years old. An author for a Microsoft related blog (http://www.msblog.org), Gan specializes in Windows Server File System and is a Microsoft MVP (Most Valuable Professional). Gan is currently a student majoring in Computer Science at the University of Nottingham.

 

 

我的简短翻译

本文是针对Windows Server 2003 R2中的一个文件服务器资源管理的功能,列出了四种方式

1. 直接调用命名行工具(一共四个)

Dirquota: http://go.microsoft.com/fwlink/?LinkId=92741
Filescrn: http://go.microsoft.com/fwlink/?LinkId=92742
Storrept: http://go.microsoft.com/fwlink/?LinkId=92743

Schtasks.exe to schedule the tasks.

这三个工具就可以做所有的事情

2. 使用图形化界面 FSRM。这是一个基于MMC3.0的工具

image

3.通过WMI,但要注意,WMI只可以进行查询,但不可以进行操作

win32_quotalimitevent
win32_quotathresholdevent
win32_filescreenevent
win32_quotaevent

4.在报表这个部分,因为它可以生成XML或者CSV的格式报表,那么就可以在这个基础上做一些扩展和开发。

作者:陈希章
出处:http://blog.youkuaiyun.com/chen_xizhang
本文版权归作者所有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值