Getting Server IP Address using HttpServletRequest object

Hi
I am writing code using servlets ,
My system is on LAN let say its IP is suppose 192.0.0.1 and i have another computer name "A" on Lan with private ip 192.0.0.2 and also its has public IP 12.0.0.10 suppose.
When i recive request from i try to get its public IP using methods
request .getRemoteAddress(), but problem is i am getting its private IP i want to get its public Ip how i can get it

Are you running dual network interfaces in each machine?
If so, and the packet you're attempting to analyze for public IP address is being received over the local network, I don't think there's a way to accomplish this outside building a lookup table or some such manually.
Or is there some sort of "fun" routing system in place here?
...or have I completely misunderstood the question? :)
-Kyle

Similar Messages

  • Getting wierd error when trying to getting phone IP address using AXL

    I am current trying to use the AXL serviceability API to get phone IP
    address information. I looked the developers guide and used the Java example to create a
    SSL Socket connection to send the SOAP message to. The message I send is as follows:
    POST: 8443/axl/ HTTP/1.0
    Accept: application/soap+xml, application/dime, multipart/related, text/*
    Host:localhost:8443
    Authorization: Basic **************
    Content-type: text/xml
    SOAPAction: "http://schemas.cisco.com/ast/soap/action/#RisPort#SelectCmDevice"
    Content-length: 610
    <?xml version="1.0" encoding="utf-8"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding">
    <SOAP-ENV:Header/>
    <SOAP-ENV:Body>
    <SelectCmDevice sequence="123456">
    <CmSelectionCriteria>
    <Class>Phone</Class>
    <Model>255</Model>
    <NodeName>10.248.140.11></NodeName>
    <SelectBy>Name</SelectBy>
    <MaxReturnedDevices>10</MaxReturnedDevices>
    <SelectItems soapenc:arrayType="SelectItems[1]">
    <Item>SEP001E4A3FAAAA</Item>
    </SelectItems>
    </CmSelectionCriteria>
    </SelectCmDevice>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    The response I get back after about 30 seconds is as follows:
    HTTP/1.1 400 Invalid URI
    Content-Length: 0
    Date: Wed, 12 Mar 2008 19:28:43 GMT
    Server: Apache-Coyote/1.1
    Connection: close
    Could someone point me in the right direction as to what is going wrong?
    Thanks
    Mitch

    well, getting closer. Of course you were correct. After changing it, I now get an http 500 error after a lenghty timeout.
    POST /axl/ HTTP/1.0
    Accept: application/soap+xml, application/dime, multipart/related, text/*
    Host:localhost:8443
    Authorization: Basic ***********
    Content-type: text/xml
    SOAPAction: "http://schemas.cisco.com/ast/soap/action/#RisPort#SelectCmDevice"
    Content-length: 610
    <?xml version="1.0" encoding="utf-8"?>
    http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding">
    Phone
    255
    10.248.140.11>
    Name
    10
    SEP001E4A3FAAAA
    HTTP/1.1 500 Internal Server Error
    Content-Type: text/html;charset=utf-8
    Content-Length: 4566
    Date: Thu, 13 Mar 2008 02:15:53 GMT
    Server: Apache-Coyote/1.1
    Connection: close

  • Using HttpServletRequest object to share variables between static methods.

    Does anyone know of the overhead/performance implications of using the HttpServletRequest object to share variables between a static method and the calling code?
    First, let me explain why I am doing it.
    I have some pagination code that I would like to share across multiple servlets. So I pulled the pagination code out, and created a static method that these servlets could all use for their pagination.
    public class Pagination {
         public static void setPagination (HttpServletRequest request, Config conf, int totalRows) {
              int page = 0;
              if (request.getParameter("page") != null) {
                   page = new Integer(request.getParameter("page")).intValue();
              int articlesPerPage = conf.getArticlesPerPage();
              int pageBoundary = conf.getPageBoundary();
                int numOfPages = totalRows / articlesPerPage;  
                // Checks if the page variable is empty (not set)
                if (page == 0 || (page > numOfPages && (totalRows % articlesPerPage) == 0 && page < numOfPages + 1)) {    
                 page = 1;  // If it is empty, we're on page 1
              // Ex: (2 * 25) - 25 = 25 <- data starts at 25
             int startRow = page * articlesPerPage - (articlesPerPage);
             int endRow = startRow + (articlesPerPage);           
             // Set array of page numbers.
             int minDisplayPage = page - pageBoundary;
             if (minDisplayPage < 1) {
                  minDisplayPage = 1;     
             int maxDisplayPage = page + pageBoundary;
             if (maxDisplayPage > numOfPages) {
                  maxDisplayPage = numOfPages;     
             int arraySize = (maxDisplayPage - minDisplayPage) + 1;
             // Check if there is a remainder page (partially filled page).
             if ((totalRows % articlesPerPage) != 0) arraySize++;
             // Set array to correct size.
             int[] pages = new int[arraySize];
             // Fill the array.
             for (int i = 1; i <= pages.length; i++) {
                  pages[i - 1] = i;
             // Set pageNext and pagePrev variables.
             if (page != 1) {
                  int pagePrev = page - 1;
                  request.setAttribute("pagePrev", pagePrev);
             if ((totalRows - (articlesPerPage * page)) > 0) {
                 int pageNext = page + 1;
                 request.setAttribute("pageNext", pageNext);
             // These will be used by calling code for SQL query.
             request.setAttribute("startRow", startRow);
             request.setAttribute("endRow", endRow);
             // These will be used in JSP page.
             request.setAttribute("totalRows", totalRows);
             request.setAttribute("numOfPages", numOfPages);
             request.setAttribute("page", page);
             request.setAttribute("pages", pages);          
    }I need two parameters from this method (startrow and endrow) so I can perform my SQL queries. Since this is a multithreaded app, I do not want to use class variables that I will later retrieve through methods.
    So my solution was to just set the two parameters in the request and grab them later with the calling code like this:
    // Set pagination
    Pagination.setPagination(request, conf, tl.getTotalRows());
    // Grab variables set into request by static method
    int startRow = new Integer(request.getAttribute("startRow").toString());
    int endRow = new Integer(request.getAttribute("endRow").toString());
    // Use startRow and endRow for SQL query below...Does anyone see any problem with this from a resource/performance standpoint? Any idea on what the overhead is in using the HttpServletRequest object like this to pass variables around?
    Thanks for any thoughts.

    You could either
    - create instance vars in both controllers and set them accordingly to point to the same object (from the App Delegate) OR
    - create an instance variable on the App Delegate and access it from within the view controllers
    Hope this helps!

  • To get the Workflow status using the Object Key

    Hi Experts,
    Do we have any transaction code or a Standard table where I can see the status of the Workflow using the Object Key.
    For example I have an Invoice Document number for which a Workflow has been triggered and now I want to see the which workflow has been triggered and what is the status for the same. I have only the Invoice Document Number.
    I think I can use the SWI1, SWEL etc but I don't have Object key as Input field.
    Thanks in advance.
    Regards,
    SRinivas

    Hi,
    You can find the workitem id in table SWW_WI2OBJ.
    Here you need to pass the invoice number in "Instacne ID" with leading zeros, business object in Object type.
    This may take little bit longer time.
    After getting the workitem number then look into table SWWWIHEAD for the workitem status.
    Thanks and regards,
    SNJY

  • Get Visitor IP Address - Using ADDT

    Hi All,
    Does anyone know how to use the ADDT function to get a visitors IP address when submitting a form on your site?
    For example each time someone logs in to a member / restricted area using login details "Providing the history tab is used" it stores the IP address of the member / visitor to the history table.
    I need to simple get the users IP address when they submit a form when they are not a member or logged in the to members area.
    Please help
    Cheers,
    Joe
    Gunter if you answer this... Thank you in advance and I owe you more beer. LOL

    Hi Joe,
    fortunately it´s not rocket science -- $_SERVER["REMOTE_ADDR"] is how PHP will retrieve the visitor´s IP address, and once you assign this variable to e.g. a custom Session Variable, it´s easy to store the corresponding value in a database table.
    Cheers,
    Günter

  • Can I get the IP address used by other devices for Sync?

    One of my devices was stolen. I wanted to know if I could find it by using information synced. I'm hoping there is some way to determine the IP address, and then to contact the owner of that IP block to see if they can help me further. Is this at all possible, and if so, what steps must I take? Thank you.

    [[Disable Firefox Sync on a lost phone or tablet|Disable Firefox Sync on a lost phone or tablet]]

  • Project server workflow 2013 using client object model

    hi sir ,
    suggest me how to create workflow project server 2013 using csom model
    vijay

    Hi Vijay,
    The CSOM supports submitting status updates, but currently does not support status approvals.

  • Is it possible to find the client OS by using Request Object?

    how to know the Client OS(Operating System)by using HttpServletRequest object can anybody help me on this?

    Get the headers and look for the user-agent. Usually you can find out the browers and os using this header value.

  • Get Hardware (Mac) Address through Applescript

    Hi All,
    How can I get Hardware (Mac) Address using applescript. Please tell me how can I do it. I have searched in the dictionary but I found nothing there.
    Why I need it, I have developed some tool for InDesign & Quark User. I want to add the mentioned module in my application, so that as user will run the tool it will first validate the Hardware address, and if it match then application will run otherwise it will show a piracy message.
    Thanks
    Rajeev

    >get if addr en0 failed, (os/kern) failure
    Then you don't have an active interface. You can't use ipconfig to query an interface that isn't up.
    You need to decide how you want to deal with this - you won't know in advance what interfaces the user may have active. For this reason, relying on the MAC address is inherently problematic. You might be better off using the system's serial number (which is less likely to change anyway):
    <pre class=command>set serialNum to do shell script "system_profiler SPHardwareDataType| awk -F: '/Serial/ {print $2}'"</pre>

  • How do I get the client IP Address from the HTTPServletRequest object

    Hi ppl,
    How do I get the IP address of the client machine from the HTTPServletRequest object?
    Thnx in advance,
    Manoj

    Take a look at: http://java.sun.com/products/servlet/2.2/javadoc/index.html and check for the ServletRequest Interface.
    Be aware also if your web server is using proxy, proxyReverse and so because you could end getting the servers' IP and not client one.

  • Getting error while importing metadata using View Objects

    Hi All,
    I am trying to create a repository using View Object in OBIEE 11.1.5.1 but getting error while viewing the data, after importing the metadata in the repository "[nQSError: 77031] Error occurs while calling remote service ADFService11G. Details: Runtime error for service -- ADFService11G - oracle/apps/fnd/applcore/common/ApplSession".
    I am also getting error "žADFException-2015: The BI Server is incompatible with the BI-ADF Broker Servlet: BI Server protocol version = null, BI-ADF Broker Servlet protocol version = 1" during testing my sample which is deployed to Admin server. I followed BI Adminstrator help file guide in order to create the sample for creating repository using view object.
    Admin server log says
    [2011-09-27T02:59:03.646-05:00] [AdminServer] [NOTIFICATION] [] [oracle.bi.integration.adf] [tid: [ACTIVE].ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: <anonymous>] [ecid: b260b57746aa92d3:-1f9ca26:1328fcfd3e6:-8000-0000000000006744,0] [APP: BIEEOrders] [[
    QUERY:
    <?xml version="1.0" encoding="UTF-8" ?><ADFQuery><Parameters></Parameters><Projection><Attribute><Name><![CDATA[Deptno]]></Name><ViewObject><![CDATA[AppModule.DeptViewObj1]]></ViewObject></Attribute><Attribute><Name><![CDATA[Dname]]></Name><ViewObject><![CDATA[AppModule.DeptViewObj1]]></ViewObject></Attribute><Attribute><Name><![CDATA[Loc]]></Name><ViewObject><![CDATA[AppModule.DeptViewObj1]]></ViewObject></Attribute></Projection><JoinSpec><ViewObject><Name><![CDATA[AppModule.DeptViewObj1]]></Name></ViewObject></JoinSpec></ADFQuery>
    [2011-09-27T02:59:04.199-05:00] [AdminServer] [ERROR] [] [oracle.bi.integration.adf.v11g.obieebroker] [tid: [ACTIVE].ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: <anonymous>] [ecid: b260b57746aa92d3:-1f9ca26:1328fcfd3e6:-8000-0000000000006744,0] [APP: BIEEOrders] java.lang.NoClassDefFoundError: oracle/apps/fnd/applcore/common/ApplSession[[
         at oracle.bi.integration.adf.ADFDataQuery.makeQueryBuilder(ADFDataQuery.java:81)
         at oracle.bi.integration.adf.ADFDataQuery.<init>(ADFDataQuery.java:70)
         at oracle.bi.integration.adf.ADFReadQuery.<init>(ADFReadQuery.java:15)
         at oracle.bi.integration.adf.ADFService.makeADFQuery(ADFService.java:227)
         at oracle.bi.integration.adf.ADFService.execute(ADFService.java:136)
         at oracle.bi.integration.adf.v11g.obieebroker.ADFServiceExecutor.execute(ADFServiceExecutor.java:185)
         at oracle.bi.integration.adf.v11g.obieebroker.OBIEEBroker.doGet(OBIEEBroker.java:89)
         at oracle.bi.integration.adf.v11g.obieebroker.OBIEEBroker.doPost(OBIEEBroker.java:106)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.share.http.ServletADFFilter.doFilter(ServletADFFilter.java:62)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
         at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
         at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:136)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Caused by: java.lang.ClassNotFoundException: oracle.apps.fnd.applcore.common.ApplSession
         at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:297)
         at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:270)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:305)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:246)
         at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:179)
         ... 38 more
    Please suggest how to make it work.

    Hi,
    Thanks for providing the online help URL, i have already completed the steps mentioned in URL
    I am able to import metadata using view object but getting above error("[nQSError: 77031] Error occurs while calling remote service ADFService11G. Details: Runtime error for service -- ADFService11G - oracle/apps/fnd/applcore/common/ApplSession".") while validating the data.
    It fails at step 5 of "To import metadata from an ADF Business Component data source:" section of above URL.

  • How to get the HttpServletRequest object in a jsp

    Hi,
    I am a little confused here. Am trying to use the HttpServletRequest object in my jsp. I have set up just a simple test page jsp. How can i use the HttpServletRequest object to get some information about the request for example using the method getPathInfo(). I know i can do this in a servlet and pass the value as a parameter in a doGet method. But how do i do it in a jsp. Can it be done..?
    Pls help
    Thankyou

    The request object is already created for you in JSP, as are many other things
    request - the HttpServletRequest object
    response - the HttpServletResponse object
    session - the HttpSession object
    application - the ServletContext object
    out - the JspWriter object (like PrintWriter)
    So you just use them...
    <%
    String asdf = request.getParameter("asdf");
    %>

  • Unable to get the SharePoint 2013 List names using Client object model for the input URL

    Please can you help with this issue.
    We are not able to get the SharePoint 2013 List names using Client object model for the input URL.
    What we need is to use default credentials to authenticate user to get only those list which he has access to.
    clientContext.Credentials = Net.CredentialCache.DefaultCredentials
    But in this case we are getting error saying ‘The remote server returned an error: (401) Unauthorized.’
    Instead of passing Default Credentials, if we pass the User credentials using:
    clientContext.Credentials = New Net.NetworkCredential("Administrator", "password", "contoso")
    It authenticates the user and works fine. Since we are developing a web part, it would not be possible to pass the user credentials. Also, the sample source code works perfectly fine on the SharePoint 2010 environment. We need to get the same functionality
    working for SharePoint 2013.
    We are also facing the same issue while authenticating PSI(Project Server Interface) Web services for Project Server 2013.
    Can you please let us know how we can overcome the above issue? Please let us know if you need any further information from our end on the same.
    Sample code is here: http://www.projectsolution.com/Data/Support/MS/SharePointTestApplication.zip
    Regards, PJ Mistry (Email: [email protected] | Web: http://www.projectsolution.co.uk | Blog: EPMGuy.com)

    Hi Mistry,
    I sure that CSOM will authenticate without passing the
    "clientContext.Credentials = Net.CredentialCache.DefaultCredentials" by default. It will take the current login user credentials by default. For more details about the CSOM operations refer the below link.
    http://msdn.microsoft.com/en-us/library/office/fp179912.aspx
    -- Vadivelu B Life with SharePoint

  • I can't seem to get individual elements when comparing 2 arrays using Compare-Object

    My backup software keeps track of servers with issues using a 30 day rolling log, which it emails to me once a week in CSV format. What I want to do is create a master list of servers, then compare that master list against the new weekly lists to identify
    servers that are not in the master list, and vice versa. That way I know what servers are new problem and which ones are pre-existing and which ones dropped off the master list. At the bottom is the entire code for the project. I know it's a bit much
    but I want to provide all the information, hopefully making it easier for you to help me :)
    Right now the part I am working on is in the Compare-NewAgainstMaster function, beginning on line 93. After putting one more (fake) server in the master file, the output I get looks like this
    Total entries (arrMasterServers): 245
    Total entries (arrNewServers): 244
    Comparing new against master
    There are 1 differences.
    InputObject SideIndicator
    @{Agent= Virtual Server in vCenterServer; Backupse... <=
    What I am trying to get is just the name of the server, which should be $arrDifferent[0] or possibly $arrDifferent.Client. Once I have the name(s) of the servers that are different, then I can do stuff with that. So either I am not accessing the array
    right, building the array right, or using Compare-Object correctly.
    Thank you!
    Sample opening lines from the report
    " CommCells > myComCellServer (Reports) >"
    " myComCellServer -"
    " 30 day SLA"
    CommCell Details
    " Client"," Agent"," Instance"," Backupset"," Subclient"," Reason"," Last Job Id"," Last Job End"," Last Job Status"
    " myServerA"," vCenterServer"," VMware"," defaultBackupSet"," default"," No Job within SLA Period"," 496223"," Nov 17, 2014"," Killed"
    " myServerB"," Oracle Database"," myDataBase"," default"," default"," No Job within SLA Period"," 0"," N/A"," N/A"
    Entire script
    # things to add
    # what date was server entered in list
    # how many days has server been on list
    # add temp.status = pre-existing, new, removed from list
    # copy sla_master before making changes. Copy to archive folder, automate rolling 90 days?
    ## 20150114 Created script ##
    #declare global variables
    $global:arrNewServers = @()
    $global:arrMasterServers = @()
    $global:countNewServers = 1
    function Get-NewServers
    Param($path)
    Write-Host "Since we're skipping the 1st 6 lines, create test to check for opening lines of report from CommVault."
    write-host "If not original report, break out of script"
    Write-Host ""
    #skip 5 to include headers, 6 for no headers
    (Get-Content -path $path | Select-Object -Skip 6) | Set-Content $path
    $sourceNewServers = get-content -path $path
    $global:countNewServers = 1
    foreach ($line in $sourceNewServers)
    #declare array to hold object temporarily
    $temp = @{}
    $tempLine = $line.Split(",")
    #get and assign values
    $temp.Client = $tempLine[0].Substring(2, $tempLine[0].Length-3)
    $temp.Agent = $tempLine[1].Substring(2, $tempLine[1].Length-3)
    $temp.Backupset = $tempLine[3].Substring(2, $tempLine[3].Length-3)
    $temp.Reason = $tempLine[5].Substring(2, $tempLine[5].Length-3)
    #write temp object to array
    $global:arrNewServers += New-Object -TypeName psobject -Property $temp
    #increment counter
    $global:countNewServers ++
    Write-Host ""
    $exportYN = Read-Host "Do you want to export new servers to new master list?"
    $exportYN = $exportYN.ToUpper()
    if ($exportYN -eq "Y")
    $exportPath = Read-Host "Enter full path to export to"
    Write-Host "Exporting to $($exportPath)"
    foreach ($server in $arrNewServers)
    $newtext = $Server.Client + ", " + $Server.Agent + ", " + $Server.Backupset + ", " + $Server.Reason
    Add-Content -Path $exportPath -Value $newtext
    function Get-MasterServers
    Param($path)
    $sourceMaster = get-content -path $path
    $global:countMasterServers = 1
    foreach ($line in $sourceMaster)
    #declare array to hold object temporarily
    $temp = @{}
    $tempLine = $line.Split(",")
    #get and assign values
    $temp.Client = $tempLine[0]
    $temp.Agent = $tempLine[1]
    $temp.Backupset = $tempLine[2]
    $temp.Reason = $tempLine[3]
    #write temp object to array
    $global:arrMasterServers += New-Object -TypeName psobject -Property $temp
    #increment counter
    $global:countMasterServers ++
    function Compare-NewAgainstMaster
    Write-Host "Total entries (arrMasterServers): $($countMasterServers)"
    Write-Host "Total entries (arrNewServers): $($countNewServers)"
    Write-Host "Comparing new against master"
    #Compare-Object $arrMasterServers $arrNewServers
    $arrDifferent = @(Compare-Object $arrMasterServers $arrNewServers)
    Write-Host "There are $($arrDifferent.Count) differences."
    foreach ($item in $arrDifferent)
    $item
    ## BEGIN CODE ##
    cls
    $getMasterServersYN = Read-Host "Do you want to get master servers?"
    $getMasterServersYN = $getMasterServersYN.ToUpper()
    if ($getMasterServersYN -eq "Y")
    $filePathMaster = Read-Host "Enter full path and file name to master server list"
    $temp = Test-Path $filePathMaster
    if ($temp -eq $false)
    Read-Host "File not found ($($filePathMaster)), press any key to exit script"
    exit
    Get-MasterServers -path $filePathMaster
    $getNewServersYN = Read-Host "Do you want to get new servers?"
    $getNewServersYN = $getNewServersYN.ToUpper()
    if ($getNewServersYN -eq "Y")
    $filePathNewServers = Read-Host "Enter full path and file name to new server list"
    $temp = Test-Path $filePathNewServers
    if ($temp -eq $false)
    Read-Host "File not found ($($filePath)), press any key to exit script"
    exit
    Get-NewServers -path $filePathNewServers
    #$global:arrNewServers | format-table client, agent, backupset, reason -AutoSize
    #Write-Host ""
    #Write-Host "Total entries (arrNewServers): $($countNewServers)"
    #Write-Host ""
    #$global:arrMasterServers | format-table client, agent, backupset, reason -AutoSize
    #Write-Host ""
    #Write-Host "Total entries (arrMasterServers): $($countMasterServers)"
    #Write-Host ""
    Compare-NewAgainstMaster

    do not do this:
    $arrDifferent = @(Compare-Object $arrMasterServers $arrNewServers)
    Try this:
    $arrDifferent = Compare-Object $arrMasterServers $arrNewServers -PassThru
    ¯\_(ツ)_/¯
    This is what made the difference. I guess you don't have to declare arrDifferent as an array, it is automatically created as an array when Compare-Object runs and fills it with the results of the compare operation. I'll look at that "pass thru" option
    in a little more detail. Thank you very much!
    Yes - this is the way PowerShell works.  You do not need to write so much code once you understand what PS can and is doing.
    ¯\_(ツ)_/¯

  • How to get an mbean to create an object to be used in invoke

    The topic says it all. I am confused.
    Either way, this is what i am trying to do.
    I have two classes i have registered as mbeans and can access from a remote jvm. What i need to do is to invoke a method in one of the mbeans which takes an object of my second mbean as an argument.
    so class A is registered as MBean A and has method createB which takes class B registered as MBean B as an argument.
    A valid usage would be A.createB(B);
    eg:
    server.invoke(objectName_A, "createB", new Object[] {objB}, new String[] {"com.x.y.z.B"});
    I am trying to create objB using the MBean B. Is this possible?
    Please do let me know.
    Regards
    MCR
    Message was edited by:
    MCR

    Rodnebb wrote:
    I've now made a program, it's about to be shipped to the customer and all's finished and well.
    Now all I have to do is to archive the sourcecode for future reference.
    I am however worried that I won't get hold of all the relevant vi's that I've used. Some have come from NI's examples while others from the OpenG package etc. These vi's then use other sub vi's, and are located in the NI directory structure (under Program Files).
    Is there an automated way of collecting all subcode and putting it in one folder, so that I can be sure I will always have it?
    Thx
    Hi,
    VI Package Manager 1.1 Professional solves the problem for the OpenG packages and other libraries installed using VIPM (VI Package Manager).  VIPM can scan your project and identify which OpenG packages your project is using and save the packages into a VIPC (VI Package Configuration) file, which you can save in your project folder.  When you are ready to start working on your project again, you can apply your VIPC file to have VIPM install all the required packages.
    I have written a blog post, here, about the new configuration management capabilities in VIPM 1.1 Professional.  I hope this helps.
    Thanks,
    -Jim Kring

Maybe you are looking for

  • Can i use my iphone 5 charger for the ipad air

    Can I use my iphone 5 charger for the ipad air?

  • BT Billing issue:

    Hope this makes sense it all started back in December 2012 we had a fault on our socket,the engineer came out changed the faceplate he had changed it. month later i noticed on the bill there was a £99 pound charge to say it was our faults i agreed to

  • Windows 8 Adobe Reader will not fully open a pdf compiled with several pdf's into one - why?

    Windows 8 Adobe Reader will not fully open a pdf compiled with several pdf's into one - why?

  • IWeb is driving me nuts! HELP!

    I have been using IWeb for awhile. Now, all of the sudden everytime I go to publish a new page, it republished ALL of my pages and takes forever. Plus, sometimes the formatting is messed up on the actual site. Lastly, sometimes some of the pages don'

  • Wave distortion filter not working in cs5

    Really getting frustrated with this.  I've never had any problems with any previous versions of photoshop or with any filters working before.  I recently got photoshop cs5 extended and have been trying to do alot with 3D effects and texts, but for so