Posted on 11-25-2011 01:06 PM
We are moving from pc based to mac. I wanted to use recon to gather info from the pc to make the transition easier. I can get a list of printers they have installed on the pc. I also wanted to get a list of mapped network drives. I found a VB script that says it will do that but not sure how to word it correctly to work as a VB extension attribute.
On Error Resume Next
Set objNetwork = CreateObject("Wscript.Network")
Set colDrives = objNetwork.EnumNetworkDrives
For i = 0 to colDrives.Count-1 Step 2
I know it needs a Wscript.Echo line at the value passed but not sure how.
Hope someone out there can help!
Posted on 11-26-2011 06:34 PM
See if the following does the trick:
Dim objNetwork, objDrives, DriveNum, listDrives
On error resume next
Set objNetwork = CreateObject("WScript.Network")
Set objDrives = objNetwork.EnumNetworkDrives
'check if there are no mapped drives
If objDrives.Count = 0 Then
WScript.Echo "<result>No Drives Mapped</result>"
'List the mapped drives
For DriveNum = 0 to objDrives.Count -1 Step 2
listDrives = objDrives.Item(DriveNum +1) & vbCrLf & listDrives
WScript.Echo "<result>" & listDrives & "</result>"
After the script is saved the '&' will be displayed as '&', save it again and you'll get '&amp;'... So if you makes changes after saving it once be sure to convert each occurance of '&' back to '&' before saving again.
Extension attribute displayed when viewing the extension attribute under computer details lacks multiple line output, but looks fine if displayed under an advanced search.
Leslie N. Helou
Senior Systems Engineer
8888 Keystone Crossing, Suite 1700
Indianapolis, IN 46240