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 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345
| <HTML>
<HEAD>
<META HTTP-EQUIV="MSThemeCompatible" CONTENT="Yes" />
<TITLE>Outils EAU</TITLE>
<STYLE type="text/css">
input {
width:120px;
}
.titre {
font-weight:bold;
background-color:#346E99;
color:#FFFFFF;
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:x-large;
}
.rubrique {
font-weight:bold;
background-color:black;
color:#FFFFFF;
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:large;
}
.info {
text-align:center;
font-weight:bold;
color:red;
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:small;
}
</STYLE>
<SCRIPT type="text/vbscript">
Dim PCencours
'Dim login
'Dim LogCnx
Const login="Domain\"
Const login2="Domain\"
Const LogCnx = "C:\Outils\connexions.log"
Const LogRobocopy = "c:\outils\robocopy.log"
'Const SourcesRef="\\nas1\Shared\Adm\DRLT\Informatique\installations\Reference\Reference\REFER_C"
Const SourcesRef="\\nas1\Shared\Appli\REFERENCE\REFER_C"
'Const SourcesUSV2 ="\\nas1\Shared\Adm\DRLT\Informatique\installations\Reference\Reference\REFER_C\USV2\app"
Const SourcesUSV2 = "\\nas1\Shared\Appli\REFERENCE\REFER_C\usv2\APP"
'pcencours=""
Sub AfficheInfosCourantes() 'permet d'afficher les informations liées à la session courante et au PC courant pour raffraichir l'écran
if PCEnCours <> "" or login <> ""then
temp = " Connecté "
end if
if login <> "" then
temp = temp & " en tant que " & login
end if
if PCEnCours <> "" then
temp = temp & " sur le poste " & PCEncours
end if
infos.innerhtml = temp
if PCEnCours ="" then
ChangePC.value = "Poste Cible?"
else
ChangePC.value = PCEnCours
end if
ChangePC.style.fontweight="bold"
end sub
Function PingOK(Host) ' permet de vérifier si un poste répond au ping avant d'enregistrer un nouveau poste
'On Error Resume Next
Set objPing = GetObject("winmgmts:{impersonationLevel=impersonate}!\\").ExecQuery("select * from Win32_PingStatus where address = '" & host & "'")
For Each objStatus in objPing
If objStatus.Statuscode = 0 Then
PingOK = True
else
PingOK = False
End If
Next
End Function
function getHost(force) ' retourne le nom du PC en cours s'il y en a un sinon demande à l'utilisateur de saisir un nouveau PC
if PCEncours="" or force=true then
PCEncours = Ucase(InputBox("Veuillez saisir le nom du poste (ou Annuler si aucune sélection)", "Changement de poste", PCEncours))
while PCEncours <> "" and not PingOK(PCenCours)
PCEncours = Ucase(InputBox("Le poste ne répond pas au ping. Merci de ressaisir un poste valide", "Changement de poste", PCEncours))
wend
AfficheInfosCourantes() 'on réaffiche les infos courantes
end if
getHost=PCencours
end function
Sub Notepad_onclick()
Set oShell = CreateObject("WScript.shell")
oShell.run("notepad.exe")
set oShell=Nothing
End Sub
Sub NotepadPlus_onclick()
Set oShell = CreateObject("WScript.shell")
oShell.run("notepad++.exe")
set oShell=Nothing
End Sub
Sub Capture_onclick()
Set oShell = CreateObject("WScript.shell")
oShell.run("SnippingTool.exe")
set oShell=Nothing
End Sub
Sub Ping_onclick()
temp = PCencours
if temp <> "" then
Set oShell = CreateObject("WScript.shell")
oShell.run "cmd /c ping -t -4 " & temp
set oShell=Nothing
end if
end sub
Sub Reboot_onclick()
temp = PCencours
if temp <> "" then
Set oShell = CreateObject("WScript.shell")
oShell.run "cmd /c shutdown -i"
set oShell=Nothing
end if
end sub
Sub AD_onclick()
Set oShell = CreateObject("WScript.shell")
oShell.run "runas /savecred /user:" & login & " ""mmc \\nas1\Shared\Adm\DRLT\Informatique\installations\Exe\Outils-EAU-install\Outils-EAU\Outils-Admin\AD.msc"""
set oShell=Nothing
end sub
Sub GLPINT_onclick()
Set oShell = CreateObject("WScript.shell")
oShell.run "runas /savecred /user:" & login2 & " ""C:\Program Files (x86)\Google\Chrome\Application\chrome.exe http://srvpvm-glpi.sn-annuaire.naz/front/ticket.form.php"""
set oShell=Nothing
end sub
Sub GPTOOLZ_onclick()
Set oShell = CreateObject("WScript.shell")
oShell.run "runas /savecred /user:" & login2 & " ""C:\Program Files (x86)\Google\Chrome\Application\chrome.exe http://toolz/outils/"""
set oShell=Nothing
end sub
Sub ANNUAIRE_onclick()
Set oShell = CreateObject("WScript.shell")
oShell.run "runas /savecred /user:" & login2 & " ""C:\Program Files (x86)\Google\Chrome\Application\chrome.exe http://domino/annuaire/interne.pdf"""
set oShell=Nothing
end sub
Sub IMPR_onclick()
Set oShell = CreateObject("WScript.shell")
oShell.run "runas /savecred /user:" & login & " ""mmc \\nas1\Shared\Adm\DRLT\Informatique\installations\Exe\Outils-EAU-install\Outils-EAU\Outils-Admin\SRVIMPR.msc"""
set oShell=Nothing
end sub
Sub DHCP_onclick()
Set oShell = CreateObject("WScript.shell")
oShell.run "runas /savecred /user:" & login & " ""mmc \\nas1\Shared\Adm\DRLT\Informatique\installations\Exe\Outils-EAU-install\Outils-EAU\Outils-Admin\DHCP.msc"""
set oShell=Nothing
end sub
Sub CMD_onclick()
Set oShell = CreateObject("WScript.shell")
oShell.run "runas /savecred /user:" & login & " ""cmd"""
set oShell=Nothing
end sub
Sub SCCM_onclick()
temp= PCencours
if temp <> "" then
Set oShell = CreateObject("WScript.shell")
oShell.run "cmd /c ""echo SCCM sur " & temp & " le %date% a %time% >> """ & LogCnx & """"""
oShell.run "runas /savecred /user:" & login & " ""C:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin\i386\CmRcViewer.exe " & temp & """"
set oShell=Nothing
end if
end sub
Sub VNC_onclick()
temp = PCencours
if temp <> "" then
Set oShell = CreateObject("WScript.shell")
oShell.run "cmd /c ""echo VNC sur " & temp & " le %date% a %time% >> """ & LogCnx & """"""
oShell.run "runas /savecred /user:" & login & " ""C:\Program Files\uvnc bvba\UltraVNC\vncviewer.exe " & temp & """"
set oShell=Nothing
end if
end sub
Sub VNCNoAccept_onclick()
temp = PCencours
if temp <> "" then
Set oShell = CreateObject("WScript.shell")
'oShell.run "runas /savecred /user:" & login & " ""cmd /c rename "\\" & temp & "\c$\program files\ultravnc\ultravnc.ini" ultravnc-bon.ini"""
'oshell.run "runas /savecred /user:" & login & " ""cmd /c robocopy \\nas1\MASTER\Logiciels\UltraVnc\ultravnc.ini \\" & temp & "\c$\program files\ultravnc""" ' recopie du fichier sans accept
' on redémarre le service
'oShell.run "runas /savecred /user:" & login & " ""sc \\" & temp & " stop uvnc_service""" ' Arret du service
'oShell.run "runas /savecred /user:" & login & " ""sc \\" & temp & " start uvnc_service""" ' relance du service
set oShell=Nothing
end if
end sub
Sub VNCAccept_onclick()
temp = PCencours
if temp <> "" then
'oShell.run "runas /savecred /user:" & login & " ""cmd /c rename \\" & temp & "\c$\program files\ultravnc\ultravnc-bon.ini ultravnc.ini""" 'renommage du fichier
' on redémarre le service
'oShell.run "runas /savecred /user:" & login & " ""sc \\" & temp & " stop uvnc_service""" ' Arret du service
'oShell.run "runas /savecred /user:" & login & " ""sc \\" & temp & " start uvnc_service""" ' relance du service
set oShell=Nothing
end if
end sub
Sub Services_onclick()
Set oShell = CreateObject("WScript.shell")
commande = "runas /savecred /user:" & login & " ""mmc services.msc /computer=" & PCencours & """"
oShell.run commande
set oShell=Nothing
end sub
Sub GestionPC_onclick()
Set oShell = CreateObject("WScript.shell")
commande = "runas /savecred /user:" & login & " ""mmc compmgmt.msc /computer=" & PCencours & """"
oShell.run commande
set oShell=Nothing
end sub
Sub TSE_onclick()
Set oShell = CreateObject("WScript.shell")
commande = "mstsc /v:" & PCencours
oShell.run commande
set oShell=Nothing
end sub
Sub Shared_onclick()
temp= PCencours
if temp <> "" then
Set oShell = CreateObject("WScript.shell")
commande = "runas /savecred /user:" & login & " ""explorer \\" & temp & "\c$"""
'msgbox commande
oShell.run commande
set oShell=Nothing
end if
end sub
Sub MAJRef_onclick()
temp= PCencours
if temp <> "" then
Set oShell = CreateObject("WScript.shell")
commande = "runas /savecred /user:" & login & " ""cmd /c robocopy " & SourcesRef & " \\" & temp & "\c$\reference\REFER_C /e /log:" & LogRobocopy & " & pause"""
commande = "runas /savecred /user:" & login & " ""cmd /c robocopy " & SourcesRef & " \\" & temp & "\c$\reference\REFER_C /e & pause"""
oShell.run commande
set oShell=Nothing
end if
end sub
Sub ChangePC_onclick()
'PCencours = Ucase(InputBox("Veuillez saisir le nom du poste", "Changement de poste", PCEncours))
PCencours = getHost(true)
'result=testping(PCencours)
'AfficheInfosCourantes()
End Sub
</SCRIPT>
<HTA:APPLICATION ID="MonApp" APPLICATIONNAME="MonApp" SINGLEINSTANCE="Yes" MinimizeButton="Yes" Maximizebutton="No" scroll="no" Border="Thin" Icon="tools.ico">
</HEAD>
<BODY>
<TABLE width=100%>
<tr height=70>
<td class="titre" colspan="3"><marquee>Outils EAU</marquee></TD>
</tr>
<tr height=70>
<td class="info" colspan="3"><label id="infos"></label></td>
</tr>
<!-- <tr height=30>
<td class="rubrique" colspan="3">Raccourcis</td>
</tr>
<tr>
<td><input type="button" name="Notepad" value="Bloc-Notes"></td>
<td><input type="button" name="Capture" value="Outil capture"></td>
<td><input type="button" name="NotepadPlus" value="Notepad++"></td>
<td></td>
</tr>
-->
<tr height=30>
<td class="rubrique" colspan="3">Outils d'administration</td>
</tr>
<tr>
<td><input type="button" name="AD" value="AD"></td>
<td><input type="button" name="IMPR" value="IMPR"></td>
<td><input type="button" name="DHCP" value="DHCP"></td>
</tr>
<tr>
<td><input type="button" name="CMD" value="Invite de commande"></td>
<td><input type="button" name="ping" value="Ping"></td>
<td><input type="button" name="MAJRef" value="MAJ Reference"></td>
</tr>
<tr height=30>
<td class="rubrique" colspan="3">Gestion PC distant</td>
</tr>
<tr>
<td><input type="button" name="GestionPC" value="Gestion Ordi"></td>
<td><input type="button" name="Services" value="Services"></td>
<td><input type="button" name="Shared" value="Racine Cible"></td>
</tr>
<tr height=30>
<td class="rubrique" colspan="3">Contole PC distant</td>
</tr>
<tr>
<td><input type="button" name="SCCM" value="SCCM"></td>
<td><input type="button" name="VNC" value="VNC"></td>
<td><input type="button" name="TSE" value="TSE"></td>
</tr>
<tr>
<td><input type="button" name="VNCNoAccept" value="VNC sans accept"></td>
<td><input type="button" name="VNCAccept" value="VNC avec accept"></td>
<td><input type="button" name="reboot" value="Reboot"></td>
</tr>
<tr height=30>
<td class="rubrique" colspan="3">Applications</td>
</tr>
<tr>
<td><input type="button" name="Capture" value="Outils Capture"></td>
<td><input type="button" name="Notepad" value="Bloc Note"></td>
</tr>
<tr height=30>
<td class="rubrique" colspan="3">Liens Internet</td>
</tr>
<tr>
<td><input type="button" name="GLPINT" value="Nouveau Ticket"></td>
<td><input type="button" name="GPTOOLZ" value="GPTOOLZ"></td>
<td><input type="button" name="ANNUAIRE" value="ANNUAIRE"></td>
</tr>
<tr>
<td></td>
<td><br><input type="button" id="ChangePC" name="ChangePC" value=""></td>
<td></td>
</tr>
</table>
<script type="text/vbscript">
window.resizeTo 475,635
window.moveTo 700,250
AfficheInfosCourantes()
</script>
</BODY>
</HTML> |
Partager