How to do it...

  1. Log in to Windows Server 2016. The IP of Windows Server 2016 is 172.16.15.60 and the name of the server is WIN2016IIS. Press Windows + R on your keyboard. You will get the Run window. We have to open PowerShell ISE with administrative rights, so type in the Run command window RunAs /user:Administrator PowerShell_ISE.exe and press OK.
  2. Now it will ask you the administrator password for your Windows Server 2016 instance (not Nano Server). Type the administrator password and press Enter. You will get the PowerShell window.

 

 

  1. Now we have to remote connect to Nano Server 2016 with the IP 172.16.15.63. Run the command Enter-PSSession –ComputerName "172.16.15.63" -Credential ~Administrator.
  2. Now you will get a pop-up window for the Nano Server administrator account password. Enter the Nano Server administrator account password and press OK to log in. You have connected successfully. Now run the command Import-module iisAdministration in PowerShell and press Enter. You will get the PowerShell module imported.
  3. We are going to copy iisstart.htm and iisstart.png from C:inetpubwwwroot to v5mysite-new directory c:v5mysite-new. Run copy C:inetpubwwwrootiisstart.htm C:v5mysite-new""copy C:inetpubwwwrootiisstart.png C:v5mysite-new, as shown here:
  1. Write both the commands and run them. Now you have to check whether these files have been copied. Go to the C:v5mysite-new folder:
  1. Here, you can see that both iisstart.htm and iistart.png have been copied. Now we have to create two more HTML files for testing. Run the following command:
Welcome to IIS on Nano Server by Ashraf Khan This is Index.htm page" | Out-File -PSPath "c:v5mysite-newindex.htm" 
"Welcome to IIS on Nano Server by Ashraf Khan This is v5mysite.htm page " | Out-File -PSPath "c:v5mysite-newv5mysite.htm
  1. Run the commands one by one. Now let's check the C:v5mysite-new folder:
  1. You can see the C:v5msite-new folder has two more files created.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.122.4