The Microsoft All-In-One Code Site has a new NAV code sample. This time it demonstrates using PowerShell to
The sample also includes a small bit of XML, so that you can use it to update CustomSettings.config.
With quite small amounts of code, by combining PowerShell and XML, you can control a NAV Service - either locally or remotely - without the need for Notepad, opening services, finding CustomSettings.config in Windows Explorer, etc.
You can download the sample or just browse the sample code from this link:
Download Microsoft Dynamics NAV APPLICATION: CSDynamicsPowerShellAdmin
This is sample code only. It is specifically designed not to be a full app so it has lots of scope for adding functionality. Hopefully it can be useful as a starting point or inspiration for developing own tools.
After downloading the code sample and building it in Visual Studio 2010, then running "CSDynamicsPowerShellAdmin.exe" (run it as Administrator), this is what it looks like when running it from my test machine:
And this is what it can do:
Dynamics NAV Support EMEA
On free time, I'm currently working on a winform to apply hotfixes to the various client/servers (currently we have to manually copy/paste the content of the folders). Here there are more info about it.
I think it would it be an idea to implement such a functionality in the powershelladmin!
Good idea! I could certainly use a tool like that to automate it when needing to test something with this or that build. The Powershell sample should have the answers to a few of the questions: It's retrieving a list of services, filtered on the service executable name (pathname like "%Dynamics.Nav%"), and for each service it retrieves the path to the service. So it should be possible to go the other way too. If you know the NAV Server installation folder, find the Service that is runnig from that folder, then check whether the service is running.
As for how to see whether a service is a RTC Service or a Web Service service, quote from a previous blog:
"It depends on the name. If it starts with "MicrosoftDynamicsNavWS", then it will be for Web Services. If the name starts with anything else, then it will be for middle tier for RTC clients."