This post is more than 5 years old
2 Intern
•
326 Posts
0
924
January 22nd, 2012 15:00
Run networker commands in vbs
Hi All
I need to run repetitive task for nsrmm and thought of using script-VBS
Just wanted to make sure if this is the right way to call networker command into VBS...or are there any other?
Thanks in advance!
Algo
-------
Read SSID from text
'Set WshShell = WScript.CreateObject("WScript.Shell")
'Set ObjExec = WshShell.Exec(""K:\Legato\bin\nsrmm -S & & -w "12/30/2011" -e "12/30/2013"")
next until not EOL
END
No Events found!



Thierry101
2 Intern
•
326 Posts
0
February 15th, 2012 17:00
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("txtFileLocContainingTheSsidToChange", ForReading)
Const ForReading = 1
Dim arrFileLines()
i = 0
Do Until objFile.AtEndOfStream
Redim Preserve arrFileLines(i)
arrFileLines(i) = objFile.ReadLine
i = i + 1
Loop
objFile.Close
'Then you can iterate it like this
Set WshShell = WScript.CreateObject("WScript.Shell")
For Each SSIDFromTxt in arrFileLines
'WScript.Echo SSIDFromTxt - test see if correct value pops up
nRet = WshShell.Run(" nsrmm.exe -S " & SSIDFromTxt & " -y -w "1/1/2012" -e ""1/01/2012"" ", 1, true)
if nRet <> 0 then wsh.echo "Error encountered with", SSIDFromTxt, " Errorcode:", nRet
Next
Thierry101
2 Intern
•
326 Posts
0
January 26th, 2012 15:00
Hi..
Planning to change longer retention save sets to shorter...there was a message as bolded but in save-set query, the SSID still browsable...the only dependencies are the clones and their time is changed accordingly which is non-issue...?
C:\temp\SSID>mminfo -avot -q SSID=167462 -r name,level,savetime(24),totalsize,ssbrowse,ssretent,cloneid,clretent
name lvl date time total browse retent clone id clretent
VSS:/ full 1/3/2012 6:12:05 PM 16476 1/19/2038 1/19/2038 1325567525 1/19/2038
VSS:/ full 1/3/2012 6:12:05 PM 16476 1/19/2038 1/19/2038 1325567526 1/19/2038
VSS:/ full 1/3/2012 6:12:05 PM 16476 1/19/2038 1/19/2038 1325622275 2/8/2012
VSS:/ full 1/3/2012 6:12:05 PM 16476 1/19/2038 1/19/2038 1325622276 2/8/2012
C:\temp\SSID>nsrmm -S 167462 -w "12/30/2011" -e "12/30/2018"
browse policy expiration `Fri Dec 30 00:00:00 2011' must be later than `Tue Jan 03 18:12:06 2012'
C:\temp\SSID>nsrmm -S 167462 -w "3/30/2012" -e "3/30/2012"
If this saveset has dependents with longer browse or retention periods, the dependent savesets will not be browsable after this saveset's browse and expiration dates.
Are you sure you want to change the browse policy expiration to `Fri Mar 30 00:00:00 2012' and the retention policy expiration to `Fri Mar 30 00:00:00
2012' for this saveset? (yes/no) [no] y
C:\temp\SSID>mminfo -avot -q SSID=167462 -r name,level,savetime(24),totalsize,ssbrowse,ssretent,cloneid,clretent
name lvl date time total browse retent clone id clretent
VSS:/ full 1/3/2012 6:12:05 PM 16476 3/30/2012 3/30/2012 1325567525 3/30/2012
VSS:/ full 1/3/2012 6:12:05 PM 16476 3/30/2012 3/30/2012 1325567526 3/30/2012
VSS:/ full 1/3/2012 6:12:05 PM 16476 3/30/2012 3/30/2012 1325622275 3/30/2012
VSS:/ full 1/3/2012 6:12:05 PM 16476 3/30/2012 3/30/2012 1325622276 3/30/2012