Compare commits
2
Commits
e7fe443894
...
d2824cb771
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d2824cb771 | ||
|
|
30fe5e32d6 |
@@ -1,8 +1,8 @@
|
||||
# Specify URL to "Backup for Windows" agent installer
|
||||
$ECB_WIN_URL = 'https://console.msp360.com/api/build/download?urlParams=OEFsMzhldm1SbjhaSDhBc2VtYkpUREM3Y2pJSzg0REU4dkVtR1pHREkxMGFFUk9qZXJnSXk5SUF0ei8wZlZOWTBzNG1zVDV0ckVMdStZVzBsam5uZklMVnZLeTBMVmxGNWt4VDhSMzNIL3NPb0htMWdjVjdvblFVZjhLTUFRU1YydHpLN2FEZ0pkSEdXQWdyZy9zL1NJOVdWUkE1dFM2WVpZTXp1ZWRhNlVpWTlDVGRhSldrbkpIQ3hDTklsZ0RkbE53Q0x4WjN1QlY2bjVEWjJscFRrdz09&brandId=fb8308e2-448a-4645-a5f6-a3632a7e57f4'
|
||||
$ECB_WIN_URL = 'https://console.msp360.com/api/build/download?urlParams=OEFsMzhldm1SbjhaSDhBc2VtYkpUREM3Y2pJSzg0REU4dkVtR1pHREkxMGFFUk9qZXJnSXk5SUF0ei8wZlZOWTBzNG1zVDV0ckVMdStZVzBsam5uZklMVnZLeTBMVmxGNWt4VDhSMzNIL3VNREJWUnRqSWdyb2p0Zk0rMEZNZndoMXB1cW45Mkt2SUJIaXl4WUxxK1ptTno2dWxZRVBHa1NFQ09uWmdiNHlTdG1pYk4waGVDbTdnUFBvZjljaHdud2FLSXlrM2gvZXZCNFM2TEFUTDdIZz09&brandId=fb8308e2-448a-4645-a5f6-a3632a7e57f4'
|
||||
|
||||
# Specify URL to "Backup Virtual Machine Edition" agent installer
|
||||
$ECB_VMM_URL = 'https://console.msp360.com/api/build/download?urlParams=OEFsMzhldm1SbjhaSDhBc2VtYkpUREM3Y2pJSzg0REU4dkVtR1pHREkxMGFFUk9qZXJnSXk5SUF0ei8wZlZOWUpYM2xDY3ErMkpOVGpuWTRISDNFcFRFdWRibDgvTm8vUDhpWndON3kzaHY4N0k0REdyU3pXSjI3L1F3UnA0Mjkvd3BoZlNMeVlJaG1ubHlsaFZwK3I2YWRGRVJvOXhlUms0UFFRQ0x3MW85dmJxdG1CV0FNMjBjVkJSRVVxSkdHQ3pWWnNhZEsrYUJvVTNNVmk0MHV6QT09&brandId=fb8308e2-448a-4645-a5f6-a3632a7e57f4'
|
||||
$ECB_VMM_URL = 'https://console.msp360.com/api/build/download?urlParams=OEFsMzhldm1SbjhaSDhBc2VtYkpUREM3Y2pJSzg0REU4dkVtR1pHREkxMGFFUk9qZXJnSXk5SUF0ei8wZlZOWUpYM2xDY3ErMkpOVGpuWTRISDNFcFRFdWRibDgvTm8vUDhpWndON3kzaHNVc21KTGQ2MW5GZytlelVjaUtscituamdvSGg0NnVmVnluN3dsQkZaU25hN3NIcWxzVWxLODhOcmJXMURBdVR1emZpWWlIK3daWXFjWFhJcno3eUJ3bFlWNEx5Qms4STVZVVJxemxNMHJXZz09&brandId=fb8308e2-448a-4645-a5f6-a3632a7e57f4'
|
||||
|
||||
# Set the correct download URL and agent edition
|
||||
switch ( $Edition.ToLower() ) {
|
||||
|
||||
@@ -589,7 +589,7 @@ Function Import-MSP360Module {
|
||||
Write-Output "Installing MSP360 Powershell module"
|
||||
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||
Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://git.io/JUSAA')
|
||||
Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/msp360/MSP360-PSModule/master/private/Install-MSP360Module.ps1')
|
||||
Install-MSP360Module
|
||||
Import-Module -Name MSP360
|
||||
}
|
||||
@@ -726,18 +726,18 @@ Function New-LocalAccount {
|
||||
}
|
||||
If ( $(Get-LocalUser -Name $Username -ErrorAction SilentlyContinue) ) {
|
||||
Write-Output "Updating user: ${Username}"
|
||||
Try { Set-LocalUser -Name "${Username}" -Password $SecurePassword -FullName "${FullName}" -Description "${Description}" -AccountNeverExpires -PasswordNeverExpires }
|
||||
Catch { Write-Error $_.Exception.Message ; Exit }
|
||||
Try { Set-LocalUser -Name "${Username}" -Password $SecurePassword -FullName "${FullName}" -Description "${Description}" -AccountNeverExpires -PasswordNeverExpires | Out-Null }
|
||||
Catch { Write-Error "Could not update user`n"+$_.Exception.Message ; Exit }
|
||||
}
|
||||
Else {
|
||||
Write-Output "Creating user: ${Username}"
|
||||
Try { New-LocalUser -Name "${Username}" -Password $SecurePassword -FullName "${FullName}" -Description "${Description}" -AccountNeverExpires -PasswordNeverExpires }
|
||||
Catch { Write-Error $_.Exception.Message ; Exit }
|
||||
Try { New-LocalUser -Name "${Username}" -Password $SecurePassword -FullName "${FullName}" -Description "${Description}" -AccountNeverExpires -PasswordNeverExpires | Out-Null }
|
||||
Catch { Write-Error "Could not create user`n"+$_.Exception.Message ; Exit }
|
||||
}
|
||||
If ( (-not($(Get-LocalGroupMember -Group "Administrators" -Member $Username -ErrorAction SilentlyContinue))) -and $MakeAdmin ) {
|
||||
Write-Output "Adding ""${Username}"" to local Administrators group"
|
||||
Try { Add-LocalGroupMember -Name "Administrators" -Member $(Get-LocalUser -Name "${Username}") }
|
||||
Catch { Write-Error $_.Exception.Message ; Exit }
|
||||
Catch { Write-Error "Could not add user to Administrators group`n"+$_.Exception.Message ; Exit }
|
||||
}
|
||||
If ( $Hide ) {
|
||||
$RegPath = "HKLM:SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList"
|
||||
|
||||
Reference in New Issue
Block a user