CN105426169A - Method for automatically adjusting network card identification sequence in Windows system - Google Patents

Method for automatically adjusting network card identification sequence in Windows system Download PDF

Info

Publication number
CN105426169A
CN105426169A CN201510704476.8A CN201510704476A CN105426169A CN 105426169 A CN105426169 A CN 105426169A CN 201510704476 A CN201510704476 A CN 201510704476A CN 105426169 A CN105426169 A CN 105426169A
Authority
CN
China
Prior art keywords
network interface
interface card
split
recognition sequence
windows system
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201510704476.8A
Other languages
Chinese (zh)
Other versions
CN105426169B (en
Inventor
贾岛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Inspur Electronic Information Industry Co Ltd
Original Assignee
Inspur Electronic Information Industry Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Inspur Electronic Information Industry Co Ltd filed Critical Inspur Electronic Information Industry Co Ltd
Priority to CN201510704476.8A priority Critical patent/CN105426169B/en
Publication of CN105426169A publication Critical patent/CN105426169A/en
Application granted granted Critical
Publication of CN105426169B publication Critical patent/CN105426169B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • G06F8/22Procedural
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention provides a method for automatically adjusting network card identification sequence in a Windows system, which relates to the field of server software.

Description

A kind of method of robotization adjustment network interface card recognition sequence under Windows system
Technical field
The present invention relates to server software technology, particularly relate to the method for robotization adjustment network interface card recognition sequence under a kind of Windows system.Mainly for the server adopting Windows system in enormous quantities, when these servers are containing Onboard NIC, and when extrapolation PCIE network interface card has been installed simultaneously, by a robotization amendment script, carry out plate and carry the adjustment with extrapolation network interface card recognition sequence under Windows system, realize Onboard NIC preferentially to identify, extrapolation network interface card come Onboard NIC after requirement.
Background technology
As the user of server product, after the extensive added deployment of server, generally can carry out classification planning to the network interface on server: a part can connect internal network and do management use, part connection external network does data transmission and uses.This network application targetedly, just must be stuck in recognition sequence under system by fixed network.
The method of traditional adjustment network interface card recognition sequence, is generally after server enters Windows system, operates in network settings by platform.Although so also can identify the adjustment of network interface card recognition sequence, there is the situation of misoperation with regard to south in manual operation, is difficult to again the consistance ensureing that batch is disposed by platform operation.
Summary of the invention
In order to solve above technical matters, the present invention proposes a kind of method that robotization network interface card recognition sequence based on WindowsPowershell adjusts, the method is applicable to server sync in enormous quantities and disposes, method for refreshing is simple to operate, setting ratio is high, greatly can improve the O&M of product, reduce human input.Script is adjusted, before Onboard NIC under system is adjusted to extrapolation network interface card by robotization.
This method breaks original design concept by the artificial method of adjustment of platform, and adopt server to be adjusted original oneself to adjust the thought of oneself: the network interface card PCI device number that system Central Plains is installed and the identification of hardware ID device number, and mate one by one, then judge whether network interface card has met the preferential recognition sequence of Onboard NIC under current mounting means, then adjustment is started if do not met, the ID of Onboard NIC is readjusted into minimum, realize the object that Onboard NIC preferentially identifies.
The adjustment of network interface card recognition sequence, can be roughly divided into following step:
1), totally adjust script, wherein can call two subroutines, one is hardware ID recognizer, and another one is PCI device number recognizer;
2), network interface card calls.
The present invention is based on the Powershell of Windows system to identify network interface card ID, and adjust network interface card order.
The invention has the beneficial effects as follows
1) adjustment of network interface card recognition sequence, based on WindowsPoweshell is carried out, on Client application without impact;
2), extensive batch operation, ensure the high consistency that batch is disposed;
3), adjustment work does not need end external unit, use server native, minimizing plant maintenance workload.
Accompanying drawing explanation
Fig. 1 is that network interface card order adjusts process flow diagram.
Embodiment
More detailed elaboration is carried out to content of the present invention below:
1, the adjustment of network interface card recognition sequence, can be roughly divided into following step:
Overall adjustment script is as follows, wherein can call two subroutines, and one is hardware ID recognizer, and another one is PCI device number recognizer.
Overall adjustment programme code is as follows:
echooff
setdir=%CD%
setscriptPath=%dir%\pci3.ps1
for/f"tokens=*"%%ain('powershellGet-ExecutionPolicy')do(
setoriginPolicy=%%a
)
powershellSet-ExecutionPolicy0
powershell-command".'%scriptPath%'"
powershellSet-ExecutionPolicy%originPolicy%
Set/ptmp=successful operation, please exits by enter key ....
2, network interface card adjustment calling program code is as follows:
$Adapters=Get-WMIObjectWin32_PNPSignedDriver|where{$_.DeviceClass-eq“NET”-and$_.HardWareID-like“*PCI*”}
$data=''
$arr=''
$b=''
$order=''
Write-Host' is obtaining network interface card positional information ... '
foreach($Adapterin$Adapters){
$AdapterName=Get-WMIObjectWin32_NetworkAdapter|where{$_.PNPDeviceID-eq$Adapter.DeviceID}
$data0=$Adapter.Location.split("")
if($data0[1]-eq'bus'){
$data2=$data0[2]
$data4=$data0[4]
$data6=$data0[6]
}else{
$data2=$data0[2].split("、")[0]+','
$data4=$data0[3].split("、")[0]+','
$data6=$data0[4]
}
$str=$AdapterName.NetConnectionID+';'+$data2+$data4+$data6
$arr+=$str,'/'
}
$arr2=$arr.substring(0,$arr.length-1)
$b=$arr2.split('/')
Write-Host' is analyzing network interface card positional information ... '
$a=$($b|sort{[int]$_.split(';')[1].split(',')[0]},{[int]$_.split(';')[1].split(',')[1]},{[int]$_.split(';')[1].split(',')[2]})
$path=$MyInvocation.MyCommand.Path
$t=$path.substring(0,$path.length-8)
Write-Host‘-------------------------------------'
$a
Write-Host‘-------------------------------------'
Write-Host' is revising network interface card positional information ... '
for($i=0;$i-lt$a.Count;$i++){
$name=$a[$i].split(';')
$nicname=$name[0]
$nic0=[string]($i+1)
$ nic=" local connection "+[int] ($ i+1)
cd$t
Write-Host' detects network interface card: ', (nicname), ' ... '
.\pci3.bat($nicname)$nic0
}
for($i=0;$i-lt$a.Count;$i++){
$name=$a[$i].split(';')
$nicname=$name[0]
$ local=' this locality connects '
$ nic=" local connection "+[int] ($ i+1)
echo$t
cd$t
if($i-eq0){
Write-Host' changes network interface card: ', $ local, ' ... '
.\pci3.bat($i+1)$local
}else{
Write-Host' changes network interface card: ', $ nic, ' ... '
.\pci3.bat($i+1)$nic
}
}
Write-Host ' revises the success of network interface card positional information! '
Write-Host‘-------------------------------------'$Adapters=Get-WMIObjectWin32_PNPSignedDriver|where{$_.DeviceClass-eq“NET”-and$_.HardWareID-like“*PCI*”}
$data=''
$arr=''
$b=''
$order=''
Write-Host' is obtaining network interface card positional information ... '
foreach($Adapterin$Adapters){
$AdapterName=Get-WMIObjectWin32_NetworkAdapter|where{$_.PNPDeviceID-eq$Adapter.DeviceID}
$data0=$Adapter.Location.split("")
if($data0[1]-eq'bus'){
$data2=$data0[2]
$data4=$data0[4]
$data6=$data0[6]
}else{
$data2=$data0[2].split("、")[0]+','
$data4=$data0[3].split("、")[0]+','
$data6=$data0[4]
}
$str=$AdapterName.NetConnectionID+';'+$data2+$data4+$data6
$arr+=$str,'/'
}
$arr2=$arr.substring(0,$arr.length-1)
$b=$arr2.split('/')
Write-Host' is analyzing network interface card positional information ... '
$a=$($b|sort{[int]$_.split(';')[1].split(',')[0]},{[int]$_.split(';')[1].split(',')[1]},{[int]$_.split(';')[1].split(',')[2]})
$path=$MyInvocation.MyCommand.Path
$t=$path.substring(0,$path.length-8)
Write-Host‘-------------------------------------'
$a
Write-Host‘-------------------------------------'
Write-Host' is revising network interface card positional information ... '
for($i=0;$i-lt$a.Count;$i++){
$name=$a[$i].split(';')
$nicname=$name[0]
$nic0=[string]($i+1)
$ nic=" local connection "+[int] ($ i+1)
cd$t
Write-Host' detects network interface card: ', (nicname), ' ... '
.\pci3.bat($nicname)$nic0
}
for($i=0;$i-lt$a.Count;$i++){
$name=$a[$i].split(';')
$nicname=$name[0]
$ local=' this locality connects '
$ nic=" local connection "+[int] ($ i+1)
echo$t
cd$t
if($i-eq0){
Write-Host' changes network interface card: ', $ local, ' ... '
.\pci3.bat($i+1)$local
}else{
Write-Host' changes network interface card: ', $ nic, ' ... '
.\pci3.bat($i+1)$nic
}
}
Write-Host ' revises the success of network interface card positional information! '
Write-Host‘-------------------------------------'。

Claims (3)

1. under a Windows system, robotization adjusts the method for network interface card recognition sequence, it is characterized in that, the network interface card PCI device number that system Central Plains is installed and the identification of hardware ID device number, and mate one by one, then judge whether network interface card has met the preferential recognition sequence of Onboard NIC under current mounting means, then starting adjustment if do not met, the ID of Onboard NIC being readjusted into minimum, realizing the object that Onboard NIC preferentially identifies.
2. method according to claim 1, is characterized in that, the adjustment of network interface card recognition sequence, can be roughly divided into following step:
1), totally adjust script, wherein can call two subroutines, one is hardware ID recognizer, and another one is PCI device number recognizer;
2), network interface card calls.
3. method according to claim 2, is characterized in that, the Powershell based on Windows system identifies network interface card ID, and adjusts network interface card order.
CN201510704476.8A 2015-10-27 2015-10-27 Method for automatically adjusting network card identification sequence in Windows system Active CN105426169B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510704476.8A CN105426169B (en) 2015-10-27 2015-10-27 Method for automatically adjusting network card identification sequence in Windows system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510704476.8A CN105426169B (en) 2015-10-27 2015-10-27 Method for automatically adjusting network card identification sequence in Windows system

Publications (2)

Publication Number Publication Date
CN105426169A true CN105426169A (en) 2016-03-23
CN105426169B CN105426169B (en) 2019-02-15

Family

ID=55504399

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510704476.8A Active CN105426169B (en) 2015-10-27 2015-10-27 Method for automatically adjusting network card identification sequence in Windows system

Country Status (1)

Country Link
CN (1) CN105426169B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106020914A (en) * 2016-06-07 2016-10-12 浪潮电子信息产业股份有限公司 Method for adjusting loading sequence of multiple controller drives under RedHat7
CN106909390A (en) * 2017-02-28 2017-06-30 郑州云海信息技术有限公司 A kind of NCSI methods to set up realized based on BMC and device
CN107046469A (en) * 2017-05-11 2017-08-15 郑州云海信息技术有限公司 A kind of method extended for server load balancing network card equipment
CN107766189A (en) * 2017-10-13 2018-03-06 郑州云海信息技术有限公司 Server restarts the method for testing of stability automatically under a kind of Windows systems
CN107783794A (en) * 2017-09-21 2018-03-09 郑州云海信息技术有限公司 A kind of system and method for automatic identification network interface card
CN110806946A (en) * 2019-11-01 2020-02-18 华云超融合科技有限公司 Detection method, device, server and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070088630A1 (en) * 2005-09-29 2007-04-19 Microsoft Corporation Assessment and/or deployment of computer network component(s)
CN102693192A (en) * 2011-03-23 2012-09-26 研祥智能科技股份有限公司 Automatic network card sorting method, system and corresponding electronic device
CN103986797A (en) * 2014-05-12 2014-08-13 浪潮电子信息产业股份有限公司 Network card sequence adjusting method based on Linux operation system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070088630A1 (en) * 2005-09-29 2007-04-19 Microsoft Corporation Assessment and/or deployment of computer network component(s)
CN102693192A (en) * 2011-03-23 2012-09-26 研祥智能科技股份有限公司 Automatic network card sorting method, system and corresponding electronic device
CN103986797A (en) * 2014-05-12 2014-08-13 浪潮电子信息产业股份有限公司 Network card sequence adjusting method based on Linux operation system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
网友: "centos固定多网卡启动顺序", 《HTTP://BLOG.C1GSTUDIO.COM/ARCHIVES/1703》 *

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106020914A (en) * 2016-06-07 2016-10-12 浪潮电子信息产业股份有限公司 Method for adjusting loading sequence of multiple controller drives under RedHat7
CN106909390A (en) * 2017-02-28 2017-06-30 郑州云海信息技术有限公司 A kind of NCSI methods to set up realized based on BMC and device
CN106909390B (en) * 2017-02-28 2020-11-24 苏州浪潮智能科技有限公司 NCSI setting method and device realized based on BMC
CN107046469A (en) * 2017-05-11 2017-08-15 郑州云海信息技术有限公司 A kind of method extended for server load balancing network card equipment
CN107046469B (en) * 2017-05-11 2021-02-02 苏州浪潮智能科技有限公司 Method for expanding server load balancing network card equipment
CN107783794A (en) * 2017-09-21 2018-03-09 郑州云海信息技术有限公司 A kind of system and method for automatic identification network interface card
CN107766189A (en) * 2017-10-13 2018-03-06 郑州云海信息技术有限公司 Server restarts the method for testing of stability automatically under a kind of Windows systems
CN110806946A (en) * 2019-11-01 2020-02-18 华云超融合科技有限公司 Detection method, device, server and storage medium
CN110806946B (en) * 2019-11-01 2023-06-09 华云数据有限公司 Detection method, detection device, server and storage medium

Also Published As

Publication number Publication date
CN105426169B (en) 2019-02-15

Similar Documents

Publication Publication Date Title
CN105426169A (en) Method for automatically adjusting network card identification sequence in Windows system
CN104935615B (en) Realize the system and method for voice control household appliance
CN103117960A (en) System and method of broadband user speeding up access bandwidth in self-service mode
CN104123940A (en) Voice control system and method based on intelligent home system
CN204759403U (en) System based on data pass realization equipment internal module thoroughly and upgrade
CN106528272B (en) A kind of data processing equipment, method and terminal
SG11201906426PA (en) Device configuration method, apparatus and system
CN104102508A (en) FlexRay bus-based multimachine program online upgrade method
CN105425648A (en) Portable robot and data processing method and system thereof
CN105391747A (en) Cloud intelligent equipment management method
CN109005190A (en) A method of full-duplex voice dialogue and page control are realized based on webpage
CN102932791A (en) Method for collaboratively processing information through WIFI wireless network between smart phone and computer
CN110555145A (en) Browser-based webpage content acquisition system and acquisition method thereof
CN103826119A (en) Set top box debugging device and method
CN105607606A (en) Data acquisition device and data acquisition method based on double-mainboard framework
CN111651289B (en) Internet of things data docking method, system and related equipment
CN109684817B (en) Multi-system user management method
CN116795597A (en) Online document data processing method, device, equipment and storage medium under network abnormality
CN107766066A (en) A kind of method for updating slave module firmware
CN105306675B (en) A kind of cross-platform dynamic UI matching process
CN104378144A (en) Bluetooth equipment software installing method and system
CN103260065A (en) Set top box speech control method based on Android system
CN107038048A (en) A kind of dual-active server system upgrade method and platform
CN106802795A (en) A kind of fast text interpretation method based on Android system
CN105278927A (en) Printing message obtaining method and printing message obtaining device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant