Microsoft® Windows® 2000 Scripting Guide
« Previous | Next »
One problem with shared folders is that each shared folder is tied to an individual computer. To access the resources on a shared folder, users must know not only the name of the shared folder itself but also the name of the computer where that shared folder is located. In a large organization, this can make it difficult to find resources.
One way to overcome this problem is to publish shared folders in Active Directory. When a shared folder is published in Active Directory, users can search for such a folder using Network Neighborhood.
You can also search for shared folders using ADSI scripts or Active Directory Users and Computers. Regardless of the tool you use, you can search for these resources based not only on name but also on description or keyword.
Shared folders are published in Active Directory by creating an instance of the Volume class that represents the shared folder. Some of the key attributes of the Volume class are listed in Table 11.14.
Table 11.14 Volume Class Attributes
Attribute | Description |
---|---|
CN | Common name. Name of the object as displayed in Active Directory Users and Computers. (This is typically the same name as the share name.) For example: FinanceShare |
UNCName | UNC path of the shared folder. For example: \\Server1\FinanceShare |
Description | Description of the share and its contents. |
Keywords | Array of descriptive terms that can be used in searching for specific shared folders. |
ManagedBy | Indicates the user responsible for the share. |
Folders can be published in Active Directory either by using Active Directory Users and Computers or by using a custom ADSI script. An ADSI script can also be used to enumerate all the shared folders on a computer and then publish each one in Active Directory.
Listing 11.38 contains a script that publishes a shared folder in Active Directory. To carry out this task, the script must perform the following steps:
This description is available to anyone who accesses the shared folder in Active Directory Users and Computers. However, this description is not available to anyone accessing the shared folder by using Network Neighborhood, nor is this the same description as the one set using the WMI Win32_Share class.
The Keywords property is a multiple-attribute property; that is, it can accept more than one value. To assign multiple keywords to the folder, the keywords are passed as parameters using the Array method.
Listing 11.38 Publishing a Shared Folder in Active Directory
|
|
Send us your feedback | « Previous | Next » |