Windows 活动目录 - 目录大小配额?

发布于 2024-09-07 01:36:44 字数 333 浏览 8 评论 0原文

我遇到过一个使用活动目录并具有磁盘配额的系统,但配额对用户来说并不透明。所有用户显示在窗口中(我的计算机等)并调用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

暮凉 2024-09-14 01:36:44

如果您需要在 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++.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文