Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions Datto-RMM/scripts/InstallHuntress.dattormm.comstore.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Authors: Alan Bishop, Sharon Martin, John Ferrell, Dave Kleinatland, Cameron Granger
# Authors: Alan Bishop, Sharon Martin, John Ferrell, Dave Kleinatland, Evan Shewchuck


# The Huntress installer needs an Account Key and an Organization Key (a user specified name or description) which is used to affiliate an Agent with a
Expand Down Expand Up @@ -104,7 +104,7 @@
##############################################################################

# These are used by the Huntress support team when troubleshooting.
$ScriptVersion = "Version 2, major revision 8, 2025 Nov 19"
$ScriptVersion = "Version 2, major revision 8, 2025 Nov 20"
$ScriptType = "PowerShell (Datto)"

# variables used throughout this script
Expand Down Expand Up @@ -726,7 +726,7 @@
# if Huntress services still exist, then delete
$services = @("HuntressRio", "HuntressAgent", "HuntressUpdater", "Huntmon")
foreach ($service in $services) {
if ( $service ) {
if ( Get-Service -name $service -erroraction SilentlyContinue ) {
LogMessage "Service $($service) detected post uninstall, attempting to remove"
c:\Windows\System32\sc.exe STOP $service
c:\Windows\System32\sc.exe DELETE $service
Expand Down Expand Up @@ -870,7 +870,8 @@
LogMessage $(systeminfo)

#LogMessage "Host name: '$env:computerName'"
try { $os = (get-WMiObject -computername $env:computername -Class win32_operatingSystem).caption.Trim()
try {
$os = (get-WMiObject -computername $env:computername -Class win32_operatingSystem).caption.Trim()
} catch {
LogMessage "WMI issues discovered (computer name query), attempting to fix the repository"
winmgmt -verifyrepository
Expand Down
Loading