Windows 活动目录 - 目录大小配额?
我遇到过一个使用活动目录并具有磁盘配额的系统,但配额对用户来说并不透明。所有用户显示在窗口中(我的计算机等)并调用 GetDiskFreeSpaceEx 总是返回卷的可用空间,但由于配额,用户永远无法填充此可用空间。无论如何,我无法弄清楚配额的大小,并且在用户 PC 上,我们无法实现任何获取这些值的操作。
似乎配额以某种方式应用于目录级别 - 然后用户只能写入某些目录。因此,用户配额始终显示为磁盘上的可用空间,即使他们无法真正将接近此数量的任何内容写入他们有权访问的任何目录。
有没有人遇到过类似的事情并且知道有关此的 winapi/msdn 文章。我正在尝试编写程序来找出映射的活动目录驱动器为用户提供的可用空间。
A system I have come across, that uses active directory, and has disk quotas, does not have the quotas tranparent to the user. All the users displays in windows (my computer etc.) and calls to GetDiskFreeSpaceEx always return the free space of the volume, and yet the user can never fill this free space because of the quotas. I have not been able to figure out anyway to know the size of the quota, and on the users PC's we have not been able to achieve anything to get these values.
It seems like somehow the quotas are applied on a directory level - and then users are limited to writing to certain directories. So the users quotas always show up as the free space on the disk, even though they cannot really write anything near this amount to any of the directories they have access to.
Has anyone come across something like this and know a winapi/msdn article about this. I am trying to write my program to figure out what free space a mapped active directory drive has for the user.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您需要在 Windows 上执行任何与管理相关的操作,通常可以从 WMI 开始查找。有一个名为 Win32_DiskQuota 的类
Limit
属性。此 Technet 博客文章有一些从 VBScript 调用此方法的示例代码,将其转换为 C# 或 VB.Net 并不难(请查看 System.Management),或者如果您更喜欢 C++,此处的一些示例展示了如何从 C++ 使用 WMI。
If you need to do anything to do with administration on Windows the place to start looking is usually WMI. There's a class called Win32_DiskQuota that has a
Limit
property.This Technet blogpost have some sample code for calling this method from VBScript, which wouldn't be that hard to translate to C# or VB.Net (look at System.Management), or if you prefer C++, here's some samples showing how to use WMI from C++.