大网数据广告活动
域与目录服务

ADSI and User Account Control

· 52CE 我爱测

Windows and Windows Server have User Account Control, which has ramifications for applications that use Active Directory Service Interfaces (ADSI).

Windows and Windows Server have User Account Control, which has ramifications for applications that use Active Directory Service Interfaces (ADSI). Specifically, these interfaces were designed to be run by a user account with administrator privileges on the local computer.

Problem

Every time an application connects to the directory and attempts to create an ADSI object, the Active Directory Schema is checked for changes. If it has changed since the last connection, the schema is downloaded and stored in a cache on the local computer. In versions of Windows prior to Windows Vista, the default location for this cache was

%systemroot%\SchCache\

However, applications run by standard (that is, non-administrator) accounts will not have access to this directory, and consequently, applications that use ADSI interfaces that are run in this mode will download the schema on every connection, which will impact throughput and performance.

Solutions

Single user - To resolve this issue, there are new ADSI Provider registry control keys that determine the registry locations and file locations for cached Active Directory Schema objects. If the registry key

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\adsi\Cache\PerMachine

is set to 0 (zero), each user will have a different storage location for ADSI; registry keys will be stored in

HKEY_CURRENT_USER\Software\Microsoft\ADs\Providers\LDAP\

and cache files will be stored in

%LOCALAPPDATA%\Microsoft\Windows\SchCache

These settings are the default settings on computers running Windows Server 2008 or Windows Vista.

Multi-user - If you are running ADSI applications on a computer with many user accounts (for example, a web server), then it's preferable not to have many copies of the Active Directory Schema cache using up large amounts of disk space. Setting the registry key

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\adsi\Cache\PerMachine

to 1 (one) will revert ADSI to the previous behavior; all Active Directory Schema objects will be stored in their previous locations; the registry key will be in

HKEY_LOCAL_MACHINE\Software\Microsoft\ADs\Providers\LDAP

and the cache file will be in

%systemroot%\SchCache

In this case, administrator accounts should run the application, which will cause the schema file to be cached in the global location for future use by the less privileged users.

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。