Forum Replies Created
-
AuthorPosts
-
dougModerator
That’s progress, at least. Not sure why it’s failing though. What happens if you simply put the plink.exe command directly into the local command 1 *instead* of using the .bat file:
plink.exe g1vpnag01 -pw mnbJHG_7tT ./g1vplncarc02off.sh
By the way, what happened when you tested a batch file that only contained “ipconfig” without the quotes? That worked, I assume, when you used the following syntax?:
C:WindowsSystem32cmd.exe /C c:tempipconfig_test.bat
-Doug
dougModeratorWhat version of BatchPatch are you running? This is peculiar.
With regard to the “Cannot start process because a file name has not been provided” message, it should (in theory) know to execute using the shell, but for some reason it’s not doing that on your machine. I wonder if that might be due to an environment variable setting, and I wonder if a missing environment variable is also the cause for the other issue we’re experiencing. I will look into that more, but for the moment if let’s scratch the plan I suggested before to not use cmd.exe. Instead let’s use the cmd.exe command syntax:
cmd.exe /C c:tempg1vplncarc02-off.bat
Please give that a try. If it doesn’t work, please try:
C:WindowsSystem32cmd.exe /C c:tempg1vplncarc02-off.bat
Let’s see what happens now. Again please monitor the task manager and see if plink.exe appears.
Thanks,
Doug
dougModeratorJohn – A couple points…
1. A batch file (.cmd or .bat) generally should be executed with cmd.exe, not powershell.exe and not cscript.exe. In BatchPatch when you execute a .bat/.cmd via local command, just enter the path to the batch file. In theory, the powershell.exe ought to be able to run a .bat file without issues, but since you’re having problems, please try removing it as it’s not necessary and it’s slightly abnormal (cmd.exe would be more appropriate, but it’s also not necessary), and perhaps it is part of the problem. So, the syntax in your case for the local command should just be set to:
c:tempg1vplncarc02-off.bat
2. Since in your case the batch file is executing plink.exe, please open task manager and watch the processes list for plink.exe when the local command is executing. If plink.exe appears, then we’ll know that it’s being executed. If it doesn’t appear, then we’ll know it’s somehow stuck before it even executes.
I just did several tests running batch files as described above using local command, and they all worked properly. However, of course none of them execute plink.exe, so it’s possible that the problem is somehow tied to that, but realistically it *should* work just fine.
I know you said you tested a batch file containing “pause” but that’s the one thing that you should NOT test because it will “pause” indefinitely and produce exactly the behavior that we are trying to avoid. Instead, test something like “ipconfig” (without the quotes, of course) inside of the batch file. That would be a much better test and it should return the ip configuration of the machine to the Local Command Output Log column.
Keep me posted.
-Doug
dougModeratorThanks, John.
So, when you run the script manually at the command line (without BatchPatch) it (plink) doesn’t prompt for any input such as a username or password? When BatchPatch runs a local command, it should in theory be identical to running a command at the command line with just one exception, which is that it runs hidden and doesn’t allow user interaction. That said, if your script doesn’t normally prompt for any input yet BatchPatch still hangs on the local command, indefinitely, then the only other thing I can think of that might cause that is if the script requires elevation to run the plink.exe. What happens if you run the entire BatchPatch instance with elevation (right-click on the BatchPatch.exe and choose to run as administrator). Does this solve the problem? Also note, you can test the local command directly without running the job queue by simply choosing ‘Actions > Execute Local Process/Command > Execute Local Command 1’
Let me know how it goes.
-Doug
dougModeratorJohn – What are the contents of the .bat file? Can you post here? I should then be able to help you get this worked out.
Generally speaking if a local or remote command is hanging indefinitely it’s because it’s waiting for user input of some kind. However, when BatchPatch executes these commands they are hidden and cannot accept user input. I’m not sure if your script is expecting user input of some kind, but if it is then that’s where your problem is. If not, then I’m not sure what’s going on and would then like to see the actual script contents.
Thanks,
-Doug
dougModeratorHi John –
Yes you can do this using the ‘Job Queue.’
You would need to create a ‘Local Command 1’ and a ‘Local Command 2’ for a given row (or rows). Local Command 1 would execute the batch file that disables alerts for $computer, and Local Command 2 would execute the batch file that enables alerts for $computer. Note that inside the ‘Local Command’ window you are able to specify $computer as a variable to pass into your script, assuming your script is setup to receive the computer name as a parameter. When $computer is specified in a BatchPatch Local Command, BatchPatch will then substitute the computer name from the ‘Hosts’ column in place of $computer. This means that can use the same Local Command for every row instead of having to customize the command in each row with each row’s computer name.
Once you have Local Commands 1 and 2 setup for your row(s), you would then create a Job Queue for the row(s) that looks something like:
Execute Local Command 1
Download/Install Windows Updates + Reboot
Wait 10 minutes
Execute Local Command 2
I hope this helps.
Here is a video demo of the Job Queue: https://www.youtube.com/watch?v=JwxhgprfZ5Y
Here is a tutorial that uses $computer in a Local Command: Using BatchPatch to Execute a Custom Script to Retrieve the Count of CPU Sockets, Cores, and Logical Processors from Remote Computers
Note, we have a handful of improvements to the job queue coming soon, and so the process that you are setting up here will be even easier once those updates have been published. However, in the meantime you can still do what you want pretty easily.
-Doug
dougModeratorI’ve emailed you directly to troubleshoot. I’ll post an update here in the forum after we figure out what’s going on.
-Doug
dougModeratorconstahannor – In order for me to provide the best possible help, it would be great if you could provide more information. Please describe in detail exactly what you are doing in BatchPatch to produce this error. Furthermore, please provide the entire/complete error message (not just the code) that is displayed.
That said, most error codes of this kind are reported by Windows, not by BatchPatch (BatchPatch simply displays the error code that Windows generated). And when I convert this error to HEX it’s 240006. Looking up 240006 on Microsoft’s error code list (https://support.microsoft.com/kb/938205) says:
0x00240006L WU_S_ALREADY_INSTALLED The update to be installed is already installed on the system.
That said, without knowing any more detail about what you are actually doing, my best guess for what probably happened is that you used WUSA.exe to install an update that is already installed on the target system, and that is why you received the 2359302 error.
-Doug
November 7, 2014 at 9:32 pm in reply to: Error: Cannot start process because a file name has not been provided. #10677dougModeratorNo problem, Vince. I’m happy to hear that works! Very strange.
Even though it’s unclear why/how this happens, we actually have some ideas on preventing this problem from being able to occur in the first place, which we expect to add in a future build.
Thanks,
Doug
November 6, 2014 at 5:42 pm in reply to: Error: Cannot start process because a file name has not been provided. #10682dougModeratorVince – I’m at a loss here. I don’t understand what could possibly cause this to happen, and it doesn’t make any sense that it occurs on only some targets when using BP but not other targets. And then it also makes no sense that it doesn’t occur when running psexec from the command line against the targets that produce the error in BP.
What happens when you execute Remote Command 3/4 instead of 1/2 ? Any differences?
Can you confirm that PsExec is in your Windows PATH environment variable? As a test, please also try putting a copy of PsExec in the same directory as the BatchPatch.exe. Let me know if that has any impact.
Thanks,
Doug
November 4, 2014 at 3:33 pm in reply to: Error: Cannot start process because a file name has not been provided. #10672dougModeratorVince – this is very odd. What happens if you try to use psexec manually from the command line?
Launch a cmd on the BP computer and type the following command, where targetComputer is one of the computers that you’re getting the “Error: Cannot start process because a file name has not been provided.”
psexec \targetComputer gpupdate.exe /force
dougModeratorThe application needs to be running in order for the scheduled tasks to be executed, so no it will not work if there are no users logged on. You can minimize the app to the system tray to get it out of the way by right clicking on the minimize button.
October 29, 2014 at 7:45 pm in reply to: Feature Request / Issue: Out of order sorting by date and uptime #10655dougModeratorThanks, Travis. I totally hear your frustration on this one and agree that proper date sort would be nice. From a technical perspective I think we looked at this before and ran into an unexpected problem with the implementation and so we put it on-hold. However, we do still plan to get it implemented in a future build.
-Doug
dougModeratorOK, sounds good. I’ll keep my eye out for it.
Thanks,
Doug
dougModeratorThanks for the suggestion, Travis. We’ll put this on the list this for a future build. In the meantime, one other way to easily get this information without having to do a find/replace is to simply highlight the entire grid and use ctrl-c to copy and paste it into a spreadsheet application like Excel. From there you can just highlight the hosts column and do with it as you please. I know this is also an extra step, but it might be easier than dealing with the find/replace.
Thanks,
Doug
October 28, 2014 at 5:08 pm in reply to: Error: Cannot start process because a file name has not been provided. #10640dougModeratorVince – This is peculiar. I’m not sure what to make of it, and I can’t quite decipher what you are describing.
Are you saying that the error is related to where BatchPatch.exe runs? Or are you saying that the error is related to specific target computers that have been added to a BatchPatch grid, regardless of what computer runs BatchPatch.exe?
Thanks,
Doug
dougModeratorTurns out this was happening when there were available updates appearing in the check for available updates, but then the when the download process was initiated the updates were failing to download, so when it came time for installation there were no downloaded updates to install. The problem was an issue with particular updates, and they could not be downloaded by the Windows Update client on the machine. It was not an issue with BatchPatch.
dougModeratorJohnny – In order for BatchPatch to work, the Windows Firewall must allow RPC communication, which is required for WMI to work. Additionally, you must allow File and Printer sharing. This is described in more detail on the following page:
Using BatchPatch With Windows Firewall
There is also some additional helpful info here:
Batchpatch Ports For Enterprise Firewall ACLs
With regard to authentication, you’ll also want to make sure that you look at this link too:
BatchPatch Authentication In Domains And Non Domain Workgroups
October 15, 2014 at 6:52 pm in reply to: Error: 2. HRESULT: -2147024894. Could not find file … #11611dougModeratortwoj – Thanks for reporting all of your findings. This is very helpful.
A couple of quick notes:
1. PaExec is not based on PsExec code. This doesn’t mean that they can’t have the same problems since they both accomplish the same task in the same or similar ways. However, PsExec source code is not available, and so PaExec code could not be based off of the PsExec code. However, PaExec was definitely written to mimic PsExec functionality, though the code itself is different.
2. We had one other report recently of the same “Error: 2. HRESULT: -2147024894” from a different user on a single Win 2012 (non-R2) target, while running BatchPatch on Win 8.1. Interestingly he switched from v2.11 to v1.98 and then the error disappeared. BUT… then he switched back to v2.11 right after that, and the problem never occurred again. Go figure. I do not know what to make of this behavior at the moment.
3. Unfortunately we are still not able to reproduce this error on any combination of source and target operating systems.
dougModeratorHi John – This sounds very odd. I am going to email you so that we can iterate more easily to get to the bottom of what is happening.
-Doug
October 9, 2014 at 7:16 pm in reply to: When opening bps file the focus of batchpatch is on the 'New 1' tab #11609dougModeratorI understand what you’re saying. That issue occurs because of the “Tools > Settings > Remember open tabs…” settings being enabled. So, another workaround would be to just disable the “Remember tabs” checkboxes. But we’ll still get it fixed regardless.
Thanks again,
Doug
October 9, 2014 at 6:09 pm in reply to: When opening bps file the focus of batchpatch is on the 'New 1' tab #11607dougModeratorWow. That is super-weird. Thanks for the video. I’m now able to reproduce it.
First, just as a very quick workaround/solution for you:
The issue only occurs when/if you use ‘Right click > open’ on a .bps file. If you instead simply double-click the .bps file to launch it, BatchPatch will launch with only that .bps file and NO ‘new 1’ tab. Please give this is a try. Is there a specific reason that you are using ‘Right click > open’ ? Or is it just habit? 🙂
Second, I expect that we should be able to fix this in the next release.
Thanks again,
Doug
October 9, 2014 at 4:13 pm in reply to: When opening bps file the focus of batchpatch is on the 'New 1' tab #11605dougModeratortwoj – I’m not sure I understand what you are describing. I *think* I get what you’re saying but at the same time it’s not making any sense to me. I can’t reproduce the behavior, and I can’t quite understand how it’s even possible for this to be happening under the hood (unless I’m misunderstanding). First, it sounds like you are using “multi-grid” view as opposed to the regular tabbed view, yes? So, if you have two visible grids in the layout, and you left click OR right click on either grid, that grid should become the “active” grid, which is indicated by it getting a darker gray and darker blue background color scheme, as opposed the lighter colors that are used for the non-active grids. If I’m understanding you correctly, you’re saying that even though you right click (or left click) on gridX, it still stays as a non-active grid, while a different gridY that you are NOT clicking on remains as the active grid? Am I understanding correctly? What version of BatchPatch are you using? Do you have the latest version? Could you screenshot or even better yet take a video capture for me to be able to see what you are seeing? You won’t be able to post it directly to this forum, but you could use imgur or similar. Alternatively, just let me know that you have it, and I’ll email you at the address you used to register your forum account, so that you can send it to me directly.
Thanks,
Doug
dougModeratorExcellent. Thanks for the follow-up. Glad it’s working now. Sorry for the issue, but you are correct that it was fixed.
-Doug
October 1, 2014 at 5:41 pm in reply to: Error: 2. HRESULT: -2147024894. Could not find file … #11601dougModeratortwoj – I don’t think that you are likely to have success when trying from the old WSUS server since it seems like the problem is related specifically to the target computers and not the source computer. However, if you do have success with the old WSUS server, please let me know.
Given that both psexec and paexec are having what appears to be the same problem, I don’t really have a great suggestion for you. Both of those apps work in a very similar manner, and there is something going on with the target systems in question that are breaking the psexec/paexec functionality.
If I were you I would try to examine what, if anything, is different on those systems as compared to all of your systems that are working properly, whether it be a particular piece of software that’s installed or maybe even some type of strange corruption. You might start by examining any type of host intrusion prevention software or anti-virus software that is installed on those systems, because software like that could impede psexec/paexec, though in this case it feels like something is “broken” more than it feels like something is being explicitly blocked. If the problem didn’t exist in the past and only started happening recently, then perhaps you might want to examine any patches/updates/apps that have been installed on those systems very recently. Perhaps a recent OS update or software update is what caused the problem? I’m not sure.
Good luck. Please do report back here if you come to a resolution.
Thanks,
Doug
September 29, 2014 at 8:14 pm in reply to: Error: 2. HRESULT: -2147024894. Could not find file … #11599dougModeratortwoj – If psexesvc.exe is hanging on the server, unfortunately that’s not likely caused by BatchPatch but is instead something particular to the target server that is having the problem. It’s hard to say what the cause might be. A couple things to try:
1. Are you able to run psexec at the command line against the same target that is causing a problem in BatchPatch or does it hang too? So like for example something simple like “psexec \problematicTargetServer ipconfig /all”
2. Have you tried kiling psexesvc.exe on the target, and then going to the services console on the target and making sure there is no psexesvc listed there either? If it’s there, then please delete it. You can use the following commands to stop and then delete the service on the target:
sc.exe stop psexesvc
sc.exe delete psexesvc
3. What happens if you substitute paexec (http://www.poweradmin.com/paexec/) in place of psexec ? In order to perform this test you’ll need to put the copy of paexec in your system PATH and then in BatchPatch press ctrl-shift-p one time, which will tell it to use paexec instead of psexec. Note, this setting will “stick” so keep this in mind so that you know whether you are using psexec or paexec in general. PaExec should work as well as PsExec, though we are not officially supporting it at the moment. Also PsExec v2.11 is higher security if using alternate credentials since it fully encrypts credentials before sending to targets, whereas PaExec obfuscates without fully encrypting. However, that only applies to alternate credentials. It doesn’t apply to integrated security, in which both PaExec and PsExec behave the same, securely.
-Doug
September 29, 2014 at 7:36 pm in reply to: Error: 2. HRESULT: -2147024894. Could not find file … #11597dougModeratorHi twoj – as mentioned in the previous posting, we have only seen this problem caused by an old psexec process still running/hanging on the target system. Once the old process is killed, the new BatchPatch action is able to complete successfully. Are you seeing that psexec is hanging? When you say “mostly older servers” what does that mean? How many servers is this happening on, and how many servers are things working properly on? Do all the problem servers have the same OS? What version of BatchPatch are you using? What version of PsExec are you using?
-Doug
dougModeratorHi Johnny – First, just to clarify. We have a row, which contains a target host. We have many rows, which comprise a grid. Each tab contains only one grid.
Email notifications are sent in two ways… either at the end of a Job Queue or as a Scheduled Task. In either case, you have 3 options ($row, $grid, and $allgrids). The notification can include just the single row that sent the notification OR the entire grid/tab, OR all grids/tabs.
The email notifications feature is explained more here: How to Send Email Notifications in BatchPatch. It explains the three different options using $row, $grid, and $allgrids.
I hope this helps.
-Doug
dougModeratorHi Stephen – Yes, in BatchPatch you can now easily exclude certain updates from being installed. Please see the following posting, which explains how to do this.
Remotely Install Only A Subset Of Available Windows Updates
I hope this helps.
-Doug
dougModeratorExcellent. Thanks for letting me know. I’m glad it’s working now.
-Doug
-
AuthorPosts