DFS: Windows 2003, Multiple DFS roots & NetDfsEnum

N

Neel

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
 
W

Winsysbee

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
 
N

Neel

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.
 
W

WinSysBee Support

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 said:
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 said:
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
 
W

WinSysBee Support

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 said:
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 said:
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 said:
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
 
N

Neel

WinSysBee,

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

Thanks again.
Neel.

WinSysBee Support said:
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 said:
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 said:
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.


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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top