Fetch websites hosted on Remote IIS server using C#

Hi,
I want to get all the websites that are hosted on a remote server. I have the Server IP, username and password of the remote server and I need to retrieve all the sites that are hosted on the server. How can I achieve this in C# ?
Regards,
Pradeep R

The easy way is to use WMI to talk with IIS.  Alternatively you can use the IIS API but WMI is easier.  Refer to MSDN for documentation on the IIS WMI Provider.
Here's some starter
code in VBScript.  Here's the equivalent via WMI Code Creator.
using System;
using System.Management;
using System.Windows.Forms;
namespace WMISample
public class MyWMIQuery
public static void Main()
try
ManagementObjectSearcher searcher =
new ManagementObjectSearcher("root\\WebAdministration",
"SELECT * FROM Site");
foreach (ManagementObject queryObj in searcher.Get())
Console.WriteLine("-----------------------------------");
Console.WriteLine("Site instance");
Console.WriteLine("-----------------------------------");
Console.WriteLine("Name: {0}", queryObj["Name"]);
catch (ManagementException e)
MessageBox.Show("An error occurred while querying for WMI data: " + e.Message);
Note that WMI must be turned on for the IIS server and the user needs appropriate rights.
Michael Taylor
http://blogs.msmvps.com/p3net

Similar Messages

  • Unable to connect to the remote ftp server using dreamweaver.

    For the last one week I have been trying to connect to the remote ftp server using dreamweaver. I spoke to the technical support agency who manage our remote server but they are saying that there is no problem with the server adn they dont know anythign about dreamweaver so cant assist me.
    I was suggested to check with adobe team directly and i spoke to a technical support person on the live chat but they said since the version is CS4 - education version, they cant assist me at all!! This is just ridiculous...I am constantly being sent from one place to the other without anything getting resolved!!
    Please help somebody!!

    I am having a similar problem... maybe.  I was connected to my remote site all day yesterday, then out of the blue I tried to "put" an edited file... as I had been doing all day, and I received an FTP error:  Cannot make connection to host. Your login or password is incorrect.  That's odd, I've been connecting all day.  So I went into my sites > manage sites and clicked the Test button on my remote server information and it returned Adboe Dreamweaver CS connected to your webserver successfully.  I went back to my file and tried once more to "put" it on the remote server... again FTP Error: cannot make connect to host...  So I reboot my computer and start Dreamweaver CS3 again.  I reenter my remoter server information and click the Test button.  "... connect to your webserver successfully".  I try to put any file, FTP error again.  So I call my server administrator, he checks the servers logs and says there are no errors and you've connected successfully several times today.  I went through the trouble shooting steps listed here, though my FTP Logs are empty.  I cannot stay connected or even see the remote folders to try to drag and drop.  I tried to run ftp from a windows command prompt and it seems to connect me.
    I downloaded an installed an SFTP client and was able to successfully connect to my remote server and upload the files.  It's definately a Dreamweaver problem.  Any suggestions?

  • Invoking remote IIS server from java

    Hi,
    May I know how to invoke the remote IIS server from java?
    Basically I am designing the administrative tool to start and stop IIS server which is running remote machine.
    Thanks!

    You will need to connect to the remote system using some service other than IIS, since starting IIS is one of your requirements. The usual is to connect using Telnet or SSH. I posted code to connect to a Unix box using Telnet. You could use this to connect to a Windows system that was running a Telnet server.

  • Upload a jar file in remote Weblogic server using wlst

    Is there a way to upload a jar file to a specific location on remote weblogic server using wlst? This is my scenario - I need to upload aspectjweaver.jar to the remote server. This needs to be done before weblogic startup, as weaving takes place during startup . FTP is not an option because those ports are blocked

    Hi,
    You don't have such option through upload files as what FTP do but you can deploy the application through wlst.
    eg:
    deploy('Web14','C:/TEMP/Web14.war',targets='Cluster1',stageMode='stage',upload='true',remote='true')
    Or you can use Deploy option to deploy app directly.
    eg:
    java weblogic.Deployer -adminurl http://localhost:7001
    -username weblogic -password weblogic
    -deploy ./myapp.ear -id myDeployment
    This will upload file and place the file there from there you can manipulate the file.
    Hope this will work for you.
    Regards,
    Kal

  • Deploy An Orchestration Exposed Service in Remote IIS Server

    Hello Experts, I have developed a Biztalk Application and Exposed the Orchestration as WCF Service. It is working fine in my Local System. But Now i would like to Deploy this service in a remote IIS server (Intranet), where i dont have Biztalk Installed.
    Please Suggest What is the Procedure to do this.
    Thank you
    saroj

    Hi Saroj,
    You need to have BizTalk installed on the machine on which you are deploying the WCF service. As the WCF service needs some assemblies and thats the reason you have got error above.
    There is a work around , you can have look at it :
    http://msdn.microsoft.com/en-au/library/ee308809%28v=BTS.10%29.aspx
    I hope this helps!!!!!! Please mark as Helpful.
    If this answers your question, please mark it as "Answered". It will help to reduce visits to same post as its already answered and will help guys with same question as yours without even posting it .
    Maheshkumar S. Tiwari|Team lead/Consultant(EDI/EAI)|iVision Software Pvt Ltd, Pune.

  • Website hosted in particular windows server prompting continuous domain authentication

    Hi
    There are 2 domains A & B .In domain A, there are few websites hosted in 4 windows servers identical in software and hardware configurations ....mean to say in IIS Managers , all the settings are same.I am not aware of IIS technically. but all the settings
    visually are the same.
    The problem 2 days before happened the Domain B users (except 2 users)are continuously prompted for the domain authentication when they try to access this website through the URL which they always use when the URL hits one particular server out of these
    4 windows 2008 R2 servers
    The sharepoint site admin cut a ticket to Windows team with the comment : Check this BAD Windows server
    Error posted is :
    Log Name:      Security
    Source:        Microsoft-Windows-Security-Auditing
    Date:          3/14/2015 8:14:04 AM
    Event ID:      4625
    Task Category: Logon
    Level:         Information
    Keywords:      Audit Failure
    User:          N/A
    Computer:      xxxxxx
    Description:
    An account failed to log on.
    Subject:
                    Security ID:                         NULL SID
                    Account Name:                 -
                    Account Domain:                             -
                    Logon ID:                             0x0
    Logon Type:                                       3
    Account For Which Logon Failed:
                    Security ID:                         NULL SID
    Account Name:
                    Account Domain:                             xxxxxxxx
    Failure Information:
    Failure Reason:                                The user has not been granted the requested logon type at this machine.
                    Status:                                  0xc000015b
                    Sub Status:                         0x0
    Process Information:
                    Caller Process ID:             0x0
                    Caller Process Name:     -
    Network Information:
                    Workstation Name:        xxxxxxxxxxxxxxx
                    Source Network Address:            xxx.xxx.xxx.xxx
                    Source Port:                       53827
    Detailed Authentication Information:
                    Logon Process:                  NtLmSsp
                    Authentication Package:               NTLM
                    Transited Services:          -
                    Package Name (NTLM only):       -
                    Key Length:                        0
    This event is generated when a logon request fails. It is generated on the computer where access was attempted.
    The Subject fields indicate the account on the local system which requested the logon. This is most commonly a service such as the Server service, or a local process such as Winlogon.exe or
    Services.exe.
    The Logon Type field indicates the kind of logon that was requested. The most common types are 2 (interactive) and 3 (network).
    The Process Information fields indicate which account and process on the system requested the logon.
    The Network Information fields indicate where a remote logon request originated. Workstation name is not always available and may be left blank in some cases.
    The authentication information fields provide detailed information about this specific logon request.
                    - Transited services indicate which intermediate services have participated in this logon request.
                    - Package name indicates which sub-protocol was used among the NTLM protocols.
                    - Key length indicates the length of the generated session key. This will be 0 if no session key was requested.
    If the problem existed in this particular server, how those exceptional 2 users are having the access.I agree they are the sharepoint admins...
    How and where to check the investigation?
    Thanks & Regards S.Swaminathan Live & let others live!!!

    Hi,
    >>The problem 2 days before happened the Domain B users (except 2 users)are continuously prompted for the domain authentication
    Based on the description, we can check the following article to see if it's helpful.
    Troubleshooting: I Keep Getting Prompted for a User Name and Password
    https://msdn.microsoft.com/en-us/library/cc750194.aspx
    Besides, for this question, in order to get better help, we can ask for suggestions in the following two forums.
    IIS Forum
    http://forums.iis.net/
    SharePoint Forum
    https://social.technet.microsoft.com/Forums/office/en-US/home?category=sharepoint
    Best regards,
    Frank Shen
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

  • Errors when deploying application to a remote WebLogic server using Eclipse

    I'm using Eclipse with OEPE for WebLogic 10.3.5 on linux and running a weblogic server versioned the same.
    I've created a new EAR which combined several EARs that I had, and deployed it on my local server using the 'servers' tab in Eclipse. It went well.
    When I tried to deploy the EAR into my remote server, I got the exception:
    Application archive not found : myworkspace/.metadata/.plugins/org.eclipse.core.resources/.projects/MyEAR/beadep/remote_weblogic/MyEAR/split_src.ear
    This also happens when trying to deploy the EAR to a server that runs on my computer but configured as 'remote' in Eclipse. This does not happen for any other application of mine.
    Next thing I tried is to update my Eclipse OEPE and server to 12.1.1, so I've downloaded the two, installed them both as new, and now when I'm looking for remote servers in the Eclipse, instead of writing the server status (republish/synchronized) it writes:
    User: myuser, failed to be authenticated
    I'm lost. How can I deploy my application with Eclipse OEPE to a remote weblogic server?
    Edited by: wafwaf on 02:03 02/02/2012

    I'm using Eclipse with OEPE for WebLogic 10.3.5 on linux and running a weblogic server versioned the same.
    I've created a new EAR which combined several EARs that I had, and deployed it on my local server using the 'servers' tab in Eclipse. It went well.
    When I tried to deploy the EAR into my remote server, I got the exception:
    Application archive not found : myworkspace/.metadata/.plugins/org.eclipse.core.resources/.projects/MyEAR/beadep/remote_weblogic/MyEAR/split_src.ear
    This also happens when trying to deploy the EAR to a server that runs on my computer but configured as 'remote' in Eclipse. This does not happen for any other application of mine.
    Next thing I tried is to update my Eclipse OEPE and server to 12.1.1, so I've downloaded the two, installed them both as new, and now when I'm looking for remote servers in the Eclipse, instead of writing the server status (republish/synchronized) it writes:
    User: myuser, failed to be authenticated
    I'm lost. How can I deploy my application with Eclipse OEPE to a remote weblogic server?
    Edited by: wafwaf on 02:03 02/02/2012

  • Oracle raise ORA-03113 when connect to a remote oracle server using toad

    Hi there,
    when i use the tool toad connect to a remote oracle server which located in a different city,
    when i submit a query in toad,
    if the query returns many rows of data, it will raise the error ORA-03113:end-of-file on communication channel,
    however if the query returns only a few rows, i won't raise such error,
    however, when i use sqlplus connect to that remote server, it won't raise such error,
    what's the reason is, can any one tell me how to tackle this problem if using the tool toad. thanks/

    hi my oracle vsersion is:
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE 11.2.0.1.0 Production
    TNS for Linux: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    my oracle server is 2 nodes rac server,
    and i've tried two different kind version of toad v9.6 and v10.5, and both have the same problem
    once i query a table, if the result returned more than 30 rows, then it will raise that error, if query returns less than 30 rows, it's ok.
    i assume it is a problem concern with network, but i don't know why no such error raise when using sqlplus ?

  • What's a Good FREE website Hosting site that I should use to import iWeb?

    The title basically says it all. I want to make a website. back in the day i use to use GeoCities but i dint really like and i still dont like it. I just want to publish my iWeb materials not using .Mac.

    Hi Mike
    You might find that your ISP offers you a bit of web hosting as part of your package...
    As for free, I have looked around and tried a couple, but decided that there is no such thing as a free lunch! I use .Mac!
    Will
    1GHz G4, 15" PB, 1.5GB RAM, Airport Network, 4 GB iPod Mini (1G), 60GB iPod (5G)   Mac OS X (10.4.6)  
    Help others by marking solved questions as answered ( + Solved or Helpful )

  • IIS Issue:when trying to download code from AWS S3 and deploy in IIS server using Power Shell script while Windows startup Default Application pool is not started.

    Hi,
    I am trying to launch Amazon EC2 windows server 2008 R2 instance using AWS Auto Scaling feature. I have used cusmized AMI in Autoscaling Launch configuration to launch an instance.I have placed Power Shell script in AMI. 
    The responsibility of script is to download code from AWS S3 and deploy in IIS server while windows startup first time.
    When i check status, IIS is started succesfully. But default Application pool is not started.
    To resolve this issue i have written one scheduled script. It helps to start the application pool if any application pool is in stopped state.
    After this Application pool is started but i am not able to communicate with IIS server through browser.  
    Please help any one to resolve this issue.
    Thanks in advance

    Hi Vchreddy,
    For the IIS issue, we recommend you can post in IIS forum for more effective support:
    http://forums.iis.net/
    Thanks for your understanding.

  • Access websites hosted on local web server

    Hi there,
    I have a Cisco ASA 5505 in my home office which has a few PCs behind it with a linux web server running some websites. I can access the websites from outside no problem (i.e. on my iPhone using a 3G connection). However, I struggle to access the websites from within the network. The ASA gives me this error:
    6
    May 05 2013
    11:52:27
    192.168.55.61
    50420
    Failed to locate egress interface for TCP from inside:192.168.55.61/50420 to 86.*.*.*/80
    ASA runs version 9. Here is the config bit:
    object network denon-server
    host 192.168.55.200
    access-list outside_access_in extended permit tcp any object denon-server eq www
    object network denon-server
    nat (any,outside) static interface service tcp www www
    Any suggestions?

    Hi,
    I assume that you are trying to reach the LAN server with the public IP address that the ASA holds and also uses for the above Port Forward / Static PAT configuration?
    If this is the situation then I am afraid that with the current configuration that is not possible. The NAT configuration towards Internet is done between probably "inside" and "outside". So "outside" interface holds the public IP address. ASA doesnt let you connect to that "outside" IP address from behind the "inside" IP address. (Or any other interface for that matter)
    What you could try to do is configure a NAT that would enable you to use the public IP address of the server even when connecting from the "inside" of ASA.
    Try this
    object network SERVER-LOCAL
    host 192.168.55.200
    object network SERVER-PUBLIC
    host 86.x.x.x
    object network LAN
    subnet 192.168.55.0 255.255.255.0
    nat (inside,inside) source dynamic LAN interface destination static SERVER-PUBLIC SERVER-LOCAL
    Where
    SERVER-LOCAL = Is the "object" that defines the real IP address of the server
    SERVER-PUBLIC = Is the "object" that defines the public IP address of the server (that ASA holds on its "outside")
    LAN = Is the "object" that defines the subnet from where LAN users connect to the server public IP address
    Check that the network mask is correct for the LAN and fill in the public IP address.
    The actual NAT configuration tells the ASA this
    When a connection from LAN is coming towards SERVER-PUBLIC then UN-NAT SERVER-PUBLIC to SERVER-LOCAL and NAT LAN to "inside" interface IP address (as defined by the parameter "interface" in the configuration)
    This should enable the LAN hosts to use the public IP address to connect to the server. The server though will see the connections coming from the ASA "inside" interface IP address.
    Hope this helps
    Please remember to mark a correct reply as the correct answer if it did answer. And/or rate helpfull answers
    Ask more if needed.
    - Jouni

  • How uninstall WSUS server role from Windows Server 2008 R2 with database hosted on remote SQL server?

    Hello, 
    I'm looking to uninstall the WSUS server role 3.0 from Windows Server 2008 R2 SP1. The thing is the database is hosted on a remote MS SQL server. I want to remove the database as well. I would like help for figuring out what I need to do to completely remove
    WSUS and its database.
    Any kind of help is appreciated! Thanks  

    Hi,
    WSUS offers limited support for running database software on a computer that is separate from the computer where the rest of WSUS is installed. This section offers step-by-step
    instructions for how to install WSUS in this configuration.
    If you meet the uninstall issue with the normal uninstall, please post the detail information for us but if you just want to manage the WSUS related SQL data, you can refer
    the following KB then delete corresponding database.
    In the general procedure, you will create the related WSUS database as below::
    Run WSUS Setup from the command line, using the SQLINSTANCE_NAME=servername\instancename command-line option, where servername is the name of the remote computer, and instancename
    is the name of the SQL Server instance that you will use for WSUS.
    More information:
    Choose the Database Used for WSUS 3.0
    http://technet.microsoft.com/en-us/library/cc708452(v=ws.10).aspx
    Appendix B: Configure Remote SQL
    http://technet.microsoft.com/en-us/library/cc708595(v=ws.10).aspx
    Hope this helps.
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • How to fetch and save file in common server using FTP in SAP

    Dear All,
    My requirement is to fetch a image and save an image in a common server through SAP .
    I think there is some concept of doing the same using FTP.
    Please put some light on this issue.
    REgards,
    Amruta

    Hi,
    Below are the FM's use to FTP.
    FTP_CONNECT                    Connect to FTP server
    FTP_COMMAND                    Execute FTP Command
    FTP_DISCONNECT                 Disconnect from FTP server
    You can search SDN for more details on each of the FM's.
    Hope this helps
    Regards
    Shiva

  • Cannot connect to a remote JMX server using OC4J 10.1.3

    Hi,
    Running the following code in an EJB deployed in OC4J 10.1.3
    jmxurl = new JMXServiceURL ("service:jmx:rmi:///jndi/rmi://localhost:1060/jmxconnector");
    connector = JMXConnectorFactory.connect(jmxurl);
    gives the following exception:
    java.net.MalformedURLException: Unsupported proto : rmi
    at javax.management.remote.JMXConnectorFactory.newJMXConnector JMXConnectorFactor
    y.java:318)
    at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:246)
    at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:206
    Thanks for help.

    Even using the
    command:
    java - classpath C:\Program Files\Microsoft SQL
    Server 2005 JDBC Driver\sqljdbc_1.1\enu\sqljdbc.jar
    program_name does not work.
    As specified that wouldn't work even if everthing else did. The path has spaces so the value has to be quoted.
    >
    Any help would be greatly appreciated. Thank you for
    at least reading this thread!Connecting has nothing to do with the class path.
    Either it is finding the class or it isn't. You can't even attempt to connect until it finds the class.
    If it is finding the class then everything you posted here is pointless.

  • Steps to Connect remote Oracle Server using OCi C in Linux

    Hi !
    I am trying to connect oracle server through my application using OCI C in linux, it works fine in my oracle server machine.
    I want to connect oracle server through my C application from Oracle Client Machine
    can anyone help me in this issue ?
    regards
    Balaji.C

    Sounds like you did not specify your database name. Or you database name is hard-coded.
    Can you show us the code?
    Is your TNSNAMES.ORA set up correctly?
    Also, you did not specify any error messages or anything. Are you checking the result codes after any functions?

Maybe you are looking for

  • Badis for PO and Central Contract in SRM 7.0 in classic

    Hi everyone, I need you help. We are working in a implementation of SRM7.0 with ECC 6.0 Ehp 4 in a classic scenario. We want to know which badis we can use in order to change the purchasing group of the PO an Central Contract when their are transfere

  • Display a day of outlook calendar on ipphone

    Hi, I'm loking to display the calendar of a conference room on an ipphone. Does Somebody know how to do that ? Thanks !

  • Port Replicator III+ very high cpu when moving usb mouse only in W2k

    Tecra M2 with a port replicator III+ It's set to dual boot into XP and Win2000 (yes I know it's getting on a bit, but I've got a lot of stuff installed in win2k that is difficult to get hold of these days). XP is 100% fine, but with win 2000 if I use

  • Converting epoch time to a date

    Anyone know of a function to do this. I cant find any in the api and my searches bring up nothing.

  • Change the menubar icon of Shazam (mac)

    As you can see in the image above, the Shazam icon is in colors and bigger than the other icons, where can I change this icon? I have already tried Shazam > show package contents > Contents > Recourses. But the only two images within there are not us