How do I use an Online Kscript to restart the NLaSvc Service?
I am trying to run an Online Kscript to restart the NLaSvc Service on several devices. I have the task set as shown in the picture below.
I think that the problem that the service has dependent services which require additional commands. I am using an administrator Profile to run this KScript. Any advice would be helpful. Thank you!
0 Comments
[ + ] Show comments
Answers (1)
Please log in to answer
Posted by:
Channeler
6 years ago
We do it via Powershell Script
see:
https://www.syspanda.com/index.php/2017/10/04/stop-start-restart-windows-services-powershell-script/
and:
https://support.quest.com/kace-systems-management-appliance/kb/138389/powershell-script-from-the-k1000
(I use method 2 here)
see:
https://www.syspanda.com/index.php/2017/10/04/stop-start-restart-windows-services-powershell-script/
and:
https://support.quest.com/kace-systems-management-appliance/kb/138389/powershell-script-from-the-k1000
(I use method 2 here)
Comments:
-
Thank you so much for your reply! Those are very helpful links, however I am a novice at Powershell and can't figure out how to have it run in administrator mode. I think that is the problem I am running into. Do you know of a parameter that will allow the Powershell to run as an administrator. I looked for it in the following link: https://technet.microsoft.com/en-us/library/ff629472.aspx
but could not find anything that would allow me to run in administrator mode. Any help here would be appreciated. Thanks again "Channeler"! - JZeigler 6 years ago-
Well, yes that code does too much things.
To put it more simple:
Get-Service -Name AdobeARMservice | Stop-Service -ErrorAction SilentlyContinue
Start-Sleep -s 20
Get-Service -Name AdobeARMservice | Start-Service -ErrorAction SilentlyContinue
This will stop the service named "AdobeARMservice"
Then wait 20 seconds
and it will start that same service again.
Change the service name, and save it as .PS1, follow method 2 on that KB article, and tell the KACE appliance to run the script with the supplied credentials. (I suggest using local admin credentials instead of domain admins, but it should work with both)
Check the Windows Run-As section of the script, to determine if it's going to run as Local System or Logged user or a specific set of credentials. - Channeler 6 years ago-
Sorry for my ignorance but how will stopping and starting the AdobeARMservice reset the NLaSvc ? - JZeigler 6 years ago
-
Change the name to match the service you need to target.
Instead of using AdobeARMservice, use NLaSvc - Channeler 6 years ago -
Get-Service -Name NLaSvc | Stop-Service -ErrorAction SilentlyContinue
Start-Sleep -s 20
Get-Service -Name NLaSvc | Start-Service -ErrorAction SilentlyContinue - Channeler 6 years ago -
Thank you so much! - JZeigler 6 years ago