1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
| 'job id=" Recherche du serveur FCS du site">
'script language="VBScript">
Dim arg, serveur_fcs, VALUE1, VALUE2
on error resume next
'wscript.echo "corp recherche alias serveur"
arg = "spot-fcs-srv"
serveur_fcs = nsname(arg)
VALUE1=Ucase(serveur_fcs)
wscript.echo "Valeur1 : " & VALUE1
VALUE2 = VALUE1 & "_MOM"
wscript.echo "valeur 2 : " & VALUE2
function nsname (alias)
Dim Shell, comd, Pipe, ligne, regEx, OkResult
Set Shell = CreateObject("WScript.Shell")
okresult=False
set regEx = New RegExp
'extract "name:"
regEx.Pattern = "([a-z]-[\w]+)." ' Set pattern.
regEx.IgnoreCase = True ' Set case insensitivity.
regEx.Global = True ' Set global applicability.
comd = "ping -n 1 " & alias
comd = "nslookup " & alias
Set Pipe = Shell.Exec("%comspec% /c " & comd )
while not Pipe.StdOut.AtEndOfStream and not OkResult
ligne = Pipe.StdOut.ReadLine()
wscript.echo ligne
if regEx.test(ligne) then OkResult = True
Wend
nsname=""
if okResult then
nsname=(regex.execute(ligne))(0).submatches(0)
end If
end function
Dim WshShell, oExec
Dim install1, install2
Set WshShell = CreateObject("WScript.Shell")
install1="msiexec.exe /i "
install2="""C:\toto.msi"""
install1=install1+install2+"SERVER=VALUE1 CONFIG=VALUE2 AM_CONTROL=Full REQUIRE_AUTH_COMMN=1"
'install
Set oExec = WshShell.Exec(install1)
Do While oExec.Status = 0
WScript.Sleep 100
Loop |
Partager