- 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.
- 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.
- 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.
- 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.
- 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:
- 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:
- 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
- Run the commands one by one. Now let's check the C:v5mysite-new folder:
- You can see the C:v5msite-new folder has two more files created.