When IIS starts, it loads the metabase into memory, where it is available until IIS shuts down. The IIS Admin Base Object enables you to manage data in the metabase through the structures and methods of the IMSAdminBase interface.
You use handles to access keys in the metabase as described in Handles to Keys. The METADATA_MASTER_ROOT_HANDLE is provided by IIS and connects to the root key of the metabase. You use this handle with the OpenKey method to open handles to specific keys, and to specify read or write permissions you need for the key. You can also use an existing open handle from an OpenKey call to open additional handles to other keys.
Once you have a handle to a key, you can use the IIS Admin Base Object methods to manipulate that key's data entries. You can also access subkeys of the currently open key by specifying additional path information.
With a valid handle, you can use the GetData method to retrieve a data entry, or the SetData method to add an entry to the metabase. The GetAllData method enables your application to retrieve all or a subset of the values associated with a key with a single method call. The EnumData method enables your application to enumerate all or a subset of the values associated with a key. When a data entry is no longer needed, you can remove it from the metabase by calling the DeleteData method.
In addition to manipulating data entries, you can add, delete, or move keys from one path to another in the metabase. Use the AddKey method to add keys and the DeleteKey method to delete keys in the metabase. Use the CopyKey method to copy or move a key and all of its subkeys and data items.
Your program can also incorporate event sinks for notification when metabase data is changed by other processes, and when IIS shuts down.
This section contains: