Scan multiple ports on multiple computers
Hey guys,
I wrote the following batch script to use along with portqry tool which is availabe from microsoft download center.
The tool can scan multiple ports on a single computer, but it is not capable of scanning multiple ports on multiple computers in one attempt. Also it gives a big output which is a bit tough if you are trying to prepare a report.
Here is the batch file which takes input from server.txt where all the computer names present and scans for the below ports on each computer and gives you output in a beautiful way.
TCP: 135, 445, 1433, 1434, 1024, 1040
UDP: 1433, 1434
Copy and paste the below code in a batch file and use it along with portqry.exe.
echo off
for /f "tokens=* delims= " %%a in (server.txt) do call :vk %%a
:vk
portqry -n %1 -e 1434 -q -p udp
if errorlevel = 2 goto filtered_1434
if errorlevel = 1 goto failed_1434
if errorlevel = 0 goto success_1434
goto 135
:filtered_1434
Echo %1 udp Port 1434 is listening or filtered
goto 135
:failed_1434
Echo %1 udp Port 1434 is not listening
Goto 135
:success_1434
Echo %1 udp Port 1434 is listening
goto 135
:135
portqry -n %1 -e 135 -q -p tcp
if errorlevel = 2 goto filtered_135
if errorlevel = 1 goto failed_135
if errorlevel = 0 goto success_135
goto 445
:filtered_135
Echo %1 tcp Port 135 is listening or filtered
goto 445
:failed_135
Echo %1 tcp Port 135 is not listening
Goto 445
:success_135
Echo %1 tcp Port 135 is listening
goto 445
:445
portqry -n %1 -e 445 -q -p tcp
if errorlevel = 2 goto filtered_445
if errorlevel = 1 goto failed_445
if errorlevel = 0 goto success_445
goto 1433_tcp
:filtered_445
Echo %1 tcp Port 445 is listening or filtered
goto 1433_tcp
:failed_445
Echo %1 tcp Port 445 is not listening
Goto 1433_tcp
:success_445
Echo %1 tcp Port 445 is listening
goto 1433_tcp
:1433_tcp
portqry -n %1 -e 1433 -q -p tcp
if errorlevel = 2 goto filtered_1433_tcp
if errorlevel = 1 goto failed_1433_tcp
if errorlevel = 0 goto success_1433_tcp
goto 1434_tcp
:filtered_1433_tcp
Echo %1 tcp Port 1433 is listening or filtered
goto 1434_tcp
:failed_1433_tcp
Echo %1 tcp Port 1433 is not listening
Goto 1434_tcp
:success_1433_tcp
Echo %1 tcp Port 1433 is listening
goto 1434_tcp
:1434_tcp
portqry -n %1 -e 1434 -q -p tcp
if errorlevel = 2 goto filtered_1434_tcp
if errorlevel = 1 goto failed_1434_tcp
if errorlevel = 0 goto success_1434_tcp
goto 1024
:filtered_1434_tcp
Echo %1 tcp Port 1434 is listening or filtered
goto 1024
:failed_1434_tcp
Echo %1 tcp Port 1434 is not listening
Goto 1024
:success_1434_tcp
Echo %1 tcp Port 1434 is listening
goto 1024
:1024
portqry -n %1 -e 1024 -q -p tcp
if errorlevel = 2 goto filtered_1024
if errorlevel = 1 goto failed_1024
if errorlevel = 0 goto success_1024
goto 1040
:filtered_1024
Echo %1 tcp Port 1024 is listening or filtered
goto 1040
:failed_1024
Echo %1 tcp Port 1024 is not listening
Goto 1040
:success_1024
Echo %1 tcp Port 1024 is listening
goto 1040
:1040
portqry -n %1 -e 1040 -q -p tcp
if errorlevel = 2 goto filtered_1040
if errorlevel = 1 goto failed_1040
if errorlevel = 0 goto success_1040
goto 1433
:filtered_1040
Echo %1 tcp Port 1040 is listening or filtered
goto 1433
:failed_1040
Echo %1 tcp Port 1040 is not listening
Goto 1433
:success_1040
Echo %1 tcp Port 1040 is listening
goto 1433
:1433
portqry -n %1 -e 1433 -q -p udp
if errorlevel = 2 goto filtered_1433
if errorlevel = 1 goto failed_1433
if errorlevel = 0 goto success_1433
goto end
:filtered_1433
Echo %1 udp Port 1433 is listening or filtered
goto end
:failed_1433
Echo %1 udp Port 1433 is not listening
Goto end
:success_1433
Echo %1 udp Port 1433 is listening
goto end
:End
For what it's worth, I wrote a PowerShell script that does something like this a while back.
http://gallery.technet.microsoft.com/scriptcenter/97119ed6-6fb2-446d-98d8-32d823867131
Similar Messages
-
Multiple ports of multiple cards bouncing randomly on a 6500
A couple months ago, on one of my 6500 switch, ports start bouncing randomly. It happened to all the line modules. Here I am including a portion of log from the switch.
Sep 22 04:02:48.479 edt: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet4/37, changed state to down
Sep 22 04:02:49.935 edt: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet4/37, changed state to up
Sep 22 04:02:55.855 edt: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet3/11, changed state to down
Sep 22 04:02:56.063 edt: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet4/16, changed state to down
Sep 22 04:02:57.891 edt: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet3/11, changed state to up
Sep 22 04:02:59.379 edt: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet4/16, changed state to up
Sep 22 04:03:02.311 edt: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet6/4, changed state to down
Sep 22 04:03:05.471 edt: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet6/2, changed state to down
Sep 22 04:03:06.155 edt: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet6/4, changed state to up
Sep 22 04:03:09.311 edt: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet6/2, changed state to up
Sep 22 04:57:12.943 edt: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet4/39, changed state to down
Sep 22 04:57:16.167 edt: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet4/39, changed state to up
Sep 22 04:57:28.311 edt: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet4/39, changed state to down
Sep 22 04:57:31.235 edt: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet4/39, changed state to up
Sep 22 04:58:41.176 edt: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet4/39, changed state to down
Sep 22 04:58:42.368 edt: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet4/39, changed state to up
Sep 22 05:00:35.417 edt: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet3/48, changed state to down
Sep 22 05:00:37.133 edt: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet3/48, changed state to up
Sep 22 05:00:47.753 edt: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet3/48, changed state to down
Sep 22 05:00:49.361 edt: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet3/48, changed state to up
Sep 22 05:01:40.285 edt: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet3/48, changed state to down
Sep 22 05:01:43.205 edt: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet3/48, changed state to up
Sep 22 05:30:33.899 edt: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet2/11, changed state to down
Sep 22 05:30:52.627 edt: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet2/11, changed state to up
Sep 22 07:58:22.202 edt: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet4/8, changed state to down
Sep 22 08:00:44.755 edt: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet4/8, changed state to up
Sep 22 08:02:35.848 edt: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet4/8, changed state to down
Sep 22 08:02:38.808 edt: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet4/8, changed state to up
The frequency of this random bouncing changes from hours to days. There are also some indications that certain ports were bouncing at certain specific time. But, the generally speaking, there is no pattern of these bouncing.
By the way, this switch was running for a couple of years before this happened recently.
Anyone out there has seen similar case like this? Thank your for any suggestion on solving this issue.what kind of switch is it? did the logging level chage when you started to see this? this could be just normal people rebooting machines? if you have starte some process to push out patches that require reboots to mahines this could cause this type of message output. have you gone to the device on the ports and checked them out?
-
Multiple ports in scan listener
We have a rac two node on exa database machine with scan listener running from port 1525.
version 11.2.0.4
we want to add another port to scan-listener. will it have any adverse affect on existing infrastructure.Hi user13427480 -
The support for the Grid Infrastructure and SCAN, including setting up multiple ports for the SCAN listener, is the same on Exadata as any other Linux x86-64 environment. I have not actually configured this and tested it personally on Exadata, but there shouldn't be anything about the Exadata infrastructure that would affect it. As with any change you should test and validate it in your non-prod environment before deploying anything into production.
Thanks,
Kasey -
Forward the same port to multiple computers??
im sure this is impossible, but there must be a workaround; i have a laptop and a big computer and both computers use skype, however, i'm not always on one computer. skype wants port 443 and 80 i think, so how do i get my router to forward these ports to two computers? it's the same with ssh, what if i have my laptop and big computer at home? how do i choose what computer i ssh into?
a little off the topic, but can anyone advise as to how to set up my new skype download?
I have a new imac 24" and just downloaded the latest version of skype. I also have a smc router for other computers. i get an error "valid port numbers are 1024...65535"
how do I fix this issue? I am not savvy enough to understand the info that is provided by Skype, and need some step by step info, I think.
can anyone help?
Thanks, Ne
imac 24" Mac OS X (10.4.8) -
Hey all, I've bounced around here and the knowledge base a bit and couldnt find my answer.
I have a range of 120 ports that I need to forward to my computer. I've already got everything with static IP and a couple ports working like a top.
Basiclly I'm wondering if its possible to forward a range of ports instead of having to 120 seperate entries.
I'm aware of the dmz option but would rather not have it wide open.
Thanks all!You're correct in your analysis and this would have worked. Turns out the telephone adapter, TA, is a router (although ATT Callvantage said it was not). I brought in a local apple dealer's network sensei and he first changed the IP address of the TA to 10.1.1.201, just outside the range that my APE assigned to my computers and APE's. But, the TA needed multiple ports forwarded, including the range of 10,000 to 11,000. This killed that approach. What was done is that the TA was connected between the APE and the DSL modem. This seems to be working very well.
The network tech saidn that the lack of ability of the APE to both forward more than 20 ports and no ability to forward a range of ports is a huge drawback. The tech said that he uses a Linksys router for his own personal network.
I f I didn't use wireless printing and the APE with my iTunes, I'd betempted to can the APE. I am very disappointed in Apple.
Regards, Axxel -
Scanning multiple pages to multiple pdf on HP Laserjet M3035
We have a Laserjet M3035 MFP installed as network printer.
We can scan multiple pages in to a single PDF to a folder on the server.
We would like to scan multiple pages to multiple PDF to a folder on the server.
e.g. one page to one pdf with the ADF 40 pages in one go. Is it possible and how do we do it.
Thanks for the possible solutions
DanyHi @maesend,
Welcome to the HP Forums!
To get your issue more exposure I would suggest posting it in the commercial forums since the HP Laserjet M3035 is a commercial product. You can do this at HP Enterprise Business Community.
The support page for your product may be helpful in the meantime:
HP Support Center.
I hope this helps!
RnRMusicMan
I work on behalf of HP
Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
Click the “Kudos Thumbs Up" to say “Thanks” for helping! -
How do multiple users on different computers work on an Indesign file?
Do we work on it on the Cloud and only one license is needed for same project? Do we need multiple licenses for different computers working on the same file? If I buy Indesign, will I be the only person who can access the software from my computer?
thank you so much! I wouldn't be giving the copy to anyone but yes would
need to access the project from two computers. If this is only a seasonal
project (primary school yearbook), I guess I'm better off just paying
monthly until we need it.
On Mon, Mar 9, 2015 at 10:18 AM, John T Smith <[email protected]> -
Extended acl - multiple ports on same acl line
hello
i'm working on a (long) acl and have started looking at putting multiple ports on the same line
e.g.
instead of:
ip access-list extended test3
permit tcp any host 10.10.10.1 eq 80
permit tcp any host 10.10.10.1 eq 443
i'd use:
ip access-list extended test3
permit tcp any host 10.10.10.1 eq 80 443
its shortening the acl considerably but the question is:
does this method reduce the TCAM resources required (compared to writing the acl in long hand)?
what are the maximum number of ports that can be included on the same line - is it platform/ios dependant?
thanks
andyHello
No. I went ahead with the acl with multiple ports in each ACE and it worked fine. It was deployed on an old WS-C3750G-24PS-E and worked pretty well. When I checked the tcam on the switch I got the following output:
Cisco3750#show platform tcam utilization
CAM Utilization for ASIC# 0 Max Used
Masks/Values Masks/values
IPv4 security aces: 1024/1024 33/33
Note: Allocation of TCAM entries per feature uses
a complex algorithm. The above information is meant
to provide an abstract view of the current TCAM utilization
As there were other ACLs on the switch it was difficult to gauge if the multiple ports per ACE approach to ACLs actually saved any TCAM resources. If you find anything out post back - I'd be interested to hear.
thanks
Andy -
Multiple ports on single node cannot communicate
I am a Sr. Tech Architect from SBC that it evaluating your product for utilization in our enterprise online order application in combination with the Solarmetric Kodo product.
I was able to install and utilize your application and line command, sample applications no problem on a single jvm utilizing multiple ports and all the members were being recognized no problem. Suddenly, they are no longer being picked up. I am using the packaged configuration xml files as is, just running multiple dos windows on a Win 2k box and launching the line command application. The only other development work I have been doing on the box is test deploys to Apache of the product along with the integration of the Kodo product in a WSAD 5.1 environment, however, I have both those applications shut down and rebooted the machine with no success. I tried running the multicast test just for kicks and got no response back. Scratching my head as to what my be the problem all of a sudden.
Thanks,
ScottScott,
Did you, by any chance, install and enable "Microsoft Loopback Adapter"? If so, you'd need to disable it. If not, could you please e-mail me the command line and some output of the multicast test.
Thanks,
Gene
[email protected] -
HP Officejet 6500A How do I scan a document with multiple pages into one file?
HP Officejet 6500A Plus e-All-in-One Printer - E710n
Windows 7 (64 bit)
How do I scan a document with multiple pages into one file? My old printer (psc 2110) asked after each scan if I wanted to scan another page. At the end I had one pdf file with multiple pages.
This new one creates one file for each page and I cannot find a way to create one pdf file with multiple pages.
This question was solved.
View Solution.Hi mpw101,
If you load the papers into the ADF - Automatic Document Feeder, and then select Document to PDF then they will all be scanning into one file. Let me know if this works for you?
I am an HP employee.
Say Thanks by clicking the Kudos Star in the post that helped you.
Please mark the post that solves your problem as "Accepted Solution" -
ISE 1.2 and ACL's with multiple ports
When creating a DACL for my groups I used the Syntax " permit tcp any 192.168.20.0 0.0.0.255 eq 22 443" for one of my acl's inside the DACL and the syntax check validated it. When I pushed it to my groups it also worked but I have heard that this type of multiple port ACL in ISE is not supported. Does anyone know if this is accurate?
Thanks for the response but it's wrong. Cisco supports stacked ports in 1.2 for wired users. They carried over 1.1documentation to 1.2 and never updated it. We have it in writing from Cisco tac.
-
my iphone 3gs keeps showing the screen with the connect to itunes display, and I've restored it multiple times on different computers, but everytime it finishes restoring, it shows the display again and the computer says it needs to be restored. can anybody help me with this?
it was saying error code 1, i tried the things it said but none of it worked. now it is not showing an error code at all, it just keeps saying it needs to be restored.
-
Hello Gilles,
One question about something I was not able to find in the documentation.
Lets say I have one class-map which includes 2 ports (in this case https and 5061).
Can I associate this class-map to just 1 generic serverfarm and probe for both ports or I have to specify 2 serverfarms/rservers/probes?
So, by not specifying the ports on the rserver, if a request is received on port 443 (or 5061), it is sent to the same respective port on the rserver?
The same way is valid for the generic probe. ACE module is able to probe both ports based on the class-map?
Thanks and have a great day!!
Giulio.
probe tcp PROBE_GENERIC_TCP
description This probe works for all TCP services by inheriting the VIP port.
interval 15
faildetect 2
passdetect interval 15
passdetect count 2
open 2
rserver host SERVER1_ACCESS
ip address <1AC>
inservice
rserver host SERVER2_ACCESS
ip address <2AC>
inservice
serverfarm host ACCESS-SFARM
probe PROBE_GENERIC_TCP
rserver SERVER1_ACCESS
inservice
rserver SERVER2_ACCESS
inservice
class-map match-any OCS_L4ACCESS
2 match virtual-address x.x.x.176 tcp eq https
2 match virtual-address x.x.x.176 tcp eq 5061
policy-map type loadbalance first-match OCS_L4ACCESS
class class-default
sticky-serverfarm ACCESS_STICKY
policy-map multi-match POLICY
class OCS_L4ACCESS
loadbalance vip inservice
loadbalance policy OCS_L4ACCESS
loadbalance vip icmp-reply active
connection advanced-options OCS_VIPTIMEOUT
nat dynamic XXX vlan 503Even if you use the 4710 appliance or expect the inheritance in the module software, it's worth considering if this is really what you want. If you keep multiple ports in the L3/L4 class-map you can't handle the services independently. You will have a common serverfarm for both https and 5061. If https service stops on one rserver, the ACE will place that rserver (and not that service) in out-of-operation state and it won't receive any 5061 traffic either. (You have the fail-on-all probe option but I wouldn't say it's a better choice. In that case, https traffic would be sent to the rserver even if https port is closed as long as there is at least one working service on it.) That's why I prefer a separate class-map and separate serverfarm for each service. (They can contain the same rservers, no need to duplicate.) BUT if the software supports probe port inheritance, you can benefit from it even in this scenario: serverfarm-443 and serverfarm-5061 can both use your PROBE_GENERIC_TCP.
-
Need to setup monitoring aon multiple ports for IDS
I have a cisco 3845. I need to need to setup monitoring aon multiple ports for IDS on 2 ports. How do I do this.
Also,
Is there a way to make ports on the switch portion act like hubs.
ThanksI assume that you are referring to the Ethernet Switch Module in the 3845. If so it should support SPAN. Here is a SPAN configurations guide:
http://www.cisco.com/univercd/cc/td/doc/product/software/ios122/122newft/122limit/122z/122zj15/fz1636nm.htm#1820129 -
Hi
WSDL apparently supports more than one 'Port' definition within
a Service defintion.
I am wondering whether this would be possible at all in WL6.1, using wsgen ? Basically,
I have a couple of session beans that
I want to expose as webservices, thru a single WSDL file. Each bean would become
a distinct PortType and ultimately Port in the
WSDL Service definition. However, it looks like the wsgen tool
cannot do this. Am I (hopefully!) wrong ?
Also, the WL client-side examples show the following code to
access a webservice:
Trader service = (Trader)context.lookup(<webservice_uri>);
If the <webservice_uri> has multiple Ports (and PortTypes), that
say, correspond to multiple beans, how would the above resolve
to the right bean ?
thanks
-johnHi John,
No, this is not possible using wsgen. However you can manually edit the files
in a WebLogic Web Services to do this. Actually, the concept of having a single
Web Service, that exposes methods from multiple EJBs is pretty cool. Really shows
that distinction between "service interface" and "service implementation" ;-)
Anyway, the attached zip contains most of the files you would have to manually
edit, and a sample client.
Regards,
Mike Wooten
"john mani" <[email protected]> wrote:
>
Hi
WSDL apparently supports more than one 'Port' definition within
a Service defintion.
I am wondering whether this would be possible at all in WL6.1, using
wsgen ? Basically,
I have a couple of session beans that
I want to expose as webservices, thru a single WSDL file. Each bean would
become
a distinct PortType and ultimately Port in the
WSDL Service definition. However, it looks like the wsgen tool
cannot do this. Am I (hopefully!) wrong ?
Also, the WL client-side examples show the following code to
access a webservice:
Trader service = (Trader)context.lookup(<webservice_uri>);
If the <webservice_uri> has multiple Ports (and PortTypes), that
say, correspond to multiple beans, how would the above resolve
to the right bean ?
thanks
-john
[multibindings.zip]
Maybe you are looking for
-
Dynamic Availability Check in MB26
Hi! We have turned on the dynamic availability check function to output an error if an issue is attempted and where there is no stock. E.g. Stock level - 100 Reservation 1 - 60 -> system committed 60 Reservation 2 - 40 -> system committed 40 Reservat
-
Call external function from SQL query
Hi, I am new to PL/SQL programming.I don't think this is possible but please let me know if there is a way to achieve this. I have a function written in VB.net and I would want to call from the query. create table temp as select id, callvbfunction(no
-
Hi In the production order its not shown the target cost of the order therefore it shows high WIP value. Pls, advice why is that and is there any configuration on that. Reg K
-
"You're not able to purchase this product in your ...
Second time posting this, as the first apparently failed... I've been subscribing to the Unlimited US plan for a few years now, as all of my family and most of my friends live in various parts of the US. For some reason, today, when I went to renew m
-
hi, As per my process order requirement, i converted transfer requirement in to transfer order in warehouse and confirm the transfer order. During conversion the system picks as batch as per FIFO. If there is only one batch there is no problem. if th