The property methods of the IADsFileshare interface get or set the properties described in the following table. For more information, see Interface Property Methods.
Properties
Property Description
CurrentUserCount
[Visual Basic]
Access: Read-only
DataType: Long
Example Code [Visual Basic]
To access the properties of file shares on a computer, you must first bind to the "LanmanServer" on the machine. The following code example shows how to set up the description and the maximum number of allowed users for all the public file shares on the computer, named as "myMachine", in the default domain.
Dim fs As IADsFileService
Dim share As IADsFileShare
On Error GoTo Cleanup
Set fs = GetObject("WinNT://myMachine/LanmanServer")
If (fs.class = "FileService") Then
For Each share In fs
share.description = share.name & " is my working folder."
share.MaxUserCount = 10
share.SetInfo
Next share
End if
Cleanup:
If (Err.Number<>0) Then
MsgBox("An error has occurred. " & Err.Number)
End If
Set fs = Nothing
Set share = Nothing
Example Code [Visual Basic]
The following code example shows how to make the existing C:\MyFolder directory a public file share.
Dim fs As IADsFileShare
Dim cont As IADsContainer
On Error GoTo Cleanup
Set cont = GetObject("WinNT://yourDomain/yourMachineName/LanmanServer")
Cleanup:
If (Err.Number<>0) Then
MsgBox("An error has occurred. " & Err.Number)
End If
Set cont = Nothing
Set fs = Nothing
Example Code [C++]
The following code example makes the existing C:\MyFolder directory a public file share.
Cleanup:
if(pCont) pCont->Release();
if(pShare) pShare->Release();
Requirements
Client: Requires Windows XP or Windows 2000 Professional.
Server: Requires Windows Server 2003 or Windows 2000 Server.
Redistributable: Requires Active Directory Client ExtensiononWindows NT 4.0,Windows 95,Windows 98andWindows Me.
Header: Declared in Iads.h.
Library: Included as a resource in Activeds.dll.
GUID: IID_IADsFileShare is defined as EB6DCAF0-4B83-11CF-A995-00AA006BC149.