Finding a number of unused IP addresses based on subnets

Hello,
I am new in PS so I would ask you for understanding in below matter.
I need to find a number of unused IP in some subnets in my organization for planning purposes.  I would like to use input file where I could  enter a few subnets, then search all subnet range looking for not responding ip addresses. In output csv
file I would like to have 2 columns: "Subnet" and "Number of free IP".
Can I use "New-Object System.Net.Networkinformation.ping" class as below to search not responding IP and then count it in some way ?
$Connect = New-Object System.Net.Networkinformation.ping
for ($i=1; $i -le 254; $i++)
    $IP = "192.168.0." + $i
    $Status = ($Connect.Send("$IPAddress", 1)).Status
        if ($Status -eq "TimedOut")
        Write-Host "$IP is free"
Regards,
Mike

This one is working but it is not solving my issue. I need to count amount of "TimedOut" results and then
write it in csv output file.
e.g. 2 columns
subnet, 192.168.0.
NumberOfTimedOut_IP, 67 
Help Export-Csv
You could start by learning PowerShell.
https://technet.microsoft.com/en-us/scriptcenter/dd742419.aspx
You can also look in the repository as there are numersou sripts there that do this:
https://technet.microsoft.com/en-us/scriptcenter/dd742419.aspx
We do not write scritps on demmand but canhelp you learnhow to write your script.
Post back with a specific scripting question when ready.
¯\_(ツ)_/¯

Similar Messages

  • How can I find MAC address based on the serial number of a missing IpodTouch 4th Gen?

    My Ipod touch 4th Generation is lost.  If I can find the MAC address, the Univeristy can help locate the device.  I have the serial number, is there any way I can find the MAC address based on the serial number?  I did not install a third party app on the IPod to help find it and it is not registered on iCloud, but I used it on iCloud.  Any ideas are greatly appreciated.

    Did you turn on FindMyiPd is Settings>iCloud and is the iPod connected to wifi? That is all that is needed for for Apple FindMyiPhone
    Maybe Apple can find the MAC address
    Apple - Support - iPod touch - Contact Us
    Your question has been asked in the past but no one has responded if Apple could actually help

  • Can I find serial number or mac address of ipad if I know only Apple ID on it?

    Can I find serial number or mac address of ipad if I know only Apple ID on it? Ipad and macbook air were stolen and I do not remember their serial numbers.

    No, the MAC address, the unique set of letters and numbers that identify the network interface in the device, will not help you, or anyone else, locate a stolen iPad. If you didn't set up Find My iPad on the device before it was stolen, then there will be no way to track it. The police typically will only want the serial number of the stolen items so they can identify them should they manage to find the thief.
    If none of the methods suggested by the others - receipts, iTunes, registration with Apple, packaging - can provide you the serial number, then there's no way you can obtain that information
    Regards.

  • How to track a 4g att iPad stolen? no find my iPhone installed. i have all serial number, imdi, iccdid, ip address...any help?

    I have all numbers...Serial number, imei, iccid, ip address. any help. i just got this one replaced and didnt get the chance to set up the locks.

    If you did not enable Find My iPad under Settings>iCloud, there is no way to track it.

  • How to find imei number

    hi my name is james bowd and i was wondering how to find my imei number/code as i need prof that the iphone is mine
    please reply on [email protected] thank you

    You should not post your email address in these forums - they're public and it will likely lead to spam.
    On your iPhone, go to Settings, General, About, and scroll down. You'll find IMEI number there.
    Matt

  • How to find the number of occurance of a string in text field of Infopath form?

    Hi All,
    In Infopath text field, How to find the number of occurrence of a particular string in that field?
    Thanks in advance!

    You can check to see if it contains a string once by using the contains function, but there isn't a very clean way to do what you want. If you wanted to guess at the maximum number of occurrences, then you could:
    Box A has your initial. Set Box B to do a concat of string-before and string-after of Box A where it copies Box A minus the string we're looking for. Then we have Box C that does the same thing to Box B. Repeat as many times as you see necessary.
    Example:
    String: "1"
    Box A - "123451234512345"
    Box B - "23451234512345"
    Box C - "2345234512345"
    Box D - "234523452345"
    etc.
    We then have a field that has nested ifs looking backwards from Z -> A looking for a non-blank. Based on that, we return the number of occurrences. Again, this isn't clean, but it will work if you think there's a predefinable maximum.
    Andy Wessendorf SharePoint Developer II | Rackspace [email protected]

  • How to Find the number of Databases in a server.

    HI,
    Please tell me how to find the number of Databases are in a server . when the DB is not up.
    ps -ef | grep ora_
    This i know whether our DB is up or not. But i want to know how many databases are in a server .If the database is down .
    Cheers,
    Gobi.

    Hi,
    [oracle@oralinux admin]$ lsnrctl status
    LSNRCTL for Linux: Version 9.2.0.4.0 - Production on 01-DEC-2006 16:25:41
    Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved.
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)))
    TNS-01169: The listener has not recognized the password
    [oracle@oralinux admin]$
    Plz give me the solution.
    Cheers ,
    Gobi.

  • How to find Installation Number in R3 to create Technical system in XI.

    Hi,
    how to find Installation Number in R3 to create Technical system in XI. can you please help me out.
    thanks
    siva.

    Hi Siva,
    Host name you can find at same location. Not sure about message server port (Basis team shall be able to provide this information)....
    However there is a very simple way fo creating technical system..
    Check out this Michals blog...its very easy
    /people/michal.krawczyk2/blog/2005/03/10/registering-a-new-technical-system-in-sld--abap-based
    Nilesh

  • How to find the number of records per months  in cube

    Hi,
      how to find the number of records per months for my all cubes?
      Can i use the ListCube transaction to find totl number f records per cube monthwise ?
    Jimmy

    Hi,
    Here is a program to generate no of records and list of ODS and Cubes in Active version.Schedule this program in background and create a cube to load this information and schedule to the data from the file generated by the program. Schedule this all per you requirement.
    1.Copy the code into your Z<programname> from Se38.
    2.change the FILENAME in CALL FUNCTION 'GUI_DOWNLOAD' in the program to the location from where you can pick the information to load data to cube(eg Application server).
    3.Save program.
    4.Schedule the program in background as required
    5.Create cube with infoobjects to hold no of records and Infoprovider name
    6.Load this cube based on event after the program job is done.
    Hence you can report on this cube to see no of records in  CUBE or ODS in your box.
    Please find the code below.
    Cheers,
    Kavitha Kamesh.
    types: begin of itabs ,
          tabname type dd02l-tabname,
          end of itabs.
    data: itab type itabs occurs 0 with header line.
    data: counter type i.
    data: begin of itab1 occurs 0,
    tabname type dd02l-tabname,
    counter type i,
    end of itab1.
    DATA: ITABTABNAME TYPE STRING.
    DATA: LENGTH TYPE I.
    DATA: OBJECT(30).
    data: str(6) type c.
    select  tabname from dd02l into table itab where ( tabname LIKE  '/BIC/F%' or tabname LIKE  '/BIC/A%00' )
    and TABCLASS = 'TRANSP' and AS4LOCAL = 'A'.
    loop at itab.
      select count(*) from (itab-tabname) into counter.
      str = itab-tabname.
      if str = '/BIC/F'.
    LENGTH  = STRLEN( ITAB-TABNAME ).
      SHIFT  itab-tabname BY 6 PLACES LEFT.
    ELSEIf  str = '/BIC/A'.
      SHIFT  itab-tabname BY 6 PLACES LEFT.
      LENGTH  = STRLEN( ITAB-TABNAME ).
    LENGTH = LENGTH - 2.
    endif.
      itab1-tabname = itab-tabname(LENGTH).
      append itab1.
      itab1-counter = counter.
      clear itab-tabname.
      clear:  COUNTER.
    endloop.
    *********** itab1
    loop at itab1.
    write:/ itab1-tabname, itab1-counter.
    endloop.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
    *   BIN_FILESIZE                    =
        FILENAME                        = 'c:records.xls'
        FILETYPE                        = 'ASC'
    *   APPEND                          = ' '
        WRITE_FIELD_SEPARATOR           = ','
    *   HEADER                          = '00'
    *   TRUNC_TRAILING_BLANKS           = ' '
    *   WRITE_LF                        = 'X'
    *   COL_SELECT                      = ' '
    *   COL_SELECT_MASK                 = ' '
    *   DAT_MODE                        = ' '
    *   CONFIRM_OVERWRITE               = ' '
    *   NO_AUTH_CHECK                   = ' '
    *   CODEPAGE                        = ' '
    *   IGNORE_CERR                     = ABAP_TRUE
    *   REPLACEMENT                     = '#'
    *   WRITE_BOM                       = ' '
    *   TRUNC_TRAILING_BLANKS_EOL       = 'X'
    *   WK1_N_FORMAT                    = ' '
    *   WK1_N_SIZE                      = ' '
    *   WK1_T_FORMAT                    = ' '
    *   WK1_T_SIZE                      = ' '
    * IMPORTING
    *   FILELENGTH                      =
      TABLES
        DATA_TAB                        = itab1
    *   FIELDNAMES                      =
    * EXCEPTIONS
    *   FILE_WRITE_ERROR                = 1
    *   NO_BATCH                        = 2
    *   GUI_REFUSE_FILETRANSFER         = 3
    *   INVALID_TYPE                    = 4
    *   NO_AUTHORITY                    = 5
    *   UNKNOWN_ERROR                   = 6
    *   HEADER_NOT_ALLOWED              = 7
    *   SEPARATOR_NOT_ALLOWED           = 8
    *   FILESIZE_NOT_ALLOWED            = 9
    *   HEADER_TOO_LONG                 = 10
    *   DP_ERROR_CREATE                 = 11
    *   DP_ERROR_SEND                   = 12
    *   DP_ERROR_WRITE                  = 13
    *   UNKNOWN_DP_ERROR                = 14
    *   ACCESS_DENIED                   = 15
    *   DP_OUT_OF_MEMORY                = 16
    *   DISK_FULL                       = 17
    *   DP_TIMEOUT                      = 18
    *   FILE_NOT_FOUND                  = 19
    *   DATAPROVIDER_EXCEPTION          = 20
    *   CONTROL_FLUSH_ERROR             = 21
    *   OTHERS                          = 22
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

  • How to find maximum number of users we can assign for Hyperion Planning.

    HI,
    How to find maximum number of users we can assign for Hyperion Planning.i.e., how to find license limit in hyperion planning 11.1.2.1.
    In Essbase propreties, the system is showing maximum planning users could be 65535.
    what would be the number for concurrent scenario?
    Thanks
    Giri
    Edited by: Giriprasad on Jun 18, 2012 2:18 AM

    The number of users would be based on your license agreement with Oracle, the system is not aware of your license agreement so it is up to you to stick to it.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • How to find the number of records in ods?

    how to find the number of records in ods?
    Pls suggest the solution apart going to the table of ods and seeing the number of records.
    Is there any program or function module to see the number of records in ods?
    For eg: SAP_INFOCUBE_DESIGNS is a program which gives the detail (number of records) of infocube.

    Hi,
    I was looking at this and found the following tables that may be of help.
    One of these tables will include a summary of the record count of all the tables in your system based on the last time each table had it's database statistics calculated:
    DBSTATTADA
    DBSTATTDB2
    DBSTATTDB4
    DBSTATTDB6
    DBSTATTINF
    DBSTATTMSS
    DBSTATTORA
    We run on an Oracle database so the table record counts can be taken from DBSTATTORA. Type in AZ in table selection field in SE16 to restrict the output to ODS (or DSO) tables only.
    The record count is at the time indicated in the timestamp field. Obviously this is not real time but should not be too out of date - if it is you may be having performance issues and should get your DBA / Basis to run a full refresh of DB stats.
    Hope this helps, alhtough not real time the table should give you a decent indication of the size of all your ODS objects (or any other table for that matter!)

  • How do I find the number of physical CPUs , number of cores in OEL ?

    In RHEL , it is easy to find the number of Physical CPUs and the number of cores within each CPU
    -- Ouput from Red Hat Enterprise Linux 5.4
    -- This a real machine. Not a VM
    $ cat /proc/cpuinfo
    processor       : 0
    vendor_id       : GenuineIntel
    cpu family      : 6
    model           : 46
    model name      : Intel(R) Xeon(R) CPU           X7550  @ 2.00GHz
    stepping        : 6
    cpu MHz         : 1995.048
    cache size      : 18432 KB
    physical id     : 0              --------------> This will give info on the physical CPU
    siblings        : 8
    core id         : 0
    cpu cores       : 8              --------------> This will give the number of cores within a CPU
    apicid          : 0
    fpu             : yes
    fpu_exception   : yes
    cpuid level     : 11
    wp              : yes
    flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx rdtscp lm constant_tsc ida nonstop_tsc pni monitor ds_cpl vmx est tm2 cx16 xtpr popcnt lahf_lm
    bogomips        : 3990.09
    clflush size    : 64
    cache_alignment : 64
    address sizes   : 44 bits physical, 48 bits virtual
    power management: [8]Output from Oracle Linux . Physical CPU Id and Number of Cores info is missing.
    -- Output from Oracle Enterprise Linux 6.3
    -- This is a virtual machine created using Virtual Box
    -- Processor ID , number of cores is missing
    $ cat /proc/cpuinfo
    processor       : 0
    vendor_id       : GenuineIntel
    cpu family      : 6
    model           : 42
    model name      : Intel(R) Core(TM) i7-2760QM CPU @ 2.40GHz
    stepping        : 7
    cpu MHz         : 2298.627
    cache size      : 6144 KB
    fpu             : yes
    fpu_exception   : yes
    cpuid level     : 5
    wp              : yes
    flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx rdtscp lm constant_tsc up rep_good nopl pni monitor ssse3 lahf_lm
    bogomips        : 4597.25
    clflush size    : 64
    cache_alignment : 64
    address sizes   : 36 bits physical, 48 bits virtual
    power management:Is this the expected output in Oracle Enterprise Linux ? If so, how can I find the number of Physical CPUs and the number of cores within a Physical CPU in OEL?
    Is this info missing because I am running OEL in a virtual machine ?

    Oracle Linux behaves exactly like Red Hat in this matter an /proc/cpuinfo can be used for that. I guess this is because you have set up VirtualBox to only assign one virtual CPU to your guest Linux.
    processor     : 0
    vendor_id     : AuthenticAMD
    cpu family     : 15
    model          : 33
    model name     : Dual Core AMD Opteron(tm) Processor 275
    stepping     : 2
    cpu MHz          : 1000.000
    cache size     : 1024 KB
    physical id     : 0
    siblings     : 2
    core id          : 0
    cpu cores     : 2
    apicid          : 0
    initial apicid     : 0
    fpu          : yes
    fpu_exception     : yes
    cpuid level     : 1
    wp          : yes
    flags          : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt lm 3dnowext 3dnow rep_good extd_apicid pni lahf_lm cmp_legacy
    bogomips     : 1994.47
    TLB size     : 1024 4K pages
    clflush size     : 64
    cache_alignment     : 64
    address sizes     : 40 bits physical, 48 bits virtual
    power management: ts fid vid ttpAnother example is this one, OEL 5.6 inside of VirtualBox but with 2 virtual CPUs assigned:
    [root@oel56proxy ~]# cat /proc/cpuinfo
    processor       : 0
    vendor_id       : GenuineIntel
    cpu family      : 6
    model           : 23
    model name      : Intel(R) Core(TM)2 Duo CPU     P8600  @ 2.40GHz
    stepping        : 10
    cpu MHz         : 2064.652
    cache size      : 6144 KB
    physical id     : 0
    siblings        : 2
    core id         : 0
    cpu cores       : 2
    apicid          : 0
    fdiv_bug        : no
    hlt_bug         : no
    f00f_bug        : no
    coma_bug        : no
    fpu             : yes
    fpu_exception   : yes
    cpuid level     : 5
    wp              : yes
    flags           : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx lm constant_tsc pni ssse3 lahf_lm
    bogomips        : 4129.30
    processor       : 1
    vendor_id       : GenuineIntel
    cpu family      : 6
    model           : 23
    model name      : Intel(R) Core(TM)2 Duo CPU     P8600  @ 2.40GHz
    stepping        : 10
    cpu MHz         : 2064.652
    cache size      : 6144 KB
    physical id     : 0
    siblings        : 2
    core id         : 1
    cpu cores       : 2
    apicid          : 1
    fdiv_bug        : no
    hlt_bug         : no
    f00f_bug        : no
    coma_bug        : no
    fpu             : yes
    fpu_exception   : yes
    cpuid level     : 5
    wp              : yes
    flags           : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx lm constant_tsc pni ssse3 lahf_lm
    bogomips        : 7494.15I have not tried to replicate this with a VM that only has one vCPU assigned but I guess that is why you only see one CPU and no processor_id and so on.
    Bjoern

  • Fast way to find the number of non-zero terms in an array or image

    I am trying to use the Standard Deviation PtbyPt Vi.  It takes in a series of points, can be reset when beginning the calculation.  There is also an input for sample size.  I am calculating some statistics on an array...and would only  to include like the non-zero elements that are  in the sample. 
    Is there a quick way to look at an array and find the number of non-zero elements?
    Thanks.
    Solved!
    Go to Solution.

    GerdW wrote:
    - for big arrays this may lead to "out of memory" problems because of creation of data copies
    Here's a quick rundown on memory allocations based on the algorithm.
    (case 1&3)
    If you do the "!=0, ?1:0, I32, sum" shuffle, each step needs to allocate a new array, so if the input array is DBL and uses N amount of memory, we need 7N/8 more memory.
    (Total of 15N/8, or 13N/8 if we don't need the I32, but in this case the array are too small to worry about anything )
    The nice thing is that it works for any array dimensionality (1D, 2D, 5D, etc...)
    (Case 2&5)
    If you do the summing in a shift register, No additional array memory is needed. Unfortunately, the code needs to be changed by adding an extra FOR loop for each dimension (see case 5 for 2D inputs).
    (Case 4)
    If we reshape the N-D array to a 1D array, we need to create a second copy, so the memory usage is about twice. This also works for any dimension.
    In real life, and if memory is a potential issue, you should always do some benchmarks.
    Often, the issues are more complex, so this is just a quick summary.
    Message Edited by altenbach on 10-23-2008 11:59 AM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    CountNonZero.PNG ‏29 KB

  • Changed source address based on destination IP

    Hello,
    Suppose I had the following configuration in an IOS router
    interface <interface type/number>
     ip address 1.1.1.3 255.255.255.0 secondary
     ip address 1.1.1.2 255.255.255.0
    ip route 0.0.0.0 0.0.0.0 1.1.1.1
    access-list standard INTERNET_BOUND_ACL
     permit <lan subnet-id> <lan wildcard>
    ip nat inside source list INTERNET_BOUND_ACL interface <interface type/number> overload
    I need to change the source inside global IP address based on the destination outside global IP address.
    Example: I need our source IP to be 1.1.1.3 when I ping 8.8.8.8
    How would i accomplish this?

    Hi,
    You would need to use two NAT pools and two different ACLs to separate your internal clients depending on the destination they want to communicate with, and to subsequently NAT them using a selected NAT pool. For example:
    ip access-list extended NAT_2
      permit ip <LAN Network> <Wildcard> <DestinationX> <WildcardX>
    ip access-list extended NAT_3
      permit ip <LAN Network> <Wildcard> <DestinationY> <WildcardY>
    ip nat pool NATPOOL_2 1.1.1.2 1.1.1.2 netmask 255.255.255.0
    ip nat pool NATPOOL_3 1.1.1.3 1.1.1.3 netmask 255.255.255.0
    ip nat inside source list NAT_2 pool NATPOOL_2 overload
    ip nat inside source list NAT_3 pool NATPOOL_3 overload
    Exactly one of the ACLs should actually contain an entry saying
    permit ip <LAN Network> <Wildcard> any
    to make sure that the internal network gets translated to some of the two public addresses even if itt does not communicate with any specific destination IP.
    Do you believe this could be a workable solution for you?
    Best regards,
    Peter

  • Find Invoice Number of a shopping cart

    Hi All,
    The Flow we follow here for shopping carts is .
    Shopping cart --> PO fpr shp cart ---> Confirmation --->Invoice .
    I am developing an end to end report and reached to a point wher i have the confirmation number , however i want to find the invoice number based on the confirmation number .
    I have got the confirmation number with the help of function module BBP_PD_CONF_GETLIST by passing the po number to the importing parameter .
    How do i proceed to get the invoice number of the shopping cart based on its confirmation number .....
    You help is highly appreciated ..

    Hello
    What scenario you are implementing Extended classic or Classic ?..
    You can use the FM's
    BBP_PD_SC_GETHISTORY
    BBP_PD_GET_DOCFLOW
    BBP_PD*FLOW FM for PO, CTR etc..
    Reward point if useful
    Thanks and Regards
    Pushkar Joshi

Maybe you are looking for