Page 1 of 1

Migrating to NCPA

Posted: Sun Feb 14, 2021 1:56 pm
by BanditBBS
So all my Windows servers are running an older version of NSCLIENT+. I have tested NCPA and want to start using it. For what I need the standard install would work except for 1 small change in the cfg file(which of course requires a service restart) and 1 plugin that needs copied into the plugin folder.

For linux I can script all this and it'll be easy(many more plugins to copy too, but again, easy for me). My problem is only with the Windows, how is everyone else handling this? New servers won't be an issue as it'll just be a part of the build process for us, but I've got about 200 Windows hosts that manually I have these steps:
Install NCPA
  • Open Notepad as admin
  • make the small cfg change and save
  • Restart service
  • Copy plugin to plugin folder
Am I being stupid and not thinking of an easier method that can be scripted? These are all member servers of a domain.

Re: Migrating to NCPA

Posted: Mon Feb 15, 2021 1:35 pm
by jdunitz
Pretty much all of this can be done with powershell.

I found this example of in-place string replacement in a file like this:
(Get-Content C:\Scripts\Test.txt) |
Foreach-Object {$_ -replace "oldString", "newString"} |
Set-Content C:\Scripts\Test.txt

here:
https://superuser.com/questions/674400/ ... irectory-w


Restart-Service -name ncpalistener

Powershell could also copy/download a file for you, or generate it from scratch.

If you're not opposed to doing so, you could also install Cygwin on all of your Windows machines, and then you can do things the Unixy way.

You could also use something like Cholocatey to blast out a config-file package you put together. I can't give specific advice on how exactly this works, but I know it's possible.

There are lots of possibilities, but these are a couple that I can suggest.

--Jeffrey

Re: Migrating to NCPA

Posted: Mon Feb 15, 2021 2:05 pm
by BanditBBS
@jdunitz the powershell hint works for me. If you don't mind, don't lock this in case any other user want to reply with their methods :) Of course reply to it to knock off your support dashboard.

Thanks

Re: Migrating to NCPA

Posted: Tue Feb 16, 2021 6:13 pm
by ssax
We'll leave it open for you.

Back in my day I just scripted it out with batch files/psexec.

Pretty sure you can do it through SCCM if you have that as well.

If you don't have a config management solution such as chef/puppet/ansible/SCCM I would look into setting one up for doing bulk changes like this, they make life a lot easier for deploying/changing things in bulk.