Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

getting target location of a folder

28 views
Skip to first unread message

Eric

unread,
Dec 11, 2006, 12:43:40 PM12/11/06
to

Is there anyway a NON-ADMINs can get DFS folder information in VBS
script?

I want a client to see the DFS Referral folder list.

The WMI object seems to require Admin Rights when binding to
Root\CIMV2. (as shown below)

Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer &
"\root\cimv2")
Set colDfsTargets = objWMIService.ExecQuery _
("Select * from Win32_DFSTarget")
For each objDfsTarget in colDfsTargets
Wscript.Echo "Caption: " & vbTab & objDfsTarget.Caption
Wscript.Echo "Description: " & vbTab & objDfsTarget.Description
Wscript.Echo "Install Date: " & vbTab & objDfsTarget.InstallDate
Wscript.Echo "Link Name: " & vbTab & objDfsTarget.LinkName
Wscript.Echo "Name: " & vbTab & objDfsTarget.Name
Wscript.Echo "Server Name: " & vbTab & objDfsTarget.ServerName
Wscript.Echo "Share Name: " & vbTab & objDfsTarget.ShareName
Wscript.Echo "State: " & vbTab & objDfsTarget.State
Wscript.Echo "Status: " & vbTab & objDfsTarget.Status
Next

However, the same client can run the following code below and get the
information:

dfsutil /root:[dfsroot] /view

Any thoughts or suggestions?

0 new messages