DFS: Windows 2003, Multiple DFS roots & NetDfsEnum

G

Guest

Guest
Archived from groups: microsoft.public.win2000.file_system (More info?)

After I create multiple DFS roots on windows 2003, NetDfsEnum does not
work. Returns error 4319 ( ERROR_DEVICE_NOT_AVAILABLE ).

If I pass name of DFS root instead of only name of the machine for
example \\<MachineName>\<RootName> to NetDfsEnum then it enums all the
links in that root, which I believe its supposed to do.

Is there a way to enum MULTIPLE DFS roots on Windows 2003 ?

Thanks,
Neel
 
G

Guest

Guest
Archived from groups: microsoft.public.win2000.file_system (More info?)

You can try to use the DFSCore.dll COM object.
It works fine, and should give you the answer.

Otherwise, you can use NetDfsEnum like that:

Private Type DFS_STORAGE_INFO
State As Long
servername As Long
ShareName As Long
End Type

Private Type DFS_INFO_3
EntryPath As Long
Comment As Long
State As Long
NumberOfStorages As Long
Storage As DFS_STORAGE_INFO
End Type

Ret = NetDfsEnum(DfsName(0), 3, MAX_PREFERRED_LENGTH, pBuffer, lngEntriesRead, resumehandle)

To enum the collection:
For i = 0 To lngEntriesRead - 1
CopyMemory DFSInfo3, ByVal pBuffer + (i) * Len(DFSInfo3), Len(DFSInfo3)
Next i


WinSysBee Support Team
http://www.winsysbee.com

nntp://news.free.fr/microsoft.public.win2000.file_system/ >

After I create multiple DFS roots on windows 2003, NetDfsEnum does not
work. Returns error 4319 ( ERROR_DEVICE_NOT_AVAILABLE ).

If I pass name of DFS root instead of only name of the machine for
example \\\ to NetDfsEnum then it enums all the
links in that root, which I believe its supposed to do.

Is there a way to enum MULTIPLE DFS roots on Windows 2003 ?

Thanks,
Neel
 
G

Guest

Guest
Archived from groups: microsoft.public.win2000.file_system (More info?)

Winsysbee, Thanks for the reply.
I have one question:

> Ret = NetDfsEnum(DfsName(0), 3, MAX_PREFERRED_LENGTH, pBuffer, lngEntriesRead, resumehandle)

What does DfsName(0) represent ?
1] Is DfsName a string having name of the computer for example
\\machineName
OR
2] Is DfsName name of DFS Root for example, \\MachineName\<Dfs Root
Name> ?

On Windows 2003 Server with more than one DFS roots (Standalone
roots):
-----------------------------------------------------------------------

1] Passing machine name to NetDfsEnum as first parameter, gives the
error ERROR_DEVICE_NOT_AVAILABLE

2] If its a DFS Root name how do I get names of all DFS Roots defined
?

Thanks again,
Neel.


"Winsysbee" <support.nospam@winsysbee.com> wrote in message news:<4267ecd8$0$29215$626a14ce@news.free.fr>...
> You can try to use the DFSCore.dll COM object.
> It works fine, and should give you the answer.
>
> Otherwise, you can use NetDfsEnum like that:
>
> Private Type DFS_STORAGE_INFO
> State As Long
> servername As Long
> ShareName As Long
> End Type
>
> Private Type DFS_INFO_3
> EntryPath As Long
> Comment As Long
> State As Long
> NumberOfStorages As Long
> Storage As DFS_STORAGE_INFO
> End Type
>
> Ret = NetDfsEnum(DfsName(0), 3, MAX_PREFERRED_LENGTH, pBuffer, lngEntriesRead, resumehandle)
>
> To enum the collection:
> For i = 0 To lngEntriesRead - 1
> CopyMemory DFSInfo3, ByVal pBuffer + (i) * Len(DFSInfo3), Len(DFSInfo3)
> Next i
>
>
> WinSysBee Support Team
> http://www.winsysbee.com
>
> nntp://news.free.fr/microsoft.public.win2000.file_system/ >
>
> After I create multiple DFS roots on windows 2003, NetDfsEnum does not
> work. Returns error 4319 ( ERROR_DEVICE_NOT_AVAILABLE ).
>
> If I pass name of DFS root instead of only name of the machine for
> example \\\ to NetDfsEnum then it enums all the
> links in that root, which I believe its supposed to do.
>
> Is there a way to enum MULTIPLE DFS roots on Windows 2003 ?
>
> Thanks,
> Neel
 
G

Guest

Guest
Archived from groups: microsoft.public.win2000.file_system (More info?)

It is both but when you pass the parameter, you have to delete "\\", this is
why it did not work.
so DfsName(0) points to a byte structure like that MachineName or
MachineName\DfsRoot


WinSysBee Support
http://www.winsysbee.com


"Neel" <neelagain@yahoo.com> wrote in message
news:1ba43d95.0504230550.6593e3e6@posting.google.com...
> Winsysbee, Thanks for the reply.
> I have one question:
>
>> Ret = NetDfsEnum(DfsName(0), 3, MAX_PREFERRED_LENGTH, pBuffer,
>> lngEntriesRead, resumehandle)
>
> What does DfsName(0) represent ?
> 1] Is DfsName a string having name of the computer for example
> \\machineName
> OR
> 2] Is DfsName name of DFS Root for example, \\MachineName\<Dfs Root
> Name> ?
>
> On Windows 2003 Server with more than one DFS roots (Standalone
> roots):
> -----------------------------------------------------------------------
>
> 1] Passing machine name to NetDfsEnum as first parameter, gives the
> error ERROR_DEVICE_NOT_AVAILABLE
>
> 2] If its a DFS Root name how do I get names of all DFS Roots defined
> ?
>
> Thanks again,
> Neel.
>
>
> "Winsysbee" <support.nospam@winsysbee.com> wrote in message
> news:<4267ecd8$0$29215$626a14ce@news.free.fr>...
>> You can try to use the DFSCore.dll COM object.
>> It works fine, and should give you the answer.
>>
>> Otherwise, you can use NetDfsEnum like that:
>>
>> Private Type DFS_STORAGE_INFO
>> State As Long
>> servername As Long
>> ShareName As Long
>> End Type
>>
>> Private Type DFS_INFO_3
>> EntryPath As Long
>> Comment As Long
>> State As Long
>> NumberOfStorages As Long
>> Storage As DFS_STORAGE_INFO
>> End Type
>>
>> Ret = NetDfsEnum(DfsName(0), 3, MAX_PREFERRED_LENGTH, pBuffer,
>> lngEntriesRead, resumehandle)
>>
>> To enum the collection:
>> For i = 0 To lngEntriesRead - 1
>> CopyMemory DFSInfo3, ByVal pBuffer + (i) * Len(DFSInfo3),
>> Len(DFSInfo3)
>> Next i
>>
>>
>> WinSysBee Support Team
>> http://www.winsysbee.com
>>
>> nntp://news.free.fr/microsoft.public.win2000.file_system/ >
>>
>> After I create multiple DFS roots on windows 2003, NetDfsEnum does not
>> work. Returns error 4319 ( ERROR_DEVICE_NOT_AVAILABLE ).
>>
>> If I pass name of DFS root instead of only name of the machine for
>> example \\\ to NetDfsEnum then it enums all the
>> links in that root, which I believe its supposed to do.
>>
>> Is there a way to enum MULTIPLE DFS roots on Windows 2003 ?
>>
>> Thanks,
>> Neel
 
G

Guest

Guest
Archived from groups: microsoft.public.win2000.file_system (More info?)

To complete my support, i would like to tell you that i'm using the DfsEnum
like that:

1) i enum the existing names of the DfsName with NetDfsEnum and with the
structure "300"
Ret = NetDfsEnum(DfsName(0), 300, MAX_PREFERRED_LENGTH, pBuffer,
lngEntriesRead, resumehandle)

Private Type DFS_INFO_300
flags As Long
DfsName As Long
End Type

2) i'm using the COM Object DfsCore.dll in order to retreive the whole
information about the Dfs root.
Dim DiskDFS As DfsRoot
DiskDFS.Initialize DfsName
where DfsName is machinename or machinename\rootname

WinSysBee Support
http://www.winsysbee.com



"WinSysBee Support" <support.nospam@free.fr> wrote in message
news:426ca073$0$20638$626a14ce@news.free.fr...
> It is both but when you pass the parameter, you have to delete "\\", this
> is why it did not work.
> so DfsName(0) points to a byte structure like that MachineName or
> MachineName\DfsRoot
>
>
> WinSysBee Support
> http://www.winsysbee.com
>
>
> "Neel" <neelagain@yahoo.com> wrote in message
> news:1ba43d95.0504230550.6593e3e6@posting.google.com...
>> Winsysbee, Thanks for the reply.
>> I have one question:
>>
>>> Ret = NetDfsEnum(DfsName(0), 3, MAX_PREFERRED_LENGTH, pBuffer,
>>> lngEntriesRead, resumehandle)
>>
>> What does DfsName(0) represent ?
>> 1] Is DfsName a string having name of the computer for example
>> \\machineName
>> OR
>> 2] Is DfsName name of DFS Root for example, \\MachineName\<Dfs Root
>> Name> ?
>>
>> On Windows 2003 Server with more than one DFS roots (Standalone
>> roots):
>> -----------------------------------------------------------------------
>>
>> 1] Passing machine name to NetDfsEnum as first parameter, gives the
>> error ERROR_DEVICE_NOT_AVAILABLE
>>
>> 2] If its a DFS Root name how do I get names of all DFS Roots defined
>> ?
>>
>> Thanks again,
>> Neel.
>>
>>
>> "Winsysbee" <support.nospam@winsysbee.com> wrote in message
>> news:<4267ecd8$0$29215$626a14ce@news.free.fr>...
>>> You can try to use the DFSCore.dll COM object.
>>> It works fine, and should give you the answer.
>>>
>>> Otherwise, you can use NetDfsEnum like that:
>>>
>>> Private Type DFS_STORAGE_INFO
>>> State As Long
>>> servername As Long
>>> ShareName As Long
>>> End Type
>>>
>>> Private Type DFS_INFO_3
>>> EntryPath As Long
>>> Comment As Long
>>> State As Long
>>> NumberOfStorages As Long
>>> Storage As DFS_STORAGE_INFO
>>> End Type
>>>
>>> Ret = NetDfsEnum(DfsName(0), 3, MAX_PREFERRED_LENGTH, pBuffer,
>>> lngEntriesRead, resumehandle)
>>>
>>> To enum the collection:
>>> For i = 0 To lngEntriesRead - 1
>>> CopyMemory DFSInfo3, ByVal pBuffer + (i) * Len(DFSInfo3),
>>> Len(DFSInfo3)
>>> Next i
>>>
>>>
>>> WinSysBee Support Team
>>> http://www.winsysbee.com
>>>
>>> nntp://news.free.fr/microsoft.public.win2000.file_system/ >
>>>
>>> After I create multiple DFS roots on windows 2003, NetDfsEnum does not
>>> work. Returns error 4319 ( ERROR_DEVICE_NOT_AVAILABLE ).
>>>
>>> If I pass name of DFS root instead of only name of the machine for
>>> example \\\ to NetDfsEnum then it enums all the
>>> links in that root, which I believe its supposed to do.
>>>
>>> Is there a way to enum MULTIPLE DFS roots on Windows 2003 ?
>>>
>>> Thanks,
>>> Neel
>
>
 
G

Guest

Guest
Archived from groups: microsoft.public.win2000.file_system (More info?)

WinSysBee,

Using Level 300 did the trick.. Thanks a lot !

Thanks again.
Neel.

"WinSysBee Support" <support.nospam@free.fr> wrote in message news:<426ca4a5$0$20636$626a14ce@news.free.fr>...
> To complete my support, i would like to tell you that i'm using the DfsEnum
> like that:
>
> 1) i enum the existing names of the DfsName with NetDfsEnum and with the
> structure "300"
> Ret = NetDfsEnum(DfsName(0), 300, MAX_PREFERRED_LENGTH, pBuffer,
> lngEntriesRead, resumehandle)
>
> Private Type DFS_INFO_300
> flags As Long
> DfsName As Long
> End Type
>
> 2) i'm using the COM Object DfsCore.dll in order to retreive the whole
> information about the Dfs root.
> Dim DiskDFS As DfsRoot
> DiskDFS.Initialize DfsName
> where DfsName is machinename or machinename\rootname
>
> WinSysBee Support
> http://www.winsysbee.com
>
>
>
> "WinSysBee Support" <support.nospam@free.fr> wrote in message
> news:426ca073$0$20638$626a14ce@news.free.fr...
> > It is both but when you pass the parameter, you have to delete "\\", this
> > is why it did not work.
> > so DfsName(0) points to a byte structure like that MachineName or
> > MachineName\DfsRoot
> >
> >
> > WinSysBee Support
> > http://www.winsysbee.com
> >
> >
> > "Neel" <neelagain@yahoo.com> wrote in message
> > news:1ba43d95.0504230550.6593e3e6@posting.google.com...
> >> Winsysbee, Thanks for the reply.
> >> I have one question:
> >>
> >>> Ret = NetDfsEnum(DfsName(0), 3, MAX_PREFERRED_LENGTH, pBuffer,
> >>> lngEntriesRead, resumehandle)
> >>
> >> What does DfsName(0) represent ?
> >> 1] Is DfsName a string having name of the computer for example
> >> \\machineName
> >> OR
> >> 2] Is DfsName name of DFS Root for example, \\MachineName\<Dfs Root
> >> Name> ?
> >>
> >> On Windows 2003 Server with more than one DFS roots (Standalone
> >> roots):
> >> -----------------------------------------------------------------------
> >>
> >> 1] Passing machine name to NetDfsEnum as first parameter, gives the
> >> error ERROR_DEVICE_NOT_AVAILABLE
> >>
> >> 2] If its a DFS Root name how do I get names of all DFS Roots defined
> >> ?
> >>
> >> Thanks again,
> >> Neel.
> >>
> >>
> >> "Winsysbee" <support.nospam@winsysbee.com> wrote in message
> >> news:<4267ecd8$0$29215$626a14ce@news.free.fr>...
> >>> You can try to use the DFSCore.dll COM object.
> >>> It works fine, and should give you the answer.
> >>>
> >>> Otherwise, you can use NetDfsEnum like that:
> >>>
> >>> Private Type DFS_STORAGE_INFO
> >>> State As Long
> >>> servername As Long
> >>> ShareName As Long
> >>> End Type
> >>>
> >>> Private Type DFS_INFO_3
> >>> EntryPath As Long
> >>> Comment As Long
> >>> State As Long
> >>> NumberOfStorages As Long
> >>> Storage As DFS_STORAGE_INFO
> >>> End Type
> >>>
> >>> Ret = NetDfsEnum(DfsName(0), 3, MAX_PREFERRED_LENGTH, pBuffer,
> >>> lngEntriesRead, resumehandle)
> >>>
> >>> To enum the collection:
> >>> For i = 0 To lngEntriesRead - 1
> >>> CopyMemory DFSInfo3, ByVal pBuffer + (i) * Len(DFSInfo3),
> >>> Len(DFSInfo3)
> >>> Next i
> >>>
> >>>
> >>> WinSysBee Support Team
> >>> http://www.winsysbee.com
> >>>
> >>> nntp://news.free.fr/microsoft.public.win2000.file_system/ >
> >>>
> >>> After I create multiple DFS roots on windows 2003, NetDfsEnum does not
> >>> work. Returns error 4319 ( ERROR_DEVICE_NOT_AVAILABLE ).
> >>>
> >>> If I pass name of DFS root instead of only name of the machine for
> >>> example \\\ to NetDfsEnum then it enums all the
> >>> links in that root, which I believe its supposed to do.
> >>>
> >>> Is there a way to enum MULTIPLE DFS roots on Windows 2003 ?
> >>>
> >>> Thanks,
> >>> Neel
> >
> >