Giter Club home page Giter Club logo

iis.administration's Introduction

Microsoft IIS Administration API

Requirements:

Running Tests:

  • Open the project in Visual Studio as an Administrator and launch without debugging
  • Open another instance of the project and run the tests located in the 'test' folder
  • Tests can also be run with the CLI

Installing:

  • Run PowerShell as an Administrator
  • Run the Publish.ps1 script located in the scripts directory
  • <OutputDirectory>\setup\setup.ps1 Install -verbose

Using the new API

  1. Navigate to https://manage.iis.net?api_url=localhost
  2. Click 'Get Access Token'
  3. Generate an access token and copy it to the clipboard
  4. Exit the access tokens window and return to the connection screen
  5. Paste the access token into the Access Token field of the connection screen
  6. Click 'Connect'

Updating

Running the install script will perform an in place update and will preserve user files.

Dev Setup

  1. Open the solution in VS 2015, which will automatically trigger a package restore
  2. Build the solution
  3. Run the solution (F5) so Visual Studio automatically generates required IIS Express files
  4. Using PowerShell, run the Configure-DevEnvironment.ps1 script in the scripts directory

Examples

Intialize Api Client

var apiClient = new HttpClient();
// Set access token for every request
apiClient.DefaultRequestHeaders.Add("Access-Token", "Bearer {token}");

Get Web Sites

var res = apiClient.GetAsync("https://localhost:55539/api/webserver/websites").Result;
if (res.StatusCode != HttpStatusCode.OK) {
  HandleError(res);
}
JArray sites = JObject.Parse(res.Content.ReadAsStringAsync().Result).Value<JArray>("websites");

Create a Web Site

var newSite = new {
    name = "Contoso",
    physical_path = @"C:\sites\Contoso",
    bindings = new[] {
        new {
            port = 8080,
            is_https = false,
            ip_address = "*"
        }
    }
};
var res = apiClient.PostAsJsonAsync<object>("https://localhost:55539/api/webserver/websites", newSite).Result;
if (res.StatusCode != HttpStatusCode.Created) {
    HandleError(res);
}
JObject site = JObject.Parse(res.Content.ReadAsStringAsync().Result);

iis.administration's People

Contributors

jimmyca15 avatar shirhatti avatar

Watchers

James Cloos avatar Kurt De Greeff avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.