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 :

Algo : placer résultat commande IOS (Cisco) dans un objet [PowerShell]


Sujet :

Scripts/Batch

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre éprouvé
    Homme Profil pro
    Ingénieur systèmes et réseaux
    Inscrit en
    Décembre 2006
    Messages
    1 080
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : France, Seine Maritime (Haute Normandie)

    Informations professionnelles :
    Activité : Ingénieur systèmes et réseaux

    Informations forums :
    Inscription : Décembre 2006
    Messages : 1 080
    Par défaut Algo : placer résultat commande IOS (Cisco) dans un objet
    Bonjour,

    Je suis sur un script qui me permet de récupérer des informations sur des switchs Cisco depuis PowerShell.

    Via un module Posh-SSH, j’exécute cette commande "show vlan brief" :

    2960#show vlan brief

    VLAN Name Status Ports
    ---- -------------------------------- --------- -------------------------------
    7 default active Gi1/0/41, Gi2/0/15, Gi2/0/17
    Gi4/0/13, Gi4/0/25, Gi4/0/28
    Gi4/0/29, Gi4/0/30, Gi4/0/31
    Gi4/0/32, Gi4/0/33, Gi4/0/34
    Gi4/0/35, Gi4/0/36, Gi4/0/37
    6 ADMIN-SWITCH active
    3 IntercoAruba active
    15 WIFIDEH active
    56 WIFIPEC active
    99 CLIENT-ADM-LAN active Gi1/0/3, Gi1/0/6, Gi1/0/8
    Gi1/0/9, Gi1/0/10, Gi1/0/11
    Gi1/0/12, Gi1/0/13, Gi1/0/14
    Le résultat est placé dans une variable. Je récupère chaque ligne dans un tableau via un -split "`n". Je supprime les chaines qui ne m’intéresse pas et j'obtiens ceci :

    [1] 7 default active Gi1/0/41, Gi2/0/15, Gi2/0/17
    [2] Gi4/0/13, Gi4/0/25, Gi4/0/28
    [3] Gi4/0/29, Gi4/0/30, Gi4/0/31
    [4] Gi4/0/32, Gi4/0/33, Gi4/0/34
    [5] Gi4/0/35, Gi4/0/36, Gi4/0/37
    [11] 6 ADMIN-SWITCH active
    [12] 3 IntercoAruba active
    [13] 15 WIFIDEH active
    [14] 56 WIFIPEC active
    [15] 99 CLIENT-ADM-LAN active Gi1/0/3, Gi1/0/6, Gi1/0/8
    [16] Gi1/0/9, Gi1/0/10, Gi1/0/11
    [17] Gi1/0/12, Gi1/0/13, Gi1/0/14

    L'idée est de placer tout cela dans un objet afin d'avoir ceci :

    (exemple)

    Vlan Description Status Interface
    --- --- --- ---
    7 default active Gi1/0/41, Gi2/0/15, Gi2/0/17,Gi4/0/13, Gi4/0/25, Gi4/0/28, Gi4/0/29, Gi4/0/30, Gi4/0/31,Gi4/0/32, Gi4/0/33, ...
    6 ADMIN-SWITCH active
    3 IntercoAruba active
    15 WIFIDEH active
    56 WIFIPEC active
    99 CLIENT-ADM-LAN active Gi1/0/3, Gi1/0/6, Gi1/0/8, Gi1/0/9, Gi1/0/10, Gi1/0/11, Gi1/0/12, Gi1/0/13, Gi1/0/14

    Mais la je sèche côté algo.

    voici ce que j'ai fais pour le moment :

    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
    # Traitement des informations
    # $SSHCommandsVlanBrief  est alimenté via POST-SSH
    $i = 0
    $y = 0
    ForEach($Section in ($SSHCommandsVlanBrief -split "`n")) { 
       If (!($Section -like "`r") -AND !($Section -like "*#*") -AND !($Section -like "*show interfaces status*") -AND !($Section -like "*---*") -AND !($Section -like "*VLAN Name                             Status    Ports*")){       
     
            $i = $i+1
     
            $Vlan = $Section.Substring(0,5).trim()
            $VlanDescription = $Section.Substring(5,33).trim()
            $VlanStatus = $Section.Substring(38,10).trim()
     
     
            If(!([string]::IsNullOrEmpty($Vlan))){
                $ValVlan = $Section.Substring(0,5).trim()
            }
     
            If(!([string]::IsNullOrEmpty($VlanDescription))){
                $ValVlanDescription = $Section.Substring(5,33).trim()
            }
     
            If(!([string]::IsNullOrEmpty($VlanStatus))){
                $ValVlanStatus = $Section.Substring(38,10).trim()
            }
     
            If(!([string]::IsNullOrEmpty($Vlan))){
                $y = $y+1
                $ValInterface = $Section.Substring(48,($Section.Length-48)).trim() + ", "
            }else{
                $ValInterface += $Section.Substring(48,($Section.Length-48)).trim() + ", "
            }
     
            write-host "[$i][$y] $ValVlan $ValVlanDescription $ValVlanStatus $ValInterface"
     
       } 
    }

    La variable $i me permet de voir mes lignes dans mon tableau.
    La variable $y me permet de savoir quand je saute de "Vlan".

    Auriez vous une idée ?

    Encore merci et bonne journée.

  2. #2
    Membre éprouvé
    Homme Profil pro
    Ingénieur systèmes et réseaux
    Inscrit en
    Décembre 2006
    Messages
    1 080
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : France, Seine Maritime (Haute Normandie)

    Informations professionnelles :
    Activité : Ingénieur systèmes et réseaux

    Informations forums :
    Inscription : Décembre 2006
    Messages : 1 080
    Par défaut
    Pas bcp de réponse. Je ne dois pas être très claire dans ce que je souhaite faire.
    Cependant, j'ai un peu avancé ce matin.

    J'ai utilisé un hashtable et la fonction set-item qui me permet d'enregistrer, suivant ma clé de hashtable qui est mon N° de vlan (qui est unique) la dernière valeur de ma variable $valinterface.

    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
    # Traitement des informations
    $i = 0
    $y = 0
    
    #hash table
    $objHashTable = @{} #Initialisation d'une hash table
    $objHashTable.Clear()
    
    ForEach($Section in ($SSHCommandsVlanBrief -split "`n")) { 
       If (!($Section -like "`r") -AND !($Section -like "*#*") -AND !($Section -like "*show interfaces status*") -AND !($Section -like "*---*") -AND !($Section -like "*VLAN Name                             Status    Ports*")){       
     
            $i = $i+1
     
            $Vlan = $Section.Substring(0,5).trim()
            $VlanDescription = $Section.Substring(5,33).trim()
            $VlanStatus = $Section.Substring(38,10).trim()
     
            If(!([string]::IsNullOrEmpty($Vlan))){
                $ValVlan = $Section.Substring(0,5).trim()
            }
     
            If(!([string]::IsNullOrEmpty($VlanDescription))){
                $ValVlanDescription = $Section.Substring(5,33).trim()
            }
     
            If(!([string]::IsNullOrEmpty($VlanStatus))){
                $ValVlanStatus = $Section.Substring(38,10).trim()
            }
     
            If(!([string]::IsNullOrEmpty($Vlan))){
                $y = $y+1
                $ValInterface = $Section.Substring(48,($Section.Length-48)).trim()
            }else{
                If(!([string]::IsNullOrEmpty($ValInterface))){
                    $ValInterface += $Section.Substring(48,($Section.Length-48)).trim() + ", "
                }else{
                    $ValInterface += $Section.Substring(48,($Section.Length-48)).trim()
                }
            }
     
            $objHashTable.Set_Item("$ValVlan", "$ValVlanDescription $ValVlanStatus $ValInterface")
       } 
    }
    $objHashTable
    Ensuite, j'aimerai pouvoir faire un tableau multidimensionnelle pour avoir une colonne pour chacune de mes variables $ValVlanDescription $ValVlanStatus $ValInterface. Et dans un second temps, renommé mes colonnes.

    Je ne sais pas si on peut faire la même chose avec des objets

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
            # Création de l'objet
            $Objet = New-object PsObject
            $Objet | Add-Member -Name "Description" -MemberType NoteProperty -Value $ValVlanDescription
            $Objet | Add-Member -Name "Status" -MemberType NoteProperty -Value $ValVlanStatus
            $Objet | Add-Member -Name "Interface" -MemberType NoteProperty -Value $ValInterface
            $objHashTable.Set_Item("$ValVlan", $Objet)
    EDIT : j'ai testé et cela fonctionne. Après, je ne sais pas s'il y a plus optimisé comme traitement...

  3. #3
    Membre éprouvé
    Homme Profil pro
    Ingénieur systèmes et réseaux
    Inscrit en
    Décembre 2006
    Messages
    1 080
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : France, Seine Maritime (Haute Normandie)

    Informations professionnelles :
    Activité : Ingénieur systèmes et réseaux

    Informations forums :
    Inscription : Décembre 2006
    Messages : 1 080
    Par défaut
    au final ca me donne ca :

    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
    # COMMANDE : show interfaces status
    $stream.Write("show vlan brief`n")
    Start-Sleep .75
    $SSHCommandsVlanBrief = $stream.Read()
    # Traitement des informations
    # Initialisation d'une hash table
    $objHashTable = @{} 
    $objHashTable.Clear()
    ForEach($Section in ($SSHCommandsVlanBrief -split "`n")) { 
        # Sélection des lignes qui nous interesse puis découpage des données
       If (!($Section -like "`r") -AND !($Section -like "*#*") -AND !($Section -like "*show interfaces status*") -AND !($Section -like "*---*") -AND !($Section -like "*VLAN Name                             Status    Ports*")){       
     
            $Vlan = $Section.Substring(0,5).trim()
            $VlanDescription = $Section.Substring(5,33).trim()
            $VlanStatus = $Section.Substring(38,10).trim()
     
            If(!([string]::IsNullOrEmpty($Vlan))){
                $ValVlan = $Vlan
            }
     
            If(!([string]::IsNullOrEmpty($VlanDescription))){
                $ValVlanDescription = $VlanDescription
            }
     
            If(!([string]::IsNullOrEmpty($VlanStatus))){
                $ValVlanStatus = $VlanStatus
            }
     
            If(!([string]::IsNullOrEmpty($Vlan))){
                $ValInterface = $Section.Substring(48,($Section.Length-48)).trim()
            }elseIf(!([string]::IsNullOrEmpty($ValInterface))){
                    $ValInterface += ", " + $Section.Substring(48,($Section.Length-48)).trim()
            }
     
            # Ajout des données dans un hash table multidimentionnel
            $Objet = New-object PsObject
            $Objet | Add-Member -Name "Description" -MemberType NoteProperty -Value $ValVlanDescription
            $Objet | Add-Member -Name "Status" -MemberType NoteProperty -Value $ValVlanStatus
            $Objet | Add-Member -Name "Interface" -MemberType NoteProperty -Value $ValInterface
            $objHashTable.Set_Item("$ValVlan", $Objet)
       } 
    }
     
    # Conversion du hash table en objet
    $ShowVlanBrief = ForEach($ValobjHashTable in $objHashTable.GetEnumerator()) { 
        New-Object -TypeName PSObject -Property @{Switch = $IpSwitch
                                                  Vlan = $ValobjHashTable.Name
                                                  Description = $ValobjHashTable.Value.Description
                                                  Status = $ValobjHashTable.Value.Status
                                                  Interface = $ValobjHashTable.Value.Interface
                                                  } | SELECT Switch,Vlan,Description,Status,Interface
    }
     
    $ShowVlanBrief

  4. #4
    Rédacteur


    Profil pro
    Inscrit en
    Janvier 2003
    Messages
    7 171
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2003
    Messages : 7 171
    Billets dans le blog
    1
    Par défaut
    Salut,
    Citation Envoyé par arnaudperfect Voir le message
    Pas bcp de réponse.
    il faut le temps de tester ce qu'on propose :-)
    Comme tu as trouvé une solution, je te propose une autre approche.

    La difficulté avec ce type de traitement basée regex est d'avoir des specs précises et donc un jeu de test couvrant tout les cas.

    Pour regrouper les lignes :
    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
     
    $File='C:\temp\Vlan.txt'
    @'
    2960#show vlan brief
     
    VLAN Name Status Ports
    ---- -------------------------------- --------- -------------------------------
    7 default active Gi1/0/41, Gi2/0/15, Gi2/0/17
    Gi4/0/13, Gi4/0/25, Gi4/0/28
    Gi4/0/29, Gi4/0/30, Gi4/0/31
    Gi4/0/32, Gi4/0/33, Gi4/0/34
    Gi4/0/35, Gi4/0/36, Gi4/0/37
    6 ADMIN-SWITCH active
    3 IntercoAruba active
    15 WIFIDEH active
    56 WIFIPEC active
    99 CLIENT-ADM-LAN active Gi1/0/3, Gi1/0/6, Gi1/0/8
    Gi1/0/9, Gi1/0/10, Gi1/0/11
    Gi1/0/12, Gi1/0/13, Gi1/0/14
    103 WIFITest active
    1103 WIFITestTwo active Gi4/0/35, Gi4/0/36, Gi4/0/37
    '@ > $File
     
    $DebugPreference='continue'
    function Concatener {
    $new=''
    foreach ($line in gc $file)
    {
     
    #write-debug "Line: $line"
    if ($line -match '^\d{1,5} \w*')
    {
    write-debug "`t Match"
    #filtre les 4 lignes de début
    #sinon faire (gc $file)[3..-1] et supprimer ce test
    if ($New -match '^\d{1,5} \w*')
    {
    write-debug "`t Emit New : $new"
    Write-Output ($New -replace ', $','')
    }
    $New=$line+', '
    }
    else
    { $new +=$line+', '}
    #write-debug "New : $new"
    }
    Write-Output ($New -replace ', $','')
    }
    $Liste=Concatener
    $Liste
    # 7 default active Gi1/0/41, Gi2/0/15, Gi2/0/17, Gi4/0/13, Gi4/0/25, Gi4/0/28, Gi4/0/29, Gi4/0/30, Gi4/0/31, Gi4/0/32, Gi4/0/33, Gi4/0/34, Gi4/0/35, Gi4/0/36, Gi4/0/37
    # 6 ADMIN-SWITCH active
    # 3 IntercoAruba active
    # 15 WIFIDEH active
    # 56 WIFIPEC active
    # 99 CLIENT-ADM-LAN active Gi1/0/3, Gi1/0/6, Gi1/0/8, Gi1/0/9, Gi1/0/10, Gi1/0/11, Gi1/0/12, Gi1/0/13, Gi1/0/14
    # 103 WIFITest active
    # 1103 WIFITestTwo active Gi4/0/35, Gi4/0/36, Gi4/0/37
    La construction des objets basée regex étant récurrente on utilise une fonction dédiée.
    $Matches renvoie une hashtable, si on utilise des captures nommées on les retrouve dans cette hashtable.
    Certaines captures sont optionnelles on les ajoute si elle sont absentes dans $Matches.
    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
    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
     
    function New-MatchesObject{
     
    #A partir d'une chaîne de caractères,
    #construit un objet personnalisé à l'aide d'une regex
    #utilisant des captures nommées.
     
    #Exemple :
    # #hashtable de paramètrages
    # $MyObject=@{
    # #hashtable de création d'objets
    # SMB=@{
    # #Ces entrées portent les mêmes noms
    # #que les paramètres de la fonction New-MatchesObject.
    # #Ce qui autorise le splatting
    #
    # #Hashtable de création d'un objet
    # #Exemple : analyse d'attribut AD extensionAttributeN
    # Res_CN=@{
    # #Nom du type affiché par Get-member ou $Variable.PsObject.TypeNames
    # TypeName='MY.SMB.Res_CN'
    # #Expression régulière contenant des captures nommées
    # #celles-ci seront utilisées pour construire des propriètés d'objets PS personnalisés
    # Regex='^extensionAttribute(?<Type>1)#CN=(?<CN>.*?),'
    # #On supprime dans la variable automatique $Matches les clés indiquées
    # Keys=0,1
    # }
    #
    # Res_DN=@{
    # TypeName='MY.SMB.Res_DN'
    # Regex='^extensionAttribute(?<Type>1)#(?<DistinguishedName>.*$)'
    # Keys=0,1
    # }
    # };
    # #Others=@{...}
    # }#$MyObject
    #
    # $S="extensionAttribute1#CN=MyCN,..."
    #
    # #Le splatting ne fonctionne avec @Myobject.SMB.Res_CN
    # $Parameters=$Myobject.SMB.Res_CN
    # $o=New-MatchesObject $S @Parameters
    # $o|gm
    # $O
    #
    # $S2="extensionAttribute1#MyDN"
    # $Parameters=$Myobject.SMB.Res_DN
    # $o2=New-MatchesObject $S2 @Parameters
    # $o2|gm
    # $O2
     
    param (
    #Objet sur lequel on exécute la regex
    [Parameter(Mandatory=$true,position=0)]
    [ValidateNotNullOrEmpty()]
    $InputObject,
     
    #Nom du type de l'objet PS
    [Parameter(Mandatory=$true,position=1)]
    [ValidateNotNullOrEmpty()]
    [String] $TypeName,
     
    #Expression régulière appliquée sur le paramètre InputObject
    [Parameter(Mandatory=$true,position=2)]
    [ValidateNotNullOrEmpty()]
    [String] $Regex,
     
    #En cas de succès de la regex,
    #on supprime les noms de clé indiquées dans la hashtable $Matches
    #celles-ci sont des groupes de capture
    [Parameter(Mandatory=$false,position=3)]
    [ValidateNotNullOrEmpty()]
    #la clé 0 contient l'intégralité de ligne analysée
    [Object[]] $Keys=0
    )
    Function Select-NamedCapture {
    #Extrait les noms de capture présent dans la regex
    Param( [string] $RegexStr )
    $Pattern='\?\<(.*?)\>'
    $Regex = new-object regex $Pattern
     
    $CurrentMatch = $Regex.match($RegexStr)
     
    if (!$CurrentMatch.Success)
    { Write-debug "Echec :$RegexStr" }
    else
    { $CurrentMatch.Groups[1].Value }
     
    while ($CurrentMatch.Success)
    {
    $CurrentMatch = $CurrentMatch.NextMatch()
    if ($CurrentMatch.Success)
    { $CurrentMatch.Groups[1].Value }
    }
    }#Select-NamedCapture
    Write-debug "New-MatchesObject"
     
    $NamesOfCaptures=Select-NamedCapture -RegexStr $Regex
    if ($InputObject -match $Regex)
    {
    #Conflit possible entre un nom de capture numérique ('1') et le numéro d'un groupe : 1
    #dans ce cas on 'perd la capture :
    # #$Str="^(?<11>toto) (titi)"
    # $Str="^(?'1'toto) (titi)"
    # 'toto titi' -match $str
    Write-Debug "$($matches.GetEnumerator()|% {"{0}={1}" -f $_.key,$_.Value})"
     
    $Keys|
    Foreach {
    Write-Debug "Remove key : $_"
    #Pour les captures optionnelles,
    #si la clé n'existe pas il n'y a pas d'erreur
    $matches.Remove($_)
    }
    #Si des captures sont optionnelles, exemple "^(?<Vide>(ab){0,1})",
    # on complète les propriétés manquantes.
    Compare-Object ([string[]]$Matches.Keys) $NamesOfCaptures|
    Select -ExpandProperty InputObject|
    Foreach-Object {
    Write-Debug "Add optionnal key : $_"
    $Matches.Add($_,$Null)
    }
     
    Write-debug "Construction d'un objet de type : $($TypeName)"
    $Object=New-Object PSCustomObject -Property $Matches
    $Object.PsObject.TypeNames.Insert(0,$TypeName)
    Write-Output $Object
    } #sinon on ne renvoi pas d'objet ayant toutes ses propriété à $null
    }#New-MatchesObject
     
    #suppose que le nom de Vlan ne contient que les caractères A.. Z et le tiret
    $regex='^(?<VLan>\d{1,5}) (?<Name>[A-Za-z-]+) (?<Status>\w+)(?<Ports>\s.*$)?'
     
    $Objects=foreach ($Item in $Liste)
    {
    New-MatchesObject -InputObject $Item -TypeName 'VLanInfo' -Regex $regex
    }
    $Objects|Fl
    # VLan   : 7
    # Ports  :  Gi1/0/41, Gi2/0/15, Gi2/0/17, Gi4/0/13, Gi4/0/25, Gi4/0/28, Gi4/0/29, Gi4/0/30, Gi4/0/31, Gi4/0/32,
    #          Gi4/0/33, Gi4/0/34, Gi4/0/35, Gi4/0/36, Gi4/0/37
    # Name   : default
    # Status : active
    # 
    # VLan   : 6
    # Ports  :
    # Name   : ADMIN-SWITCH
    # Status : active
    # 
    # VLan   : 3
    # Ports  :
    # Name   : IntercoAruba
    # Status : active
    # 
    # VLan   : 15
    # Ports  :
    # Name   : WIFIDEH
    # Status : active
    # 
    # VLan   : 56
    # Ports  :
    # Name   : WIFIPEC
    # Status : active
    # 
    # VLan   : 99
    # Ports  :  Gi1/0/3, Gi1/0/6, Gi1/0/8, Gi1/0/9, Gi1/0/10, Gi1/0/11, Gi1/0/12, Gi1/0/13, Gi1/0/14
    # Name   : CLIENT-ADM-LAN
    # Status : active
    # 
    # VLan   : 103
    # Ports  :
    # Name   : WIFITest
    # Status : active
    # 
    # VLan   : 1103
    # Ports  :  Gi4/0/35, Gi4/0/36, Gi4/0/37
    # Name   : WIFITestTwo
    # Status : active
    Si besoin ajouter une méthode d'analyse des numéros de port (cf. Add-Member)

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

Discussions similaires

  1. Quelques commandes utiles de l'IOS Cisco avec des regexp
    Par Invité dans le forum Contribuez
    Réponses: 0
    Dernier message: 12/03/2014, 12h11
  2. Réponses: 1
    Dernier message: 11/09/2012, 14h42
  3. résultat commande dans un tableau
    Par manu7762323 dans le forum Programmation et administration système
    Réponses: 58
    Dernier message: 16/12/2009, 09h28
  4. [Toutes versions] Placer le résultat d'un filtre dans une combobox
    Par ESVBA dans le forum Macros et VBA Excel
    Réponses: 4
    Dernier message: 30/10/2009, 09h09
  5. placer une résultat d'une requete dans un champs
    Par valaidnew dans le forum Access
    Réponses: 5
    Dernier message: 03/03/2006, 10h34

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