diff --git a/Install-EmberkomCloudBackup.ps1 b/Install-EmberkomCloudBackup.ps1 index 95b3071..4c23909 100644 --- a/Install-EmberkomCloudBackup.ps1 +++ b/Install-EmberkomCloudBackup.ps1 @@ -17,15 +17,42 @@ switch ( $Edition.ToLower() ) { ## Install and import the MSP360 Powershell module Run-Script -LivePSScript Install-MSP360PowershellModule +LogMsg "Importing MSP360 Powershell module" Import-Module -Name MSP360 ## Install the agent -LogMsg "Installing Emberkom Cloud Backup agent" $INSTALLER = Download-File -URL $URL +LogMsg "Installing Emberkom Cloud Backup agent" Try { Start-Process $INSTALLER -ArgumentList "/S" -Wait } Catch { LogErr $_.Exception.Message } +If ( Test-Path $INSTALLER ) { + LogMsg "Deleting Emberkom Cloud Backup agent installer: ""${INSTALLER}""" + Try { Remove-Item $INSTALLER -Force } + Catch { LogErr $_.Exception.Message } +} ## Set the agent edition LogMsg "Setting Emberkom Cloud Backup agent edition to ""$AgentEdition""" Try { Set-MBSAgentSetting -Edition $AgentEdition } -Catch { $_.Exception.Message } \ No newline at end of file +Catch { $_.Exception.Message } + +## Install and import the PSAtera Powershell Module +Run-Script -LivePSScript Install-PSAteraModule +LogMsg "Importing PSAtera Powershell module" +Import-Module -Name PSAtera +Set-AteraAPIKey = $AteraAPIKey + +## Get agent details and custom fields from Atera +LogMsg "Getting Atera agent and custom field information" +Try { + $AteraAgent = Get-AteraAgent + $MSP360Username = Get-AteraCustomValue -ObjectType Customer -ObjectId $agent.CustomerID -FieldName 'MSP360 Account Username' + $MSP360Password = Get-AteraCustomValue -ObjectType Customer -ObjectId $agent.CustomerID -FieldName 'MSP360 Account Password' + $MSP360Password = ConvertTo-SecureString -string $MSP360Password -AsPlainText -Force +} +Catch { LogErr $_.Exception.Message } + +## Add account and password +LogMsg "Adding backup user account: ${MSP360Username}" +Try { Add-MBSUserAccount -User $MSP360Username -Password $MSP360Password } +Catch { LogErr $_.Exception.Message } \ No newline at end of file diff --git a/Install-MSP360PowershellModule.ps1 b/Install-MSP360PowershellModule.ps1 index 7511698..be69a7b 100644 --- a/Install-MSP360PowershellModule.ps1 +++ b/Install-MSP360PowershellModule.ps1 @@ -1,3 +1,12 @@ -LogMsg "Downloading and installing MSP360 Powershell module if not already installed" -Try { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://git.io/JUSAA'); Install-MSP360Module } -Catch { LogErr $_.Exception.Message } \ No newline at end of file +## Check if the MSP360 module needs to be installed +If (-not (Get-Module -ListAvailable -Name MSP360) ) { + + LogMsg "Setting Powershell Execution Policy to Unrestricted for this script" + Try { Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process } + Catch { LogErr $_.Exception.Message } + + LogMsg "Downloading and installing MSP360 Powershell module" + Try { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://git.io/JUSAA'); Install-MSP360Module } + Catch { LogErr $_.Exception.Message } + +} Else { LogMsg "MSP360 Powershell module is already installed" } diff --git a/Install-PSAteraModule.ps1 b/Install-PSAteraModule.ps1 index d1f02a4..c01938e 100644 --- a/Install-PSAteraModule.ps1 +++ b/Install-PSAteraModule.ps1 @@ -2,7 +2,7 @@ $PSAteraMinimumModuleVersion = '1.5.7' ## Get the PSAtera module if it's installed -$module = (Get-Module -ListAvailable PSAtera) +$module = (Get-Module -ListAvailable -Name PSAtera) ## Install only if we're an admin If ( IsAdmin ) { diff --git a/rmm/Cleanup-SystemTempFiles.ps1 b/rmm/Cleanup-SystemTempFiles.ps1 deleted file mode 100644 index 777cf68..0000000 --- a/rmm/Cleanup-SystemTempFiles.ps1 +++ /dev/null @@ -1,2 +0,0 @@ -. $([Scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Tools.ps1'))) -Run-Script -LivePSScript Cleanup-SystemTempFiles \ No newline at end of file diff --git a/rmm/Create-LocalAdmin.ps1 b/rmm/Create-LocalAdmin.ps1 deleted file mode 100644 index faab4ce..0000000 --- a/rmm/Create-LocalAdmin.ps1 +++ /dev/null @@ -1,2 +0,0 @@ -. $([Scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Tools.ps1'))) -Run-Script -LivePSScript Create-LocalAdmin -Arguments "-Username $Username -Password $Password -FullName $FullName -Description $Description" \ No newline at end of file diff --git a/rmm/Fix-AutodeskProductLicensing.ps1 b/rmm/Fix-AutodeskProductLicensing.ps1 deleted file mode 100644 index 234f5a4..0000000 --- a/rmm/Fix-AutodeskProductLicensing.ps1 +++ /dev/null @@ -1,2 +0,0 @@ -. $([Scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Tools.ps1'))) -Run-Script -LivePSScript Fix-AutodeskProductLicensing \ No newline at end of file diff --git a/rmm/Fix-ClearOutlookAutoCompleteCache.ps1 b/rmm/Fix-ClearOutlookAutoCompleteCache.ps1 deleted file mode 100644 index cad1f33..0000000 --- a/rmm/Fix-ClearOutlookAutoCompleteCache.ps1 +++ /dev/null @@ -1,2 +0,0 @@ -. $([Scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Tools.ps1'))) -Run-Script -LivePSScript Fix-ClearOutlookAutoCompleteCache \ No newline at end of file diff --git a/rmm/Fix-GroupPolicyUpdate.ps1 b/rmm/Fix-GroupPolicyUpdate.ps1 deleted file mode 100644 index 42a4eff..0000000 --- a/rmm/Fix-GroupPolicyUpdate.ps1 +++ /dev/null @@ -1,2 +0,0 @@ -. $([Scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Tools.ps1'))) -Run-Script -LivePSScript Fix-GroupPolicyUpdate \ No newline at end of file diff --git a/rmm/Fix-MicrosoftTeams.ps1 b/rmm/Fix-MicrosoftTeams.ps1 deleted file mode 100644 index 204d5ee..0000000 --- a/rmm/Fix-MicrosoftTeams.ps1 +++ /dev/null @@ -1,2 +0,0 @@ -. $([Scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Tools.ps1'))) -Run-Script -LivePSScript Fix-MicrosoftTeams \ No newline at end of file diff --git a/rmm/Fix-OfficeModernAuth.ps1 b/rmm/Fix-OfficeModernAuth.ps1 deleted file mode 100644 index 6e0bf9b..0000000 --- a/rmm/Fix-OfficeModernAuth.ps1 +++ /dev/null @@ -1,2 +0,0 @@ -. $([Scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Tools.ps1'))) -Run-Script -LivePSScript Fix-OfficeModernAuth \ No newline at end of file diff --git a/rmm/Fix-Service-QuickBooksDB31.ps1 b/rmm/Fix-Service-QuickBooksDB31.ps1 deleted file mode 100644 index 0d48d9a..0000000 --- a/rmm/Fix-Service-QuickBooksDB31.ps1 +++ /dev/null @@ -1,2 +0,0 @@ -. $([Scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Tools.ps1'))) -Run-Script -LivePSScript Fix-Service-QuickBooksDB31 \ No newline at end of file diff --git a/rmm/Fix-SplashtopService.ps1 b/rmm/Fix-SplashtopService.ps1 deleted file mode 100644 index 35bccb5..0000000 --- a/rmm/Fix-SplashtopService.ps1 +++ /dev/null @@ -1,2 +0,0 @@ -. $([Scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Tools.ps1'))) -Run-Script -LivePSScript Fix-SplashtopService \ No newline at end of file diff --git a/rmm/Fix-SystemPrintQueue.ps1 b/rmm/Fix-SystemPrintQueue.ps1 deleted file mode 100644 index 32911d6..0000000 --- a/rmm/Fix-SystemPrintQueue.ps1 +++ /dev/null @@ -1,2 +0,0 @@ -. $([Scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Tools.ps1'))) -Run-Script -LivePSScript Fix-SystemPrintQueue \ No newline at end of file diff --git a/rmm/Fix-WindowsHealth.ps1 b/rmm/Fix-WindowsHealth.ps1 deleted file mode 100644 index 2258212..0000000 --- a/rmm/Fix-WindowsHealth.ps1 +++ /dev/null @@ -1,2 +0,0 @@ -. $([Scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Tools.ps1'))) -Run-Script -LivePSScript Fix-WindowsHealth \ No newline at end of file diff --git a/rmm/Fix-WindowsUpdate.ps1 b/rmm/Fix-WindowsUpdate.ps1 deleted file mode 100644 index 47c156c..0000000 --- a/rmm/Fix-WindowsUpdate.ps1 +++ /dev/null @@ -1,2 +0,0 @@ -. $([Scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Tools.ps1'))) -Run-Script -LivePSScript Fix-WindowsUpdate \ No newline at end of file diff --git a/rmm/Get-DisplayInformation.ps1 b/rmm/Get-DisplayInformation.ps1 deleted file mode 100644 index ffc7b47..0000000 --- a/rmm/Get-DisplayInformation.ps1 +++ /dev/null @@ -1,2 +0,0 @@ -. $([Scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Tools.ps1'))) -Run-Script -LivePSScript Get-DisplayInformation \ No newline at end of file diff --git a/rmm/Get-InstalledSoftware.ps1 b/rmm/Get-InstalledSoftware.ps1 deleted file mode 100644 index 6e66c9e..0000000 --- a/rmm/Get-InstalledSoftware.ps1 +++ /dev/null @@ -1,2 +0,0 @@ -. $([Scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Tools.ps1'))) -Run-Script -LivePSScript Get-InstalledSoftware \ No newline at end of file diff --git a/rmm/Install-4KVideoDownloader.ps1 b/rmm/Install-4KVideoDownloader.ps1 deleted file mode 100644 index 1f149e2..0000000 --- a/rmm/Install-4KVideoDownloader.ps1 +++ /dev/null @@ -1,2 +0,0 @@ -. $([Scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Tools.ps1'))) -Run-Script -LivePSScript Install-4KVideoDownloader \ No newline at end of file diff --git a/rmm/Install-AdobeConnect.ps1 b/rmm/Install-AdobeConnect.ps1 deleted file mode 100644 index 16afe14..0000000 --- a/rmm/Install-AdobeConnect.ps1 +++ /dev/null @@ -1,2 +0,0 @@ -. $([Scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Tools.ps1'))) -Run-Script -LivePSScript Install-AdobeConnect \ No newline at end of file diff --git a/rmm/Install-AmazonCorretto.ps1 b/rmm/Install-AmazonCorretto.ps1 deleted file mode 100644 index b4b9eec..0000000 --- a/rmm/Install-AmazonCorretto.ps1 +++ /dev/null @@ -1,2 +0,0 @@ -. $([Scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Tools.ps1'))) -Run-Script -LivePSScript Install-AmazonCorretto \ No newline at end of file diff --git a/rmm/Install-DeltekVision.ps1 b/rmm/Install-DeltekVision.ps1 deleted file mode 100644 index b77b353..0000000 --- a/rmm/Install-DeltekVision.ps1 +++ /dev/null @@ -1,3 +0,0 @@ -. $([Scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Tools.ps1'))) -$VisionURL = '' -Run-Script -LivePSScript Install-DeltekVision -Arguments $VisionURL \ No newline at end of file diff --git a/rmm/Install-DisplayLink.ps1 b/rmm/Install-DisplayLink.ps1 deleted file mode 100644 index 57fcd9c..0000000 --- a/rmm/Install-DisplayLink.ps1 +++ /dev/null @@ -1,2 +0,0 @@ -. $([Scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Tools.ps1'))) -Run-Script -LivePSScript Install-DisplayLink \ No newline at end of file diff --git a/rmm/Install-EmberkomCloudBackup.ps1 b/rmm/Install-EmberkomCloudBackup.ps1 deleted file mode 100644 index 69525db..0000000 --- a/rmm/Install-EmberkomCloudBackup.ps1 +++ /dev/null @@ -1,7 +0,0 @@ -. $([Scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Tools.ps1'))) - -## Set the edition of the ECB agent. -## Valid options are 'desktop' 'server' or 'vm' -$Edition = '{[Edition]}' - -Run-Script -LivePSScript Install-EmberkomCloudBackup \ No newline at end of file diff --git a/rmm/Install-MSP360PowershellModule.ps1 b/rmm/Install-MSP360PowershellModule.ps1 deleted file mode 100644 index f413a99..0000000 --- a/rmm/Install-MSP360PowershellModule.ps1 +++ /dev/null @@ -1,2 +0,0 @@ -. $([Scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Tools.ps1'))) -Run-Script -LivePSScript Install-MSP360PowershellModule \ No newline at end of file diff --git a/rmm/Install-Nextcloud.ps1 b/rmm/Install-Nextcloud.ps1 deleted file mode 100644 index d8a8b63..0000000 --- a/rmm/Install-Nextcloud.ps1 +++ /dev/null @@ -1,2 +0,0 @@ -. $([Scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Tools.ps1'))) -Run-Script -LivePSScript Install-Nextcloud \ No newline at end of file diff --git a/rmm/Install-OpenVPN.ps1 b/rmm/Install-OpenVPN.ps1 deleted file mode 100644 index a3d4a04..0000000 --- a/rmm/Install-OpenVPN.ps1 +++ /dev/null @@ -1,2 +0,0 @@ -. $([Scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Tools.ps1'))) -Run-Script -LivePSScript Install-OpenVPN \ No newline at end of file diff --git a/rmm/Install-PSAteraModule.ps1 b/rmm/Install-PSAteraModule.ps1 deleted file mode 100644 index 325dff5..0000000 --- a/rmm/Install-PSAteraModule.ps1 +++ /dev/null @@ -1,2 +0,0 @@ -. $([Scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Tools.ps1'))) -Run-Script -LivePSScript Install-PSAteraModule \ No newline at end of file diff --git a/rmm/Install-Sketchup.ps1 b/rmm/Install-Sketchup.ps1 deleted file mode 100644 index 75bf599..0000000 --- a/rmm/Install-Sketchup.ps1 +++ /dev/null @@ -1,2 +0,0 @@ -. $([Scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Tools.ps1'))) -Run-Script -LivePSScript Install-SketchUp \ No newline at end of file diff --git a/rmm/Install-SpecsIntact.ps1 b/rmm/Install-SpecsIntact.ps1 deleted file mode 100644 index f051a22..0000000 --- a/rmm/Install-SpecsIntact.ps1 +++ /dev/null @@ -1,2 +0,0 @@ -. $([Scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Tools.ps1'))) -Run-Script -LivePSScript Install-SpecsIntact \ No newline at end of file diff --git a/rmm/Install-Wireguard.ps1 b/rmm/Install-Wireguard.ps1 deleted file mode 100644 index d979d93..0000000 --- a/rmm/Install-Wireguard.ps1 +++ /dev/null @@ -1,2 +0,0 @@ -. $([Scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Tools.ps1'))) -Run-Script -LivePSScript Install-Wireguard \ No newline at end of file diff --git a/rmm/Remove-DeltekVision.ps1 b/rmm/Remove-DeltekVision.ps1 deleted file mode 100644 index 8de8677..0000000 --- a/rmm/Remove-DeltekVision.ps1 +++ /dev/null @@ -1,2 +0,0 @@ -. $([Scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Tools.ps1'))) -Run-Script -LivePSScript Remove-DeltekVision \ No newline at end of file diff --git a/rmm/Set-EventLogs.ps1 b/rmm/Set-EventLogs.ps1 deleted file mode 100644 index 4655806..0000000 --- a/rmm/Set-EventLogs.ps1 +++ /dev/null @@ -1,2 +0,0 @@ -. $([Scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Tools.ps1'))) -Run-Script -LivePSScript Set-EventLogs \ No newline at end of file diff --git a/rmm/Start-Windows10UpdateAssistant.ps1 b/rmm/Start-Windows10UpdateAssistant.ps1 deleted file mode 100644 index 006e520..0000000 --- a/rmm/Start-Windows10UpdateAssistant.ps1 +++ /dev/null @@ -1,2 +0,0 @@ -. $([Scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Tools.ps1'))) -Run-Script -LivePSScript Start-Windows10UpdateAssistant \ No newline at end of file diff --git a/rmm/Stop-Process.ps1 b/rmm/Stop-Process.ps1 deleted file mode 100644 index 85a6c0e..0000000 --- a/rmm/Stop-Process.ps1 +++ /dev/null @@ -1,6 +0,0 @@ -. $([Scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Tools.ps1'))) - -## This is an RMM script variable -$ProcessName = '{[ProcessName]}' - -Run-Script -LivePSScript 'Stop-Process' \ No newline at end of file diff --git a/rmm/Test-InternetBandwidth.ps1 b/rmm/Test-InternetBandwidth.ps1 deleted file mode 100644 index 6182ac7..0000000 --- a/rmm/Test-InternetBandwidth.ps1 +++ /dev/null @@ -1,2 +0,0 @@ -. $([Scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Tools.ps1'))) -Run-Script -LivePSScript Test-InternetBandwidth \ No newline at end of file diff --git a/rmm/Uninstall-AdobeFlash.ps1 b/rmm/Uninstall-AdobeFlash.ps1 deleted file mode 100644 index 7608ac4..0000000 --- a/rmm/Uninstall-AdobeFlash.ps1 +++ /dev/null @@ -1,2 +0,0 @@ -. $([Scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Tools.ps1'))) -Run-Script -LivePSScript Uninstall-AdobeFlash \ No newline at end of file diff --git a/rmm/Uninstall-AutodeskDesktopApp.ps1 b/rmm/Uninstall-AutodeskDesktopApp.ps1 deleted file mode 100644 index 8a019b6..0000000 --- a/rmm/Uninstall-AutodeskDesktopApp.ps1 +++ /dev/null @@ -1,2 +0,0 @@ -. $([Scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Tools.ps1'))) -Run-Script -LivePSScript Uninstall-AutodeskDesktopApp \ No newline at end of file diff --git a/rmm/Uninstall-NCentralComponents.ps1 b/rmm/Uninstall-NCentralComponents.ps1 deleted file mode 100644 index 4c89383..0000000 --- a/rmm/Uninstall-NCentralComponents.ps1 +++ /dev/null @@ -1,2 +0,0 @@ -. $([Scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Tools.ps1'))) -Run-Script -LivePSScript Uninstall-NCentralComponents \ No newline at end of file