This is what I use to Bulk Modify VDNS:
'LANGUAGE=ENU
'SERVERNAME=[your cms servername]
Public Sub Main()
'Place a ";" separated file name vdns.txt on the root of C drive
'This file needs to have the vdn format: 1234;VDN Name;Description on every line
'This line will be read and split on the ";" and put in an array to add into CMS
'************If you do not have a description to enter/modify, you still need to enter the ";" after the VDN name*************
'Script writen by sgroepie for agent logins (modified by Stinney for VDN modifications)
l=0 'loop value for read loop
result=0 'Answer on adding
c=0 'counter for giving the messagebox
dim regel, a 'variable for readline and for splitting on ";"
dim sString 'variable for information on adding data
dim NameArray(999) 'define array for vdn name. All data is read into this from vdns.txt
dim NumberArray(999) 'define array for vdn number
dim DescArray(999) 'define array for vdn description
dim fs, f 'define filesystem stuff for read
cvsSrv.Dictionary.ACD = 1
'Reads file one line at a time into name and number array
'Place the textfile on the root of C drive
Set fs=CreateObject("Scripting.FileSystemObject")
Set f=fs.OpenTextFile("C:\vdns.txt", 1)
Do While f.AtEndOfStream <> True
regel = f.ReadLine
a = split(regel,";")
NumberArray(l) = a(0)
NameArray(l) = a(1)
DescArray(l) = a(2)
l=l+1
Loop 'keep reading in data until EOF hit.
f.Close 'close vdns.txt file
Set f=Nothing 'clear f and fs
Set fs=Nothing
'Read all vdns into string and display it in a messagebox
for c = 0 to l-1
sString = sString & NumberArray(c) & " - " & nameArray (c) & (Chr(13) & Chr(10))
next
result = msgbox (sString, 1, "Sure to Modify these vdns?")
if result = 1 then
sString = "" 'make string empty for next use
'Add entries
b = cvsSrv.Dictionary.CreateOperation("VDNs",Op)
Op.Window.Top = 4490
Op.Window.Left = 4680
Op.Window.Width = 6000
Op.Window.Height = 3500
for c = 0 to l-1
If b Then
Op.SetProperty "number", NumberArray(c)
Op.SetProperty "name", NameArray(c)
Op.SetProperty "descr", DescArray(c)
On Error Resume Next
if b = Op.DoAction("Modify") then
else
sString = sString & " " & NumberArray(c) & (Chr(13) & Chr(10))
end if
End If
next
if sString <> "" then
msgbox sString, 64, "VDNs not found..."
else
msgbox "All vdns Modified", 64, "Operation Succesfull"
end if
If Not cvsSrv.Interactive Then cvsSrv.ActiveTasks.Remove Op.TaskID
Set Op = Nothing
end if
end Sub
- Stinney
"Scire ubi aliquid invenire possis, ea demum maxima pars eruditionis est"
"To know where to find anything is, after all, the greatest part of education"