Forum Replies Created
-
AuthorPosts
-
dougModerator
Copy the script text below to notepad and then save it as “script.vbs”
On Error Resume Next
Const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set objRegistry=GetObject("winmgmts:\" & strComputer & "rootdefault:StdRegProv")
strKeyPath = "SOFTWAREMicrosoftWindows NTCurrentVersionProfileList"
objRegistry.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubkeys
For Each objSubkey In arrSubkeys
strValueName = "ProfileImagePath"
strSubPath = strKeyPath & "" & objSubkey
objRegistry.GetExpandedStringValue HKEY_LOCAL_MACHINE,strSubPath,strValueName,strValue
Set fso = CreateObject("Scripting.FileSystemObject")
If InStr(Ucase(strValue),"C:WINDOWS") = 0 Then
' Wscript.Echo strValue & "AppDataRoamingMicrosoftSignatures"
fso.CopyFile "signature.file", strValue & "AppDataRoamingMicrosoftSignatures", True
End If
NextdougModerator%username% works fine in BatchPatch remote command (logged output), but %username% doesn’t solve your problem because it will only echo the current user when using elevated token or the computer name when using SYSTEM. But the current user is going to be the admin account that you are using, not each/every user account on the computer. However, it sounds like your goal is to copy the email signature file to each user profile on each computer. To do this you would need to write a script that enumerates each user profile folder in C:Users, and then loops through that list to copy the file from the same directory as where the script resides to each profile folder on the same computer. Once you have a script like this working properly locally without using BatchPatch, then you could deploy the script plus the signature file using a BatchPatch deployment where you put both the script and the signature file in the same directory, and then you create the BatchPatch deployment with the “copy entire directory” box ticked. When the deployment runs it will copy the folder containing the script and the signature file to the target computer, and then it will run the script on the target computer which will copy the signature file from the script directory to each user profile directory. Just make sure that in your script you reference the signature file just by “signaturefile.whatever” without specifying an absolute path. This way no matter what the actual path is, so long as the signaturefile.whatever is in the same directory that the script runs from, the script will be able to find it when it executes the copy.
dougModeratordougModeratorSome things have changed since that tutorial was written. In some cases it may be necessary to use the syntax from the tutorial whereas in other cases it might not be needed anymore.
dougModeratorGlad you got it figured out. This should also work:
powershell.exe -command "wevtutil el | Foreach-Object {Write-Host "Clearing $_"; wevtutil cl "$_"}"
dougModeratorI’m not quite sure what “export the email notifications” means. If you are saying that you want to export the settings contained in ‘Tools > Settings > Email notifications’ to a file, this is not possible.
dougModeratorYou said you only want error reports. The example I gave you will only send the email if there is an error. In your case there was no error, so no email was sent. “Exit code: 0” means success. Non-0 exit codes would generate an email.
dougModeratorYou can use the job queue to create a multi-step action to execute on the target. You can use the special item in the job queue ‘Send email notification if previous action fails/errors’ to trigger an email to be sent.
So for example your job queue could be:
1. Download and install updates + reboot if required
2. Send email notification if previous action fails errors
Other options for sending email notifications are explained here:
using-email-notifications-to-check-status-of-automated-patching-events
dougModeratorHi Laurie – I’m sorry to hear that you are having trouble. From the information you provided I would not be able to tell you why the issue is occurring. I would need to review the actual .bps file to even have a chance at that. If you’d like to contact us via email (use the contact form on our website), then we can try to figure out what’s going on. Otherwise my guess is you won’t have any issues if you simply start a brand new grid from scratch. We have never seen this error occur or had any reports of it, so it’s likely something specific to your .bps file. Either it is legitimately corrupted, in which case you would definitely need to start a brand new file from scratch, or do you have any kind of process that might be trying to modify the file directly on disk rather than modifying it through BP? This would be another possible thing that could cause issues if the modifications do something to the file that is breaking the xml format in some way and thereby preventing the xmlreader from being able to consume the file without encountering an unexpected end. Aside from that I couldn’t really imagine that anything else could cause it.
-Doug
dougModeratorThanks.
dougModeratorBatchPatch does not impose limits, but Windows does have limits to how large reg values can get, depending on the OS. What OS are you running BP on?
We’ll look into getting this sorted out for a future version and prob saving them to a file rather than the reg.
dougModeratorOh, ok. That makes sense. So yeah if they are on two separate servers then it would not be an issue. It would only be an issue if you launched batchpatch.exe more than one time on the same server or if you used ‘File > New window’ in BatchPatch, which works the same way by launching a new instance of batchpatch.exe. If you have only a single batchpatch.exe running on a computer, then there will be no overwriting occurring. That said, at the moment I have zero guesses as to what could be causing your issue. Not that it should make a difference, but do you have an unusually large number of saved commands/deployments/queues etc? I would suggest that you do a test. Close all instances of batchpatch.exe. Then launch a single instance of batchpatch.exe. Then add a single item (command/copy job/queue/deployment etc). Then close and reopen BP. Is it still there? What about other items that previously existed? So for example are ALL items cleared or does it seem like only the ones that you are creating new are being cleared? Almost sounds like there is something preventing BP from writing to the user hive of the registry? The items are saved in HKCUSoftwareBatchPatch under values titled SavedUserDefined…XXX
dougModeratorThe new version of BatchPatch will not be any different as far as this issue is concerned. The way you responded left it unclear if you are using multiple instances of BP, but it sounds like you are, yes? That’s surely the problem. If you have two or more instances running, whichever instance is closed last will control which commands you see when you launch a new instance. We’ll look at ways we can improve this in a future version, but for now you’ll need to be mindful of the order that you close instances. Or if you are going to make updates to commands/queues/deployments etc, do it with only a single instance open.
dougModeratorWe have had zero reports of this ever happening, and we have never experienced it here. There are only two things that I can think of…
1. Are you saving them in one user profile but then looking for them in a different one? So if you are running BP as userA and saving them, but then looking for them by running BP as userB (or as running as admin vs not running as admin, for example?), that could make it seem like they are missing when in fact they are there but just not where you are looking.
2. Are you running multiple instances of the BatchPatch.exe? If you are creating/saving them in one instance of BatchPatch.exe but they don’t exist in the other instance of the BatchPatch.exe, then this could easily create a scenario where you inadvertently overwrite all of the saved stuff with the other instance.
September 18, 2018 at 6:52 pm in reply to: Summarize number of updates available / needed per grid #10064dougModeratorThanks. We’ll consider this. In the meantime you can actually get this answered at least partially by using ‘Generate consolidated report of available updates’. In the lower left corner of that report window there is a ‘Rows’ number that tells you the total number of updates found.
September 18, 2018 at 5:33 pm in reply to: Start second multi-row job queue after multi-row job queue is ready #10063dougModeratorIn the current version of BP it’s not possible to trigger one multi-row-queue-sequence to start when a different multi-row-queue-sequence ends. However, you could simply combine them into just a single multi-row-queue-sequence because that is effectively what you would be doing anyway. What is the purpose of keeping them as two separate sequences if the goal is to run them as a single sequence?
dougModeratorJust on the computer where BatchPatch is running.
-Doug
dougModeratorThanks. Turns out there are two separate issues here, but they manifest with the same result.
1. When the vertical resolution is smaller than 1024, portions of some windows like the Settings and Job Queue are cut off from view.
2. When the DPI/scaling is set to a non-standard value such as 125% or 175%, portions of some windows like the Settings and Job Queue are cut off from view.
To resolve/workaround please use vertical resolution of 1024 or greater. Please use DPI scaling of 100%, 150% or 200%. We’ll look into improving this for a future version.
Thanks,
Doug
dougModeratorDon’t do this. Do not disable the Windows Update services. It’s the wrong approach, and it’s a bad idea. Instead change the group policy (or local policy on each computer if there is no domain) for ‘Configure Automatic Updates’ and set it to “2 – Notify for download…” Any machine that is configured for setting 2 will *NOT* automatically download updates anymore. Then you can use BatchPatch for this process.
To do this… In the Group Policy / Local Policy editor (gpedit.msc) go to ‘Computer Configuration > Administrative Templates > Windows Components > Windows Update’. Set the “Configure Automatic Updates” setting to 2.
Also make sure you do not have ‘Dual Scan’ enabled on your computers. More here:
September 17, 2018 at 4:16 pm in reply to: Summarize number of updates available / needed per grid #10070dougModeratorHi Mats – Could you elaborate on what purpose this would serve? I’d like to understand from your perspective why you think this would be beneficial. At the moment from my perspective I can’t think of how this really is helpful, so I’d be interested to hear what you think. Furthermore, could you explain how you would want it to be handled in the case that multiple rows need the same patches. So for example if there are 5 hosts in the grid, and each host needs the same 4 updates, do you want to see 4 updates needed for the grid or do you want to see 20 updates needed or do you want to see something like 4 unique updates / 20 total updates needed?
dougModeratorThe issue is your DPI/scaling setting in Windows. BatchPatch tries to detect and warn you if you are using a DPI that BatchPatch isn’t able to display properly, but it might not have been successful in detecting this or perhaps you closed the warning without realizing it. In any case if you change the DPI/scaling to 100% things should look normal again. 150% and 200% are also probably fine. I think the issue is when you set it to something like 125% or 175%. That’s when it will cut off part of the BatchPatch windows.
dougModeratorNormally you would just ping the device (‘Actions > Ping…’) to see the IP. Of course you’ll want/need your DNS to be accurate and up to date.
-Doug
dougModeratorYes, BP cleans the remote working directory after successful updates or deployments. However, an unsuccessful operation could leave files there. In all cases, BP always leaves a couple/few log files in the folder, and I would recommend that you do not remove these since they contain the history of update operations. If you do decide to remove these, it won’t break anything but you’ll lose some of that history information. If you want to delete the entire directory you may use ‘Tools > Delete remote working directory.’ If you want to delete only certain files/folders in it, then you would have to use a custom command.
-Doug
September 6, 2018 at 3:54 pm in reply to: Active Directory Synchronisation with appended DNS suffix #10077dougModeratorThe current version does not provide this functionality, but we are looking at adding it for a future version. However, you can workaround it by adding the DNS suffixes to your NIC, so then when the short name is in the grid, your NIC will automatically append the needed suffix, and connections will work just as if you had added the FQDN to the name in the grid. This video demonstrates how to add the suffixes to your NIC (note, we did not make this video):
dougModeratorIn the previous versions of BP, the job queue title was not displayed in the cell with the job queue steps. In the new version we display the job queue title in the first line, while the steps of the queue are below that. We surround the title with *. Example:
* Job Queue Cycle Number 2 *
. . . . . . . . . .
Download and install updates + reboot always
Wait 10 minutes
Wait for host to be detected online
Check for available updates
Terminate queue if previous ‘Check for available updates’ finds 0 updates
Download and install updates + reboot if required
dougModeratorAs described at the previously posted link above about BatchPatch ports, the solution is to configure your hardware firewall to allow DCE/RPC. BatchPatch does not use WinRM.
September 1, 2018 at 5:42 pm in reply to: I want to reorganize the cache folder (cache-mode/offline-mode) #10071dougModeratorIn the current version of BP this won’t work. BP will only look for files in the BP cache folder itself. It will not look into subdirectories. We’ll consider for a future version having BP recurse subdirectories when searching for files in the cache.
-Doug
dougModeratorBatchPatch port requirements here: BatchPatch Port Requirements
dougModeratorNope. It sounds like something specific to the particular .MSI that you are trying to install.
dougModeratorWell, I have no idea what the .MSI package is that you’re trying to install, so that makes it tough to comment on. This would be a case where you’d want to consult with the vendor who created the .MSI to see if it’s possible to successfully complete a silent installation or not with that package. Or do some googling to see if and how people are doing silent installations of the .MSI package in question. Of if there is a .MSU or .EXE version of it, then there could be other switches/parameters built in to the package that enable you to specify via a parameter to close the search/cortana as part of the silent installation.
I have never heard of nor have I ever seen a situation where a .MSI package returns 0/success but does not actually install. That sounds odd. Unless it’s returning a 3010, which is ERROR_SUCCESS_REBOOT_REQUIRED to complete the installation.
-
AuthorPosts