Guest User

ITProConNYC2016-WinTrack-NanoServer-4

a guest
Mar 29th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ####
  2. # Package the source files into an appx
  3.  
  4. # makeappx.exe pack /d .\MCServer /p .\MCServer.appx
  5.  
  6. ####
  7. # Create self signed certificate to sign AppX
  8.  
  9. # makecert.exe /n "CN=ITProConNY, O=ITProConNY, L=NewYorkCity, S=NY, C=USA" /r /h 0
  10. #/eku "1.3.6.1.5.5.7.3.3,1.3.6.1.4.1.311.10.3.13" /e 03/25/2017 /sv .\ITProConNY.pvk .\ITProConNY.cer
  11.  
  12.  
  13. ####
  14. # copy private/public key into a PFX file used to sign appx
  15.  
  16. # pvk2pfx.exe /pvk .\ITProConNY.pvk /pi P@ssw0rd /spc .\ITProConNY.cer /pfx .\ITProConNY.pfx /po P@ssw0rd
  17.  
  18.  
  19. ####
  20. # sign appx with pfx file
  21.  
  22. # signtool.exe sign /fd SHA256 /a /f .\ITProConNY.pfx /p P@ssw0rd .\MCServer.appx
  23.  
  24.  
  25. ####
  26. # Copy working files locally
  27.  
  28. Copy-Item "C:\Users\dsebban\OneDrive\Scripts\ITProConNY2016\Demos\Demo4\" Z:\ -Recurse
  29.  
  30. Enter-PSSession -VMName NanoLab-Nano1 -Credential NANO\dsebban
  31.  
  32. ####
  33. # add certificate used to sign AppX to trusted sources
  34.  
  35. certoc -addstore TrustedPeople C:\ITProConNY.cer
  36.  
  37. ####
  38. # add AppX pacakage
  39.  
  40. Get-Service MCServerService
  41. Add-AppxPackage C:\MCServer.appx
  42. Get-AppxPackage
  43. Get-Service MCServerService
  44.  
  45. ####
  46. # remove AppX package
  47.  
  48. Get-AppxPackage | Remove-AppxPackage
  49. Get-Service MCServerService
  50.  
  51. ####
  52. # Copy binaries locally
  53.  
  54. netsh advfirewall firewall add rule name="JavaW-In" dir=in program="c:\Demo4\MCServer\jre\bin\javaw.exe" action=allow enable=yes
  55. netsh advfirewall firewall add rule name="JavaW-Out" dir=out program="c:\Demo4\MCServer\jre\bin\javaw.exe" action=allow enable=yes
  56.  
  57. cd c:\Demo4\MCServer
  58. c:\Demo4\MCServer\jre\bin\javaw.exe -jar c:\Demo4\MCServer\minecraft_server.1.9.jar nogui
Add Comment
Please, Sign In to add comment