Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
3095 connectés 

  FORUM HardWare.fr
  Programmation
  VB/VBA/VBS

  shutdown poste distant

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

shutdown poste distant

n°1802745
buck94
Posté le 21-10-2008 à 11:34:25  profilanswer
 

Bonjour
 
Je suis newbies en scripting :pt1cable: et j'aurais souhaité avoir un script qui me redémarre un serveur à distance.J'essaye celui-ci mais ça ne marche pas...... :cry:  
je pense que ça viens d'un pb d'authentification sur le poste distant ? :heink:  
Si un pro pouvait m'aider :hello:  
 
"' Windows Script Host
' Shutdown.vbs
'force la déclaration des variables  
Option Explicit  
 
'variables  
Dim objShell, strComputer, strInput  
Dim strShutdown  
Do  
'choix du serveur  
strComputer = (InputBox(" ComputerName to shutdown", "Computer Name";))  
'si choix serveur ok  
If strComputer <> "" Then  
strInput = True  
End if  
'boucle jusqu'à entrer nom serveur  
Loop until strInput = True  
'commande à lancer  
strShutdown ="shutdown /r /f /m " & strComputer  
'creation de l'instance shell
set objShell = CreateObject("WScript.Shell";)
'execution  
objShell.Run strShutdown  
Wscript.Quit


Message édité par buck94 le 21-10-2008 à 11:35:03

---------------
mon feedback
mood
Publicité
Posté le 21-10-2008 à 11:34:25  profilanswer
 

n°1802758
buck94
Posté le 21-10-2008 à 12:02:26  profilanswer
 

J'ai pas assez chercher  
ça marche....


---------------
mon feedback

Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  VB/VBA/VBS

  shutdown poste distant

 

Sujets relatifs
WSS 3.0 : upload d'un fichier depuis un poste client vers un site SPConnexion serveur MySQL distant
Creer cookie pour site distantProblème avec script en php avec iis, droit sur serveur distant
Où trouver des Developpeur PHP Programmation Orientée Objet ?[C#] Copier un fichier sur un ordinateur distant
Lecture d'un flux distant en C[C] Comment obtenir hostname distant (Sniffer)
Comment exécuter des commandes à distant avec un code java? 
Plus de sujets relatifs à : shutdown poste distant


Copyright © 1997-2025 Groupe LDLC (Signaler un contenu illicite / Données personnelles)