Jump to content


  • Content Count

  • Joined

  • Days Won


BlueToast last won the day on June 19

BlueToast had the most liked content!

Community Reputation

13 Good

My Information

  • Agent Count

Recent Profile Visitors

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

  1. 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.
  2. 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!!!
  3. 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).
  4. Source citation please? And, what is the risk of someone getting their hands on the server password from an agent installer lying around?
  5. Thanks, this helps! I have something to play with.
  6. Does denying access to ControlCenter.asmx have an impact beyond preventing thick client logins?
  7. I really like the time taken into the details of UI design (white space balance, formatting and coloring, SQL Statement and SQL Results boxes). Small details like this help give the impression of quality work, and from what I have seen your work has ground.
  8. I know right? That's why he's posting on mspgeek.com 🤣🤣🤣
  9. Pull this up in your favorite web-browser: https://rmm.yourcompany.com/automate/network-probe-wizard/%locationid% Replace %locationid% with the location ID. Replace rmm.yourcompany.com with the address to your ConnectWise Automate server FQDN.
  10. How do you do a Base64 decode of ScriptData? When I do it I get gibberish. I would like to use this in a ConnectWise Automate script in pursuit of automating script exports to a private on-prem code repository for change tracking.
  11. Here is a simpler version of the same thing that executes under cmd.exe at a fraction of the time of the PowerShell script with much less system resources and identical output: for /f "tokens=*" %a in ('reg query "HKU" ^| find /I /V "Classes"') do @(reg query "%~a\Control Panel\International" /v "LocaleName" | findstr /I "International LocaleName")
  12. Known Issue #11539951: https://university.connectwise.com/university/reports/knownissuesdetail.aspx?ticketId=11539951 KI Board: https://university.connectwise.com/university/reports/automateknownissues.aspx
  13. Known Issue: https://university.connectwise.com/university/reports/knownissuesdetail.aspx?ticketId=12189769 Link to KI board: https://university.connectwise.com/university/reports/automateknownissues.aspx
  14. This has been in issue for a number of versions. Some version like 2019.10-11 was better at this, but it seems to have just gotten worse. Solution that has worked has been to call the Stored Procedure in MySQL for retiring the agent, but it would be nice if ConnectWise would fix this. This issue seems to happen even if we edit the location in the locations table to remove the probe ID, even with reloading system cache and clearing the desktop client cache from ProgramData.
  15. %userprofile% is an environment variable that has a value relative to the security context under which the command is being executed. In layman's terms, if you execute the command under NT AUTHORITY\SYSTEM, then %userprofile% will evaluate to the correct value relative to the NT AUTHORITY\SYSTEM account. You won't be able to accomplish what you are hoping to do just with that. One way or another you are going to have to loop through every profile that exists at the parent path "C:\Users" and use dynamic paths based on data on each loop pass. Furthermore, you won't even need to do the File Write Text, Console Execute, or Folder Delete as Admin. for /f "tokens=*" %a in ('dir "C:\Users" /B ^| findstr /V "defaultuser0 Public"') do @(echo robocopy "C:\Windows\Temp" "C:\Users\%~a\AppData\Roaming\Microsoft\Teams\Backgrounds\Uploads" "background.jpg") (Download background.jpg to "C:\Windows\Temp" or adjust the paths, and remove the 'echo ' part once ready to execute all of it for real. You can use the output from the echo to test one execution at a time. The above command excludes folders 'Public' and 'defaultuser0'. Execute the above command using a 'Shell' or 'Shell Enhanced' script functions.) An additional note (in case you did not know): "xxxxx as Admin" does not mean running something with elevated privileges. It means executing a command under a different security context. That security context is whatever you set as the user account to use in the "Deployment & Defaults" tab > "Login to use for Administrator Access" for the location the Automate agent is in. Poorly worded? Yes, indeed! Does it use elevated privileges (i.e. right-click and Run as Administrator)? Nope! Even if the account being used is a Domain Admin or member of local Administrators group? Correct, even so! Using a script function without "as Admin" is elevated whereas using a script function "as Admin" is not elevated. Using a script function without "as Admin" will use NT AUTHORITY\SYSTEM which is practically as god-level and elevated you can get (more so than a typical right-click and 'Run as administrator'). An example use case of a "xxxxx as Admin" script function is when you need to be able to copy some files off of a domain network resource file share to the local computer; a properly setup domain environment will not allow a non-domain account (like NT AUTHORITY\SYSTEM) to access domain resources. This is how Windows UAC works, and that is why. But why ConnectWise used wording like "as Admin" and "Administrator Access" without having a helpme '?' bubble to clarify all this? Beyond me.
  • Create New...