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 :

chkserservice erreur bios


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 Help Desk
    Inscrit en
    Mai 2022
    Messages
    18
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Bouches du Rhône (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : Technicien Help Desk
    Secteur : Industrie

    Informations forums :
    Inscription : Mai 2022
    Messages : 18
    Par défaut chkserservice erreur bios
    Bonjour,

    Voila mon script de services mais le seule probleme le bios ne s'affiche pas pouvez vous m'aider par contre seul en ligne de proframme c'est ok.
    Merci


    #Output
    #(.\CheckServices.ps1 [Hostname of Laptop that to be send out] | Out-File \\[Hostname of your laptop]\C$\TEMP\[Hostname of Laptop that to be send out]_Services.txt)
    #example: .\CheckServices.ps1 RTH006666 | Out-File \\RTH014662\C$\TEMP\RTH006666_Services.txt

    [CmdletBinding()]
    Param(
    [Parameter(Mandatory)]
    [string]$Hostname
    )

    function Check-IsElevated {
    $id = [System.Security.Principal.WindowsIdentity]::GetCurrent()
    $p = New-Object System.Security.Principal.WindowsPrincipal($id)
    if ($p.IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator))
    { Write-Output $true }
    else
    { Write-Output $false }
    }

    function GetService {
    $out = @()
    $sys = Get-WmiObject -ComputerName $Hostname -class Win32_ComputerSystem
    $SerialNumber = Get-WmiObject -ComputerName $Hostname -class Win32_BIOS
    $UserName = Get-CimInstance Win32_ComputerSystem -ComputerName $Hostname | Select -ExpandProperty username
    $TcpIpV4 = (Get-WmiObject -ComputerName $Hostname -Class Win32_NetworkAdapterConfiguration | where {$_.DefaultIPGateway -ne $null}).IPAddress | select-object -first 1
    $NetworkAdapter = Get-WmiObject win32_networkadapterconfiguration -Comp $hostname | where {$_.DHCPEnabled -and $_.DNSDomain -ne $null}
    $MACADDRESS = $networkadapter.MACAddress
    $os = Get-WmiObject -ComputerName $Hostname -class win32_operatingsystem
    $wmi_os = Get-WmiObject -class Win32_OperatingSystem -ComputerName $Hostname| Select-Object Caption
    $vbios = Get-WmiObject -class Win32_BIOS -ComputerName*$hostname*|Select-Object -Property Name,caption
    $winver = Invoke-Command -computerName $HostName -ScriptBlock {(Get-ItemProperty registry::'\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion').Displayversion}
    $BitLocker = (manage-bde -status -computername $Hostname C: | where {$_ -match 'Protection Status'}).Split(":")[1].trim()
    $MDOP = Get-WmiObject -ComputerName $Hostname -Class Win32_Product | where Name -like "MDOP*" | select Version
    $line = "---------------------------------------------------------------------------------------------"
    $enter = "`n"
    $today = Get-Date

    $DeviceInfo= @{}
    $DeviceInfo.add("System Name", $sys.Name)
    $DeviceInfo.add("Model", $sys.Model)
    $DeviceInfo.add("SerialNumber", $SerialNumber.SerialNumber)
    $DeviceInfo.add("Version Bios" , ($vbios.Name))
    $DeviceInfo.add("UserName" , $UserName)
    $DeviceInfo.add("TcpIpV4" , $TcpIpV4)
    $DeviceInfo.add("Mac Address" , $MACADDRESS)
    $DeviceInfo.add("Windows Version", $os.Version)
    $DeviceInfo.add("Display Version", $winver)
    $DeviceInfo.add("Build Number", $os.BuildNumber)
    $DeviceInfo.add("Os Description" ,$wmi_os.Caption)
    $DeviceInfo.add("Architecture", $os.OSArchitecture)
    $DeviceInfo.add("Build Date", ([WMI]'').ConvertToDateTime($os.InstallDate))
    $DeviceInfo.add("BitLocker", $BitLocker)
    $DeviceInfo.add("MDOP MBAM Version", $MDOP)

    $out += New-Object PSObject -Property $DeviceInfo | Select-Object `
    "System Name", `
    "Model", `
    "SerialNumber", `
    "Bios Version", `
    "UserName", `
    "TcpIpV4", `
    "Mac Address", `
    "Windows Version", `
    "Build Number", `
    "Os Description",
    "Display Version", `
    "Architecture", `
    "Build Date", `
    "BitLocker", `
    "MDOP MBAM Version"


    $out2 = Get-Service -ComputerName $Hostname FA_Scheduler, `
    McAfeeFramework, `
    macmnsvc, `
    masvc, `
    MfeFfCoreService, `
    mfemms, `
    mfevtp, `
    WdNisSvc, `
    WinDefend, `
    Sense, `
    mpssvc, `
    'Nexthink Service', `
    'Nexthink Coordinator', `
    QualysAgent, `
    CcmExec, `
    bomgar-ps* ,
    QualysAgent | ft

    $enter
    $today
    $line
    $out
    $line
    $out2
    $TotalRecord = ($out2).count -4
    $out3 = Write-Host $TotalRecord "Services"
    $out4 = Get-Hotfix -ComputerName $Hostname | Format-Table -AutoSize
    $out5 = Get-hotfix -ComputerName $Hostname | Group-Object -Property Description | Select Name,Count
    $line
    $out4
    $line
    $out5
    }

    $line

    if (-not (Check-IsElevated)){
    $enter
    Write-Host "Please run this script as an administrator!!"
    }
    else {
    IF (Test-Connection -BufferSize 32 -Count 1 -ComputerName $Hostname -Quiet) {
    GetService
    } Else {
    Write-Host "The remote machine is not Online! "
    }
    }

  2. #2
    Expert confirmé

    Homme Profil pro
    Responsable déploiement (SCCM, InTune, GPO)
    Inscrit en
    Juillet 2014
    Messages
    3 218
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : France, Seine Saint Denis (Île de France)

    Informations professionnelles :
    Activité : Responsable déploiement (SCCM, InTune, GPO)
    Secteur : Transports

    Informations forums :
    Inscription : Juillet 2014
    Messages : 3 218
    Par défaut
    Bonjour,

    Nous ne comprenons pas bien

    Voici le code remis un peu en forme car illisible sinon

    Code powershell : 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
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    #Output
    #(.\CheckServices.ps1 [Hostname of Laptop that to be send out] | Out-File \\[Hostname of your laptop]\C$\TEMP\[Hostname of Laptop that to be send out]_Services.txt)
    #example: .\CheckServices.ps1 RTH006666 | Out-File \\RTH014662\C$\TEMP\RTH006666_Services.txt
     
    [CmdletBinding()]
    Param(
    [Parameter(Mandatory)]
    [string]$Hostname
    )
     
    function Check-IsElevated {
        $id = [System.Security.Principal.WindowsIdentity]::GetCurrent()
        $p = New-Object System.Security.Principal.WindowsPrincipal($id)
     
        if ($p.IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator))
        {
            Write-Output $true
        }
        else
        {
            Write-Output $false
        }
    }
     
     
    function GetService {
        $out = @()
        $sys = Get-WmiObject -ComputerName $Hostname -class Win32_ComputerSystem
        $SerialNumber = Get-WmiObject -ComputerName $Hostname -class Win32_BIOS
        $UserName = Get-CimInstance Win32_ComputerSystem -ComputerName $Hostname | Select -ExpandProperty username
        $TcpIpV4 = (Get-WmiObject -ComputerName $Hostname -Class Win32_NetworkAdapterConfiguration | where {$_.DefaultIPGateway -ne $null}).IPAddress | select-object -First 1
        $NetworkAdapter = Get-WmiObject win32_networkadapterconfiguration -Comp $hostname | where {$_.DHCPEnabled -and $_.DNSDomain -ne $null}
        $MACADDRESS = $networkadapter.MACAddress
        $os = Get-WmiObject -ComputerName $Hostname -class win32_operatingsystem
        $wmi_os = Get-WmiObject -class Win32_OperatingSystem -ComputerName $Hostname| Select-Object Caption
        $vbios = Get-WmiObject -class Win32_BIOS -ComputerName*$hostname*|Select-Object -Property Name,caption
        $winver = Invoke-Command -computerName $HostName -ScriptBlock {(Get-ItemProperty registry::'\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion').Displayversion}
        $BitLocker = (manage-bde -status -computername $Hostname C: | where {$_ -match 'Protection Status'}).Split(":")[1].trim()
        $MDOP = Get-WmiObject -ComputerName $Hostname -Class Win32_Product | where Name -like "MDOP*" | select Version
        $line = "---------------------------------------------------------------------------------------------"
        $enter = "`n"
        $today = Get-Date
     
        $DeviceInfo= @{}
        $DeviceInfo.add("System Name", $sys.Name)
        $DeviceInfo.add("Model", $sys.Model)
        $DeviceInfo.add("SerialNumber", $SerialNumber.SerialNumber)
        $DeviceInfo.add("Version Bios" , ($vbios.Name))
        $DeviceInfo.add("UserName" , $UserName)
        $DeviceInfo.add("TcpIpV4" , $TcpIpV4)
        $DeviceInfo.add("Mac Address" , $MACADDRESS)
        $DeviceInfo.add("Windows Version", $os.Version)
        $DeviceInfo.add("Display Version", $winver)
        $DeviceInfo.add("Build Number", $os.BuildNumber)
        $DeviceInfo.add("Os Description" ,$wmi_os.Caption)
        $DeviceInfo.add("Architecture", $os.OSArchitecture)
        $DeviceInfo.add("Build Date", ([WMI]'').ConvertToDateTime($os.InstallDate))
        $DeviceInfo.add("BitLocker", $BitLocker)
        $DeviceInfo.add("MDOP MBAM Version", $MDOP)
     
        $out += New-Object PSObject -Property $DeviceInfo | Select-Object `
        "System Name", `
        "Model", `
        "SerialNumber", `
        "Bios Version", `
        "UserName", `
        "TcpIpV4", `
        "Mac Address", `
        "Windows Version", `
        "Build Number", `
        "Os Description",
        "Display Version", `
        "Architecture", `
        "Build Date", `
        "BitLocker", `
        "MDOP MBAM Version"
     
     
        $out2 = Get-Service -ComputerName $Hostname FA_Scheduler, `
        McAfeeFramework, `
        macmnsvc, `
        masvc, `
        MfeFfCoreService, `
        mfemms, `
        mfevtp, `
        WdNisSvc, `
        WinDefend, `
        Sense, `
        mpssvc, `
        'Nexthink Service', `
        'Nexthink Coordinator', `
        QualysAgent, `
        CcmExec, `
        bomgar-ps* ,
        QualysAgent | ft
     
        $enter
        $today
        $line
        $out
        $line
        $out2
        $TotalRecord = ($out2).count -4
        $out3 = Write-Host $TotalRecord "Services"
        $out4 = Get-Hotfix -ComputerName $Hostname | Format-Table -AutoSize
        $out5 = Get-hotfix -ComputerName $Hostname | Group-Object -Property Description | Select Name,Count
        $line
        $out4
        $line
        $out5
    }
     
     
    if (-not (Check-IsElevated))
    {
        $enter
        Write-Host "Please run this script as an administrator!!"
    }
    elseif(Test-Connection -BufferSize 32 -Count 1 -ComputerName $Hostname -Quiet)
    {
        GetService
    }
    else
    {
        Write-Host "The remote machine is not Online! "
    }

  3. #3
    Membre averti
    Homme Profil pro
    Technicien Help Desk
    Inscrit en
    Mai 2022
    Messages
    18
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Bouches du Rhône (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : Technicien Help Desk
    Secteur : Industrie

    Informations forums :
    Inscription : Mai 2022
    Messages : 18
    Par défaut bios non affiché
    Citation Envoyé par ericlm128 Voir le message
    Bonjour,

    Nous ne comprenons pas bien

    Voici le code remis un peu en forme car illisible sinon

    Code powershell : 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
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    #Output
    #(.\CheckServices.ps1 [Hostname of Laptop that to be send out] | Out-File \\[Hostname of your laptop]\C$\TEMP\[Hostname of Laptop that to be send out]_Services.txt)
    #example: .\CheckServices.ps1 RTH006666 | Out-File \\RTH014662\C$\TEMP\RTH006666_Services.txt
     
    [CmdletBinding()]
    Param(
    [Parameter(Mandatory)]
    [string]$Hostname
    )
     
    function Check-IsElevated {
        $id = [System.Security.Principal.WindowsIdentity]::GetCurrent()
        $p = New-Object System.Security.Principal.WindowsPrincipal($id)
     
        if ($p.IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator))
        {
            Write-Output $true
        }
        else
        {
            Write-Output $false
        }
    }
     
     
    function GetService {
        $out = @()
        $sys = Get-WmiObject -ComputerName $Hostname -class Win32_ComputerSystem
        $SerialNumber = Get-WmiObject -ComputerName $Hostname -class Win32_BIOS
        $UserName = Get-CimInstance Win32_ComputerSystem -ComputerName $Hostname | Select -ExpandProperty username
        $TcpIpV4 = (Get-WmiObject -ComputerName $Hostname -Class Win32_NetworkAdapterConfiguration | where {$_.DefaultIPGateway -ne $null}).IPAddress | select-object -First 1
        $NetworkAdapter = Get-WmiObject win32_networkadapterconfiguration -Comp $hostname | where {$_.DHCPEnabled -and $_.DNSDomain -ne $null}
        $MACADDRESS = $networkadapter.MACAddress
        $os = Get-WmiObject -ComputerName $Hostname -class win32_operatingsystem
        $wmi_os = Get-WmiObject -class Win32_OperatingSystem -ComputerName $Hostname| Select-Object Caption
        $vbios = Get-WmiObject -class Win32_BIOS -ComputerName*$hostname*|Select-Object -Property Name,caption
        $winver = Invoke-Command -computerName $HostName -ScriptBlock {(Get-ItemProperty registry::'\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion').Displayversion}
        $BitLocker = (manage-bde -status -computername $Hostname C: | where {$_ -match 'Protection Status'}).Split(":")[1].trim()
        $MDOP = Get-WmiObject -ComputerName $Hostname -Class Win32_Product | where Name -like "MDOP*" | select Version
        $line = "---------------------------------------------------------------------------------------------"
        $enter = "`n"
        $today = Get-Date
     
        $DeviceInfo= @{}
        $DeviceInfo.add("System Name", $sys.Name)
        $DeviceInfo.add("Model", $sys.Model)
        $DeviceInfo.add("SerialNumber", $SerialNumber.SerialNumber)
        $DeviceInfo.add("Version Bios" , ($vbios.Name))
        $DeviceInfo.add("UserName" , $UserName)
        $DeviceInfo.add("TcpIpV4" , $TcpIpV4)
        $DeviceInfo.add("Mac Address" , $MACADDRESS)
        $DeviceInfo.add("Windows Version", $os.Version)
        $DeviceInfo.add("Display Version", $winver)
        $DeviceInfo.add("Build Number", $os.BuildNumber)
        $DeviceInfo.add("Os Description" ,$wmi_os.Caption)
        $DeviceInfo.add("Architecture", $os.OSArchitecture)
        $DeviceInfo.add("Build Date", ([WMI]'').ConvertToDateTime($os.InstallDate))
        $DeviceInfo.add("BitLocker", $BitLocker)
        $DeviceInfo.add("MDOP MBAM Version", $MDOP)
     
        $out += New-Object PSObject -Property $DeviceInfo | Select-Object `
        "System Name", `
        "Model", `
        "SerialNumber", `
        "Bios Version", `
        "UserName", `
        "TcpIpV4", `
        "Mac Address", `
        "Windows Version", `
        "Build Number", `
        "Os Description",
        "Display Version", `
        "Architecture", `
        "Build Date", `
        "BitLocker", `
        "MDOP MBAM Version"
     
     
        $out2 = Get-Service -ComputerName $Hostname FA_Scheduler, `
        McAfeeFramework, `
        macmnsvc, `
        masvc, `
        MfeFfCoreService, `
        mfemms, `
        mfevtp, `
        WdNisSvc, `
        WinDefend, `
        Sense, `
        mpssvc, `
        'Nexthink Service', `
        'Nexthink Coordinator', `
        QualysAgent, `
        CcmExec, `
        bomgar-ps* ,
        QualysAgent | ft
     
        $enter
        $today
        $line
        $out
        $line
        $out2
        $TotalRecord = ($out2).count -4
        $out3 = Write-Host $TotalRecord "Services"
        $out4 = Get-Hotfix -ComputerName $Hostname | Format-Table -AutoSize
        $out5 = Get-hotfix -ComputerName $Hostname | Group-Object -Property Description | Select Name,Count
        $line
        $out4
        $line
        $out5
    }
     
     
    if (-not (Check-IsElevated))
    {
        $enter
        Write-Host "Please run this script as an administrator!!"
    }
    elseif(Test-Connection -BufferSize 32 -Count 1 -ComputerName $Hostname -Quiet)
    {
        GetService
    }
    else
    {
        Write-Host "The remote machine is not Online! "
    }

Discussions similaires

  1. Genymotion erreur BIOS
    Par alanmaly dans le forum Virtualisation
    Réponses: 3
    Dernier message: 11/04/2015, 21h02
  2. message erreur bios au demarrage
    Par moi83 dans le forum Composants
    Réponses: 1
    Dernier message: 31/03/2008, 06h37
  3. pb wifi sous ubuntu 7.10 et erreur bios
    Par moi89 dans le forum Réseau
    Réponses: 1
    Dernier message: 21/11/2007, 08h12
  4. Erreur BIOS démarrage
    Par julienOriano dans le forum Composants
    Réponses: 7
    Dernier message: 20/07/2007, 13h27
  5. erreur bios ordinateur ne demmarre pas
    Par coax81 dans le forum Composants
    Réponses: 5
    Dernier message: 11/06/2007, 10h26

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