Sub Foo()
Dim comp As IADsComputer
Dim serv As IADsService
Dim fserv As IADsContainer
Dim share As IADsFileShare
Dim shareNew As IADsFileShare
Dim v As Variant
' Replace DOMAIN, SERVER & SHARE with the appropriate
' domain, server and share names
Set share = GetObject("WinNT://DOMAIN/SERVER/lanmanserver/SHARE")
v = share.Path ' Gets directory path on server
Set share = nothing
' Replace DOMAIN & SERVER with the appropriate domain and server names
Set fserv = GetObject("WinNT://DOMAIN/SERVER/lanmanserver")
' Enumerate existing shares
For Each share In fserv
v = share.Class
v = share.ADsPath
v = share.HostComputer
v = share.Path
Next share
' Create share in fileservice container
Set shareNew = fserv.Create("fileshare", "newshare")
shareNew.Path = "C:\"
shareNew.SetInfo ' Commit new share
' Delete share
fserv.Delete "fileshare", "newshare"
' Fails since share is gone
shareNew.GetInfo
End Sub