Windows Server 2012 Core + Startup programs - startup

Im new to windows server and I have some batch files I want to be run automatically on startup.
I have tried putting the scripts in the "%appdata%\Roaming\Microsoft\Windows\Start Menu\Programs\Startup" folder but that only works when the "GUI" is enabled.
NOTE: The server is running in core mode
Can someone please help me with this as it is doing my head in!
Thanks

Have you tried editing the local policies on that server (gpedit.msc), and add what you need to:
Computer Configuration > Windows Settings > Scripts

Related

Visual Studio 2017 - Giving remote users access to website in IIS Express

Been looking through and trying all guides i found on this topic but no luck. I am running and MVC project with HTTPS and want to access the debug site with some remote mobile devices to test out the website. I followed a guide that almost work and i think I am pretty close to getting it to work. Here are the steps I have done:
Turn off Firewall
Open projectfolder of website go to \vs\config\ and open applicationhost.config
Find your site and line that contains your mapped port like this:
-edit it to get this result:
Tried to run Visual Studio as Admin at this point, Got regular error 400: Bad Request - Invalid Hostname when trying to access site from other computer
Opened CMD as Admin and ran the following command:
netsh http add urlacl url=http://*:44363/ user=everyone
- URL reservation successfully added
-Tried to start Visual studio as admin and non admin. Gets the following error message
"Unable to launch the IIS Express Web Server.
Failed to reister URL "https://localhost:44363" for site "x" Application. Error description: Cannot create file when that file already exists"
-I then have to run cmd again and remove the url with the command:
netsh http delete urlacl url=http://*:44363/
How do i get this to work with Visual Studio 2017 ? I cant be many steps from getting it to work. I have read many guides but none of them works
Amazing how such a simple common need can be so painful to fulfill out of the box in 2017!
Anyway https://github.com/icflorescu/iisexpress-proxy worked nicely for me.
Install it with node:
npm install -g iisexpress-proxy
Then its just something like:
iisexpress-proxy 51123 to 3000
Under 2 mins to get running.
Let me share my experience with Visual Studio and IIS Express that should help you. I am not using HTTPS and my project type is Web site with WCF but you should be able to accomplish your goal.
Here are prerequisites:
IIS Express installed
Visual Studio installed
Added url reservation for public port (netsh http add url=http://*:50001/ User=Everyone) from elevated command prompt.
Added firewall inbound rule for 50001 TCP port (Control Panel-->Windows Firewall-->Advances Settings-->Inbound Rules-->New Rule...)
Now let us setup a project in VS. I am using one of predefined templates with C#. Compile it and try to run it from VS. At that moment VS is starting developer instance of IISExpress that helps your site to run.
You should be able to see IIS Express icon in Notification area. With right click you will see that your site is running and a port (we will call it VSPORT) that is assigned by VS. This port must be different than reserved port (50001).
If you managed to accomplish this without problems then you have almost everything ready for running your site without VS.
Go to your project folder
Go to .vs folder
Go to config folder
Open applicationhost.config
Locate sites/your_site section
Copy everything between your_site and /your_site
Now we need to add this info in "global" IIS Express config.
Go to IIS Express folder (something like c:\Users\USERNAME\Documents\IISExpress)
Go to config folder
Open applicationhost.config
Locate sites section.
Paste information about your site.
Change binding from
binding protocol="http" bindingInformation="*:VSPORT:localhost"
to
binding protocol="http" bindingInformation=":50001:"
Save changes
With this change you may start IISExpress.exe directly and you can continue to use VS to work on you project at the same time.
If you want to access it from other computers do it as http://YOURIP:50001/.
Do have in mind that you need to ensure that your javascript code is NOT using address and port number directly.
You can solve the problem by downloading the 'conveyor' library from extensions and update in Visual Studio.
You can access it from other devices.
Open Visual Studio
Tools > Extensions and Updates
Online > Visual Studio Marketplace
Search 'Conveyor'
Download and install this extension
When you launch the API, you can access it from other devices. This plugin creates a link from your own ip address.
Example:
https://youripadress:5000/api/values

How do I set the URL from localhost to localhost/applicationOne in Visual Studio?

I have a web application that at the moment is running on http://localhost if I use Visual Studio to run the solution.
I would like to change the settings so that VS starts running it on http://localhost/applicationOne as the starting point.
I want to replicate an issue that seems to be happening only if the web application is deployed to a directory that is not of the root directory in an IIS server.
How do I go about doing this?
You can edit the properties of the project, and set the Project Url.
If using Local IIS
Note: this will require Visual Studio to be run as an Administrator. Behind the scenes, a virtual directory will be created in IIS, and launching the project (e.g. via debugging with F5) will launch the browser, using the Url specified here.
If using IIS Express
Effectively the same settings apply with IIS Express. Note the port number in the Url.

MobileFirst Server 7.0.0 as service on Windows Server 2012 not recognizing runtime environments

We are encountering a problem running the MobileFirst Enterprise Server on Windows Server 2012 R2. When we start using a batch file as Administrator, as long as we stay remote connected the server is working OK, we see the Runtime Environments. But when we log out, server is unreachable. We created a Windows Service that starts the server with same command:
*sc create WASLibertyV85 binPath= "C:\Program Files\IBM\WebSphere\Liberty\bin\server.bat start worklight" DisplayName="IBM WebSphere Liberty V8.5 Worklight" start=auto*
But the Runtime is not displayed, we only see:
No runtime environment deployed in this server.
Is there a way to enable MobileFirst Server seeing the Runtime Environments when was started as service?
Here's our complete solution:
1. Start CMD as administrator and run this:
sc create WASLibertyV85 binPath= "C:\Program Files\IBM\WebSphere\Liberty\bin\server.bat start worklight" DisplayName="IBM WebSphere Liberty V8.5 Worklight" start=delayed-auto
2. under Services.msc open the properties of the „IBM WebSphere Liberty V8.5 Worklight“ service and set this (if not already):
Tab GENERAL -> Startup type: Automatic (Delayed Start)
Tab LOG ON -> Log on as: Local System account + Allow service to interact with desktop
++ When the server restarts, it can take up to 2 minutes, until the runtimes are displayed in the Worklight Console!++
MFP is not being run as a service. MFP is simply a web app (a .war file, a .jar file and some artifacts) running on-top of WebSphere Liberty, in your case. So all of this is related only to Liberty and not to MFP.
As long as the Liberty instance is launched correctly, it should handle everything on its own, including the web apps that are deployed to it, MFP being one of them.
You could perhaps follow the instructions provided in this forum topic explaining how to use Apache Commons Daemon to run Liberty as a Windows service. There are other tools that can do this as well.
The problem was cause by starting the service with a log on account set as current windows user. When we've chaged to Local System Account and enabled Allow system to interact with desktop, the Runtime became visible on MobileFirst Server.

MSDeploy WMSVC is not working in .net environment

I have a build/test server which is currently running Jenkins for my continuous integration and it also is acting as my test server where code will be deployed to once built (i hope to rectify this and seperate these at a later date when budget allows)
I have a .NET web solution (nothing complex just Umbraco essentially) that i have in SVN and Jenkins is now building correctly. I now want to deploy it onto the same server using MSDeploy. After the build completes the package is generated but the deploy fails with the error
ERROR_DESTINATION_NOT_REACHABLE: Web deployment task failed. (Could not connect to the remote computer ("xxxxx.xxxxxxx.xxx.xxxx"). On the remote computer, make sure that Web Deploy is installed and that the required process ("Web Management Service") is started
Here is my msbuild parameters that Jenkins uses
/P:Configuration=Release
/P:DeployOnBuild=True
/P:MSDeployPublishMethod=WMSVC
/P:DeployTarget=MSDeployPublish
/P:PublishProfile=GetSomePixels
/P:MsDeployServiceUrl=https://build.########
/P:AllowUntrustedCertificate=True
/P:CreatePackageOnPublish=True
/P:UserName=#######
/P:Password=########
I've checked the server and the Web Management Service is running and is starting up manually
I've also gone into IIS 8 manager (server 2012) and checked the "Allow Remote Connections" box under "Management Service". Restarted IIS and the WMSVC and still not working.
If i go to https://myserver.co.uk:8172/MsDeploy.axd in a browser it resolves (gives you the warning about an untrusted cert) and then displays a blank page.
Anyone got any ideas as to what i can do? I thought that it may be firewall related and even though it had added an exception to windows firewall for 8172 i have turned the entire firewall off to completely rulle that out and still no luck.
Have run this on the server to check its listening on the correct port
C:\Users\Administrator>netstat -a | findstr 8172
TCP 0.0.0.0:8172 GSP-BUILD:0 LISTENING
TCP [::]:8172 GSP-BUILD:0 LISTENING
Ok i've resolved this. It appears you have to activate the web management service first and then install web deploy and i'd done it the other way round. I uninstalled WebDeploy and re-installed it, restarted the server and its working
Agree with comment.
We had a similar issue. Initial installation even post Web Management Service activation appeared to be incomplete. In our case, even though the service said it was started we couldn't achieve the "green tick" when testing the connection from the Publish dialog when defining a profile.
Reinstalling WebDeploy 3.6 made it function properly.

Use IIS as local web server to debug in my visual studio

I've an asp.net MVC website which use somme DLL that work only in 32 bits or only in 64 bits(sql lite).
Since our server are running in 64 bits, I would like to run all my code in 64 bits. The problem is that the Visual studio development server is running in 32 bits in all case.
So I come to use a Local IIS Web server.
The problem is that with an asp.net MVC website, it's mandatory to have the website at the root of the URL.
So I wish to have something like "mywebsite.lo"(with a entry in my hosts file) or "localhost:9999" as project url.
But if I try to put this, when I create the virtual directory, I got this error:
Unable to create the virtual directory. Could not find the server 'mywebsite.lo' on the local machine. Creating a virtual directory is only supported on the local IIS server.
So I created myself the website with the correct binding responding to 'mywebsite.lo'. Now if I click on Create Virtual Directory, I got a successfull message. If But when I run the website, I got a message saying : Unable to start debugging on the web server. The web server is not configured correctly. See help for common configuration errors. Running the web page outside of the debugger may provide further information.
In order to debug in visual studio with a local IIS, then Visual Studio must be running as an administrator, are you doing that?
I made a dummy mistake: The application pool was in .Net 2.x :/

Resources