In the left pane, browse to the OU in which you want to publish the share.
Right-click the OU and select New → Shared Folder (if you don't see the New heading then you don't have permission to create objects in the OU).
For Name, enter the name of the share as you want it displayed to users.
For UNC Path, enter the network path of the share (e.g., \\fs01\myshare).
' This code publishes a share in AD. ' ------ SCRIPT CONFIGURATION ------ strComputer = "ad-01" ' name of a domain controller strShareName = "Perl Libraries" strSharePath = "\\fs01\perl-libs" strShareDescr = "Core Perl libraries" set objRootDSE = GetObject("LDAP://" & strComputer & "/RootDSE") strParentDN = "/OU=SharedFolders," & objRootDSE.Get("defaultNamingContext") ' ------ END CONFIGURATION --------- set objOU = GetObject("LDAP://" & strComputer & strParentDN) set objVol = objOU.Create("volume", "cn=" & strShareName) objVol.Put "uncName", strSharePath objVol.Put "Description", strShareDescr objVol.SetInfo WScript.Echo "Successfully created object: " & objVol.Name
After you've created a shared folder, your users may not be able
to find it or even know about it. One way to make available sby
publishing them to Active Directory. Shared folders are represented by
volume object class in Active
Directory. The main pieces of information you need in order to create
volume object are the share name,
the share UNC path, and a share description.
Users can search shared folders in Active Directory using the Find Users, Contacts, and Groups dialog box. You can get to this box going to My Network Places and clicking Search Active Directory in the left pane, or by running the Active Directory Users and Computers snap-in, right-clicking the target domain in the left pane and selecting Find. After the box is displayed, select Shared Folders beside Find, enter your search criteria, and click Find Now.
The one major downside to publishing shares in Active Directory
is the maintenance overhead. Unlike printer publishing in Active
Directory, there is no automatic pruning or maintenance process that
volume objects for
shares that no longer exist. Unless you create a process to update
Active Directory whenever a share is created, moved, or deleted,
Active Directory will eventually become out of date and ultimately be
an unreliable source of shared folder information.