Jump to content


  • Content Count

  • Joined

  • Days Won


BlueToast last won the day on July 30

BlueToast had the most liked content!

Community Reputation

16 Good

My Information

  • Agent Count

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. What uninstall method are you using? You may want to acquire the latest set of "OffScrub" scripts and run those as well before running an installer for Microsoft Office.
  2. If that delay is not a concern, great! If it is, you'll need to resort to MySQL queries to collect data directly from the database on-demand per case. SELECT a.`Value` FROM extrafielddata a WHERE a.`ID` = '%clientid%' AND a.`ExtraFieldID` = (SELECT b.`ID` FROM extrafield b WHERE b.`Form` = '3' AND b.`Section` = 'Additional Data' AND b.`Name` = 'Enable Software Deployment'); # extrafield.`Form` = 3 is a client EDF, 2 is a site EDF, 1 is a computer EDF. 4, 5, and 7 are other types of EDFs. # extrafielddata.`ID` = Dependent on whether the EDF is computer, site, or client. In example, if we are looking at a client EDF, the `ID` will be the %clientid%. Location EDF should use %locationid%, and computer EDF should use %computerid%. # If the result returned in a script is -9999, there are no results returned by the MySQL query This is a general example to read an EDF. You will have to adjust the values of a.`ID`, b.`Form`, b.`Section`, and b.`Name` on a case by case basis depending on the EDF being sought. I have not tested the MySQL queries below, use at your own risk: To write and update (creates row in table if does not already exist, replaces row if duplicate key scenario encountered): REPLACE INTO extrafielddata VALUES (%clientid%, (SELECT b.`ID` FROM extrafield b WHERE b.`Form` = '3' AND b.`Section` = 'Additional Data' AND b.`Name` = 'Enable Software Deployment'), 1); To update existing row only: UPDATE extrafielddata SET Value = 1 WHERE ID = %clientid% AND ExtraFieldID = (SELECT b.`ID` FROM extrafield b WHERE b.`Form` = '3' AND b.`Section` = 'Additional Data' AND b.`Name` = 'Enable Software Deployment'); Long story short: if you are going to go the route of MySQL acquiring gradual familiarity and understanding of the database, its structure, its data, how to write queries, and having a test MySQL database environment (separate from live production). Acquiring this experience and knowledge is a good thing! You will be empowered quite a bit! I did not have very much understanding of MySQL two years ago, but now I have a lot more and exposure to a CWA live production database has provided ample opportunities of seeing something that's real and not synthetic/lab. I recommend some resources: SELECT: https://dev.mysql.com/doc/refman/8.0/en/select.html REPLACE: https://dev.mysql.com/doc/refman/8.0/en/replace.html UPDATE: https://dev.mysql.com/doc/refman/8.0/en/update.html
  3. Does that work for you (aka it successfully deletes the folder)?
  4. Partially unrelated notes: If you are using the Script Run function within a script to run another script immediately within the same script, the value of variable %scriptid% will not change; it will always be the script ID of the parent script, unless you are using Script Run to schedule a script to run in the future (rather than now). Additionally, scripts that are run immediately (not scheduled) through Script Run will not return a Script State (i.e. Success/Failure).
  5. First: you can no longer use wusa.exe to uninstall patches silently since Windows 8/Server 2016, so this is out of the question. You. Just. Can't. Do. It! Thanks Microsoft (for ingeniously deciding that parameters /quiet and /kb:kb123456 are illegal to use together). Sometimes wusa.exe will be able to remove a patch if you manually execute it in a console-level session, and there will be pop-ups you have to interact with, too. Second: dism does not list every installed patch as a package. Said differently, not every installed patch exists as a package for dism to work with. On my Windows 10 machine, of 6 installed KB patches only 1 KB patch had a package listed by DISM. Third: ConnectWise Automate's built-in "Remove Patch" command no longer works. Every single patch I try to uninstall through Patch Manager in CWA for Windows 10, Windows Server 2016, and Windows Server 2019 returns one of the following: "N/A", "cannot be uninstalled", or "No Updates to uninstall". Problem: this is crock full of 🐴💩 as I am able to uninstall every single patch through appwiz.cpl (item 4 below). Unfortunately, this is probably also a Microsoft thing as these messages are also coming from C:\Windows\WindowsUpdate.log. Fourth: appwiz.cpl > Installed Patches appears to be the most rock solid and effective way to uninstall ANY patch. Problem: this isn't automatable and requires you to remote and login to every machine to do it manually with mouse clicking and interaction. Fifth: dism appears to have support for uninstalling a patch by feeding it a .CAB file that has been extracted from an .MSU file. Problem: this means you would have to download the MSU package for every patch you want to uninstall, and to get that package you'll somehow magically have to acquire the download URL for whatever KB# you wish to remove. Good luck with that! I also don't know how effective this solution truly is, either (might not be effective at all!). I have searched up and down for a solution but it seems that at present there isn't a silent and automation-friendly way to uninstall patches. You have to do it manually by hand, machine by machine, through a console session and GUI.
  6. That's a folder, not a file. File 'Temp' doesn't exist. You are trying to delete a file, not a folder, when you probably mean to delete the folder.
  7. Use a MySQL REPLACE INTO statement rather than the EDF script functions. The EDF script functions also seem to have a delay before the most recently collected EDF data is actually recognized when EDF data is read from the database (unless you are using MySQL queries to read and write data directly!)
  8. When CWA collects software inventory, there are multiple scopes involved. First, it generally runs under the NT AUTHORITY\SYSTEM security context. I have found that some applications by nature of how they operate and were designed (i.e. Facebook Workplace Chat Installer) will only show up in Programs & Features per user context rather than system-wide. When CWA collects software inventory, the outcome of it includes both system-wide and user-specific installs (at minimum, any applications that exist within the "user profile" of NT AUTHORITY\SYSTEM). That's why when you login to a computer (to get to the desktop that has a wallpaper, start menu and taskbar, etc) as an account other than NT AUTHORITY\SYSTEM and look at the Programs & Features you may see a mismatch/missing applications when compared to CWA's software inventory.
  9. Don't call cmd.exe /c within Shell unless there is a technical reason that you understand with great confidence (in the what, why, and how). Shell IS cmd.exe /c, so you are unnecessarily creating a nesting of essentially cmd.exe /c "cmd.exe /c "commandstuff"". Use this: powershell -NoLogo -NoProfile -ExecutionPolicy Bypass -Command "& C:\Windows\LTSvc\Scripts\HyperVMaintainer3.0.ps1" Also, make sure that your HyperVMaintainer3.0.ps1 at minimum outputs some sort of text, i.e. "noData", no matter what. If a variable that is passed to Write-Host could potentially be empty or null, set the variable to at least "noData". Your PowerShell script may actually be running but outputting nothing, which would generate an "OK" response (because the output is empty, without content = CWA will default to "OK").
  10. Did you really have to create 3 threads of exactly the same post? Is 1 thread not enough?
  11. This is a little faster in execution (1 execution vs your 5 above) and safer (uses Execution Policy Bypass as a one-off temporary setting rather than as a system-wide change that could potentially remain open if a later command fails): powershell -ExecutionPolicy Bypass -NoLogo -NoProfile -Command "Install-Script -Name 'Get-WindowsAutoPilotInfo' -Force; $PathToScript = (Get-InstalledScript -Name 'Get-WindowsAutoPilotInfo').InstalledLocation; Set-Location $PathToScript; .\Get-WindowsAutoPilotInfo.ps1 -?" You will want to add a little more to this command to check to see if Get-WindowsAutoPilotInfo is already installed so that you can avoid forced redownloading of the script (unless that's what you want for every execution). Then modify the ending part to do your -OutputFile (and specify full path, i.e. -OutputFile 'C:\Windows\Temp\AutoPilotHWID.csv'). If you want, you can include New-Item -Path 'C:\Windows\Temp\SomeDir123' -ItemType 'Directory'; to ensure that the folder you want the -OutputFile to save to always exists. You can also test to see if -OutputFile is capable on its own to automatically create the path if it does not already exist. If you really need to set the current directory for PowerShell, you can also insert this: Set-Location 'C:\Windows\Temp\SomeDir123'; Lastly, forced redownloading of the script is not bad for consideration as it means any prior tampering of a pre-installed version of the script would be replaced by the genuine and latest untampered version of the script.
  12. First, you need MySQL access. If you are using on-prem RMM, you can acquire SQLyog or other [free] tool for connecting to your MySQL database for ConnectWise Automate. If you are using cloud-hosted RMM, you can use Automation Theory's Database Commander plugin to run MySQL commands. Second, you will need to explore and analyze the table "agents" under database "labtech" and find an existing Remote Monitor you have already created. Then, use that as a template. With some MySQL knowledge, you can use Microsoft Excel CONCAT() to piece together all the INSERT statements you need to execute to create all the Remote Monitors in one go. Make sure you do adequate testing before running on a live production DB!!!
  13. If you are trying to access a \\somepc\Share under the NT AUTHORITY\SYSTEM security context, you are most likely to encounter a failure unless the NTFS permissions of the share include "Everyone" with appropriate access rights to enable unauthenticated viewing and browsing of said SMB share. If you are using "Local Account" (poorly named in my opinion; usually configured as a domain account or local account that exists on all machines at the same site), whatever account is configured to be used for Administrator Access (see "Deployment & Defaults" under Site properties in Automate) must have permissions to access and browse said SMB share. In scripting, you typically use "Shell as Admin" to harness the Administrator Access/Local Account account. Keep in mind that even if your Administrator Access/Local Account account has Domain Admins or membership to the local Administrators group, commands executed are NOT elevated (and cannot be by design of UAC and Microsoft).
  14. Source citation please? And, what is the risk of someone getting their hands on the server password from an agent installer lying around?
  15. Thanks, this helps! I have something to play with.
  • Create New...