Plugin debugging - user always needs to be logged on? - dynamics-crm

I have just set up the plugin remote debugger on my CRM server as a service and I can now connect to it and debug plugins with no problem.
My question is does the user always need to be logged onto the server in order for the service to be running and working? I set it up so that it runs as LocalSystem but when the user isn't logged in and I try to debug anything it says I cannot connect to it.
So does this mean I have to keep the user on always or is there some configuration that I've missed?

You will need to be logged in to run the remote debugger- it is designed to be set up for short term debugging and turned off after you are finished debugging.

Using the PluginTool for local debugging on your workstation is another option:
Is it possible to place an org in it's own process

Related

Windows service doesn't start until user login

I have a service that logs in as a specific user. The service works great when the user logs in, but won't start until they do so. Is there some kind of a setting I am missing?
This is running on a Windows 7 Ultimate box.
The user is an administrator of the box and the service is set to automatically start.
No errors are in the application log, and the service runs like a champ once the user logs in (without having them start it).
Does the user have privileges to start Windows Services (the user policy)? You can try using ntrights.exe to make sure that he does. Also, can you start the service from Services.msc when logged in another account?
I think this is a privileges problem. Either the service login information is incorrect or the user cannot start services.
This was a fun one, but I figured it out this morning.
The issue is that the server was a clean Windows 7 Ultimate install. That means the power management functionality was set to default which causes the machine to power down after 30 minutes, hence the service would stop running. Fixed the power management settings to never sleep and running like a champ.
Thanks for the input folks.

why run WAS as service

What are the business reasons (advantages/disadvantages) of running a websphere 6.1 App server as a windows service? I mean what are the factors governing this decision?
The other thing I notice is that when I restart the service...and I click something on the admin console, it does n't give me the login page. What is happening here?
You should give this article a read:
http://www.ibm.com/developerworks/websphere/techjournal/1010_supauth/1010_supauth.html
Can you elaborate on the restarting the service and not receiving the login page issue. I am not sure i understand your query here.
What happens when you click on the console after restarting?
HTH
Manglu
To my knowledge - the main reason for choosing to run WebSphere as a Windows Service is that whenever the server goes down for whatever reason, and then is restarted, if not running WebSphere as a service you will need to actually log on to the server and manually start WebSphere. (startServer.bat, startManager.bat, startNode.bat etc).
So for any environment where uptime is an issue on the Windows platform, choose windows service. If you are just installing a development/test environment...not needed.

How to remote debug when user accounts do not match?

How can I configure Visual Studio remote debugging when:
My developer machine is a member of an AD domain, and my username is "DevelopersName".
The "remote" machine is on the same Ethernet segment, but is not part of the domain.
The "remote" machine must run software under "RemoteUserName".
Most documentation I can find suggests that you need have both machines in the same domain and with identical usernames. That's not possible here.
I could possibly add my username to "remote", but the software still needs to run under "RemoteUserName.
If it helps, I could add 2nd network card to my developer machine and directly connect the "remote" machine.
Using VS2008, but will be moving soon to VS2010.
Thank you.
Sorry, but I've just spent the last 10 hours trying to debug your exact problem. My findings are not good.
You need to get your accounts synced, especially if you are using your remote app to connect to other systems in your SOA environment, ie: Sharepoint, AD.
You can to some extent get remote debugging to work, if you create an account on your local machine with the same name as that of your remote machine (lets do it like this rather rather than working with the domain account).
You then need to make sure the remote service is running under this account, and its a member of the administrators group. And by this I mean hold down control, and right click run as - with the remote debugger, and select the user (not required if remote server is logged in as the required user).
Run the wizard it will open the required ports, use Authentication, because non authentication won't debug managed code. Breakpoints are never met, and there is nothing you can do about this.
On your local dev machine, log off your domain account, and log onto the local account with matching name as the account on server thats running the remote service.
Now you stand a change of remote debugging. If you can't do any of the above, sorry there is no workaround, its entirely dependent on the user account and having the right permissions.
If you don't want to create a local account, try starting our debugger via command prompt using the following command:
runas /user:[user#machinename] /netonly [debugger.exe]
E.g.:
runas /user:john#mypc123 /netonly devenv.exe
I assume it's managed debugging you're talking about (for native debugging there's a remote debugging solution with no authentication). In this case, I would suggest that you use a local user to launch the debugger on your machine. If this local user's name and password match "RemoteUserName"'s name and password, it should work.
(Note that this does not preclude you from using the AD account to log in to your workstation, you just need to set up another account and use runas to launch Visual Studio.)

Debugging Topshelf service that won't run under restrictive account

I have a Windows service written using Topshelf. I'm trying to configure it to run using a Windows account with restricted privileges rather than using LocalSystem. That's also necessary as I'd like to connect to a database using integrated authentication.
The service works when run as LocalSystem (albeit with a database connection string containing credentials) and running the console application as my limited account (using runas) also works.
However, when I try to start the service the service control manager times out waiting for a response:
The service did not respond to the start or control request in a timely fashion.
I also get the following in the Application Popup event log:
Application Error : The exception unknown software exception (0xc06d007e) occurred in the application at location 0x77e4bef7.
The first thing that the application does is writes to a log file but it doesn't reach that when I start the service. The logging works if I run via the console.
Any suggestions what I might be missing or what I might try next?
This problem seems to be related to the server (a domain controller) rather than TopShelf. A service built with the .NET service component also exhibits the same behaviour.
The service runs successfully on a different machine (in the same domain).
Unfortunately this doesn't help diagnose the problem but gives me an acceptable workaround.
Check the MSDN article Debugging windows services which describes how you debug windows services.
I've just started seeing this on a few of my services written in .net 2.0. They'll start fine when the server boots, but if I were to restart them throughout the day, they would not start, and give this error message.
They currently ran under a domain account which has admin rights on the box, but for kicks, I switched it to Local System, and the service started normally. I stopped it, changed it back to the domain account (reentering the password), and it started normally again as expected.
Don't know if this counts as a 'fix' so much, but that's what worked for me.

Restarting windows service from website

I've a website that puts info into a mySQL database and a windows service (written in VB.Net) that polls the db and actions what's in there.
However, occasionally it stalls and rather than having to RDP into the server, I want superusers to click on a button to restart the service.
I can get the button to say, do a directory listing of c:\ output to a test file so the whole 'getting a command to execute on a remote server' issue works. However, I can't restart services.
I assume this is a security thing (although it has full rights to c:\ I thought I'd sussed that already).
The website runs under the normal IUSR_user so am I doing something really stupid or can someone explain how to get the service to be restarted ?
Many thanks
Adrian
I think a significantly bigger problem is that you have a service that's stalling. Do you have any logs or errors that the service outputs to that you could use to diagnose why it's stalling?
I'd write a service that restarts selected services and call that from my website, just for fun!
It seems that you need to give the user permissions on the specific service. The simplest way to do this (in my view) is to use subinacl.exe from the Windows Resource Kit.
subinacl.exe /service MySQL /Grant=IUSR_user
I'm would be very careful when doing this on a public-facing web server. Have both authentication and rate limiting on the restarting code.
Use the ServiceController class:
http://msdn.microsoft.com/en-us/library/system.serviceprocess.servicecontroller.aspx
This should allow you to connect to the named service and stop/start it.
EDIT:
In addition, you probably need to have your web app impersonate a user with rights to restart the service. This can be accomplished via an identity impersonate in the web.config, or running the web app in a configured application pool in IIS. Keep in mind that the web app will have to run on the same box as the service is running on.

Resources