IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Scripts/Batch Discussion :

Modification du BIOS [PowerShell]


Sujet :

Scripts/Batch

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti
    Homme Profil pro
    Technicien maintenance
    Inscrit en
    Mars 2013
    Messages
    50
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Technicien maintenance
    Secteur : Service public

    Informations forums :
    Inscription : Mars 2013
    Messages : 50
    Par défaut Modification du BIOS
    Bonjour,

    J'aimerais savoir si il était possible de modifier un paramètre du BIOS (Activer WakeOnLAn) depuis un script et le lancer sur l'ensemble d'un parc informatique.

    J'ai téléchargé les Outils permettant de faire cette manipulation sur mes PC mais je reçois une fin de non recevoir à cause du mot de passe mis en place sur les BIOS.

    Je pense qu'il n'y a pas de possibilité mais à toute fin utile, je me permets de tout de même poser la question.

    C'est on jamais.

    Merci par avance.

  2. #2
    Membre averti
    Homme Profil pro
    Technicien maintenance
    Inscrit en
    Mars 2013
    Messages
    50
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Technicien maintenance
    Secteur : Service public

    Informations forums :
    Inscription : Mars 2013
    Messages : 50
    Par défaut
    Bonjour,

    J'ai trouvé ça sur internet en faisant plusieurs recherches :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    '**********************************************************************
    '*** Name: SampleWakeOnLAN.vbs
    '*** Purpose: To Enable the Wake On LAN on a Dell OMCI client.
    '*** Usage: cscript.exe //nologo SampleWakeOnLAN.vbs <systemname>
    '***
    '*** This sample script is provided as an example only, and has not been
    '*** tested, nor is warranted in any way by Dell; Dell disclaims any
    '*** liability in connection therewith. Dell provides no technical
    '*** support with regard to such scripting. For more information on WMI
    '*** scripting, refer to applicable Microsoft documentation.
    '***
    '*** NOTE: Replace <Password> in line 73 (inside the quotes)
    '*** with the correct password if there is any password set in the system.
    '*** If both passwords(Admin and Boot) are set please replace it with Admin Password.
    '*** If there is no password set in the system please leave it as empty.
    '**********************************************************************
    
    Option Explicit
    
    '*** Declare variables
    Dim strNameSpace
    Dim strComputerName
    Dim strClassName
    Dim strKeyValue
    Dim objWMIService
    Dim ColSystem
    Dim objInstance
    Dim oInParams
    Dim returnValue
    Dim strAttributeName(2)
    Dim strAttributeValue(2)
    Dim strAuthorizationToken
    
    '*** Check that the right executable was used to run the script
    '*** and that all parameters were passed
    If (LCase(Right(WScript.FullName, 11)) = "wscript.exe" ) Or _
        (Wscript.Arguments.Count < 1) Then
        Call Usage()
        WScript.Quit
    End If
    
    '*** Initialize variables
    strNameSpace = "root\dcim\sysman"
    strComputerName = WScript.Arguments(0)
    strClassName = "DCIM_BIOSEnumeration"
    strKeyValue = "Root/MainSystemChassis/BIOSSetupParent/BiosSetupWOL"
    
    '*** Retrieve the instance of DCIM_BIOSEnumeration class for the TPM
    Set objInstance = GetObject("WinMgmts:{impersonationLevel=impersonate," &_
        "AuthenticationLevel=pktprivacy}\\" & strComputerName & "\" &_
        strNameSpace & ":" & strClassName & "=" & Chr(34) & strKeyValue & Chr(34))
    WScript.Echo objInstance.CurrentValue(0)
    WScript.Echo objInstance.AttributeName
    
    '*** All possible values for WOL are as follows:
    '*** 1 = Disable
    '*** 2 = Add-in
    '*** 3 = On board
    '*** 4 = LAN
    '*** 5 = PXE boot enable
    '*** 6 = LAN or WLAN
    '*** 7 = WLAN only
    
    If objInstance.CurrentValue(0) = 1 Then
        '*** Here is where you would perform an action such as writing the computer
        '*** name out to a text file or enabling WoL with the following code...
        '*** This section will attempt to set the value to 4 (LAN) as this is the most
        '*** popular for recent Dell systems
        '*** Initialize variables
    '    strClassName = "DCIM_BIOSService"
    '    strAttributeName(0) = objInstance.AttributeName
    '    strAttributeValue(0) = "4"
    '    strAuthorizationToken = "Password"
    
    '    returnValue = 0
        '*** Retrieve the instance of DCIM_BIOSService class 
    '    Set objWMIService = GetObject("WinMgmts:{impersonationLevel=impersonate," &_
    '        "AuthenticationLevel=pktprivacy}\\" & strComputerName & "\" &_
    '        strNameSpace)
    '    Set ColSystem=objWMIService.execquery ("Select * from " & strClassName)
    
    '    For each objInstance in ColSystem    
    '        Set oInParams = objInstance.Methods_("SetBIOSAttributes").InParameters.SpawnInstance_
    '        oInParams.AttributeName = strAttributeName
    '        oInParams.AttributeValue = strAttributeValue
    '        oInParams.AuthorizationToken = strAuthorizationToken
    '        Set returnValue = objInstance.ExecMethod_("SetBIOSAttributes", oInParams)
    '        Exit For
    '    Next
    End If
    
    '*** If any errors occurred, let the user know
    If Err.Number <> 0 Then
        WScript.Echo "Enabling Wake On LAN failed."
    End If
    
    '*** Sub used to display the correct usage of the script
    Sub Usage()
    Dim strMessage
    strMessage = "incorrect syntax. You should run: " & vbCRLF & _
        "cscript.exe /nologo SampleWakeOnLAN.vbs <systemname>"
    WScript.Echo strMessage
    End Sub
    Le problème est qu'il me renvoi cette erreur : "incorrect syntax. You should run: cscript.exe /nologo SampleWakeOnLAN.vbs <systemname>

    Vous auriez une idée ?

    Merci par avance.

  3. #3
    Membre averti Avatar de florian7
    Homme Profil pro
    Apprenti
    Inscrit en
    Août 2015
    Messages
    35
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Pyrénées Atlantiques (Aquitaine)

    Informations professionnelles :
    Activité : Apprenti
    Secteur : Aéronautique - Marine - Espace - Armement

    Informations forums :
    Inscription : Août 2015
    Messages : 35
    Par défaut
    Bonjour,

    C'est normal, ce n'est pas un script Powershell mais VBScript donc c'est pour cela que Powershell ne comprends pas la syntaxe.

  4. #4
    Membre averti
    Homme Profil pro
    Technicien maintenance
    Inscrit en
    Mars 2013
    Messages
    50
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Technicien maintenance
    Secteur : Service public

    Informations forums :
    Inscription : Mars 2013
    Messages : 50
    Par défaut
    Citation Envoyé par florian7 Voir le message
    Bonjour,

    C'est normal, ce n'est pas un script Powershell mais VBScript donc c'est pour cela que Powershell ne comprends pas la syntaxe.
    Merci beaucoup,

    Du coup serait il possible de supprimer le post, je viens de recréer un autre dans la bonne section.

    Désolé et encore merci.

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Windows 7 embedded et modification BIOS HP
    Par hunyka dans le forum Windows 7
    Réponses: 3
    Dernier message: 05/06/2013, 16h57
  2. [PC fixe] Lors d'une modification du Bios la machine peine à démarrer
    Par wodel dans le forum Ordinateurs
    Réponses: 6
    Dernier message: 08/05/2012, 14h02
  3. [Carte mère] Problème lors de la modification dans le BIOS
    Par wodel dans le forum Composants
    Réponses: 1
    Dernier message: 09/01/2010, 13h42
  4. modification du Bios
    Par yasinfo dans le forum Composants
    Réponses: 5
    Dernier message: 29/01/2007, 22h54
  5. Réponses: 11
    Dernier message: 23/07/2002, 14h33

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo