BatchPatch Forums Home › Forums › BatchPatch Support Forum › Local Command – Powershell script not working
- This topic has 3 replies, 2 voices, and was last updated 4 years, 7 months ago by doug.
-
AuthorPosts
-
August 24, 2020 at 3:57 pm #12487dougModerator
Without being able to see the exact detail of everything that is happening, it’s hard for me to know what might be going on. If you have active support with us, you are welcomed to reach out to us directly for troubleshooting assistance. That way we would be able to view more details about what is happening. Otherwise my best suggestions are as follows:
1. You said you’re running a local command. Local commands execute on the BatchPatch computer, not on the target computer. It’s unclear to me exactly how your queue is structured, but if you are running a local command to execute the script, then I assume the script is making a remote call to the target computer. Since you’re using powershell, maybe check the powershell permissions and execution policy to make sure that what you’re doing is not being blocked.
2. Maybe just try a different method for stopping the service. For example instead of using a local command that calls a custom powershell script that makes a remote call to the target computer, maybe just try a remote command directly from BP with the following syntax, substituting the SQL service’s caption instead of ‘DNS Client’ (I don’t know what the exact SQL caption naming is off the top of my head):
WMIC SERVICE where caption='DNS Client' CALL stopservice
August 25, 2020 at 11:53 am #12488Magnus KnightParticipantThanks Doug,
I did just send a support request, in case that may help solve this issue.
Regarding suggestion #1, I would think the script isn’t being blocked from running on the target machine since when I manually tell BatchPatch to execute this job queue it works fine, and when I run the powershell script manually it works fine. It only fails this when running as part of the advanced multi-row sequence. I’m not claiming to be an expert with this, it just seems odd that it would behave that way.
I’ll look into trying method #2 that you suggested. I don’t really care how I get the service to stop, as long as I can get it stop. These servers only patch (and have a maintenance window) once per month, so unfortunately it will be a while before I can test and troubleshoot this alternative method.
August 25, 2020 at 12:37 pm #12489dougModeratorThanks. I just replied to your email. It really doesn’t make any sense to me how/why it would fail only when executed as part of the advanced sequence, but I’ll have a better sense of things after I get the requested items in the email. Let’s switch over to email from this point forward. I will come back and update this thread if/when we figure out what’s going on.
-
AuthorPosts
- You must be logged in to reply to this topic.