When IIS starts, it loads the metabase into memory, where the metabase is available until IIS shuts down. The IIS Admin Base Object, along with the structures and methods of the IMSAdminBase interface, can be used to manage data in the metabase.
You use handles to access keys in the metabase as described in Handles to Keys. The METADATA_MASTER_ROOT_HANDLE, provided by IIS, connects to the root key of the metabase. You can use METADATA_MASTER_ROOT_HANDLE with the OpenKey method to open handles to specific keys, and to specify read or write permissions you need for those keys. 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 or modify an entry to the metabase. The GetAllData method enables your application to retrieve all, or a subset of, the values associated with a key by using 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.