Directory Services

IADsFileShare

The IADsFileShare interface is a dual interface that inherits from IADs. It is designed for representing a published file share across the network. Call the methods on IADsFileShare to access or publish data about a file share point.

Methods in Vtable Order

The IADsFileShare interface inherits the methods of the standard COM interfaces:

In addition, IADsFileShare defines the following methods.

Method Description
get_CurrentUserCount Gets the current number of users connected to this share.
get_Description Gets and sets the description of the file share.
put_Description Gets and sets the description of the file share.
get_HostComputer Gets and sets the ADsPath reference to the host computer.
put_HostComputer Gets and sets the ADsPath reference to the host computer.
get_Path Gets and sets the file system path to shared directory.
put_Path Gets and sets the file system path to shared directory.
get_ MaxUserCount Gets the maximum number of users allowed to access share at any one time.

Properties

The IADsFileShare interface defines the following properties. The preceding table includes access methods for these properties.

Property Description
MaxUserCount Gets the maximum number of users allowed to access share at any one time.
CurrentUserCount Gets the current number of users connected to this share.
Description Gets and sets the description of the file share.
HostComputer Gets and sets the ADsPath reference to the host computer.
Path Gets and sets the file system path to shared directory.

Remarks

IADsFileShare is supported by WinNT and NWCOMPAT system providers only. Using the WinNT provider, you can also bind to a FPNW share by substituting "FPNW" for "LanmanServer" in the code examples below.

To bind to a file share, using the WinNT system provider, you can explicitly bind to the file service "LanmanServer" on the host machine, and then enumerate the container to reach the file share of interest, or bind directly to the file share.

Example Code [Visual Basic]

The following code example demonstrates how to bind to the file service and enumerate the container to display the names of the shares in that container.

[Visual Basic]
Dim fs as IADsFileService
Dim share As IADsFileShare
On Error GoTo Cleanup

Set fs = GetObject("WinNT://aComputer/LanmanServer")

For Each share In fs
	MsgBox("Share: " & share.name)
Next share

Cleanup:
	If (Err.Number<>0) Then
		MsgBox("An error has occurred. " & Err.Number)
	End If
	Set fs = Nothing
	Set share = Nothing

The following code example demonstrates how to bind directly to a file share.

Dim fs as IADsFileShare
On Error Resume Next
Set fs = GetObject("WinNT://aComputer/LanmanServer/_file_share_name_")

Requirements

Client: Included in Windows XP and Windows 2000 Professional.
Server: Included in Windows Server 2003 and Windows 2000 Server.
Redistributable: Requires Active Directory Client Extension on Windows NT 4.0 SP6a and Windows 95/98/Me.
Header: Declared in Iads.h.

See Also

IADsFileShare Property Methods