Usuario
Scrprit noValida 64bits

Pregunta
-
Buenas tardes compañeros estoy intentando hacer una instalación masiva de antivirus pero algo va muy mal en mi script ya que siempre ejecuta determina que el windows que estoy usando es de 32bits, alguien de este foro me puede ayudar. pongo una copia.
Write-Host "Site Token is " $SiteCode
Write-Host "Ok. Sit back and relax as SentinelOne is installed on your machine."
$S1_registry_path="HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sentinel Agent\"
$InstallCommand64='c:\Install\SentinelOne\SentinelInstaller-x64_windows_64bit_v4_0_3_53.exe /Q /SITE_TOKEN=$SiteCode "c:\Installs\SentinelOne\"'
$InstallCommand32='c:\Install\SentinelOne\SentinelInstaller-x86_windows_32bit_v4_0_3_53.exe /Q /SITE_TOKEN=$SiteCode "c:\Installs\SentinelOne\"'
Write-Host ([System.Environment]::OSVersion.Version.Major)
Write-Host ([System.Environment]::OSVersion.Version.Minor)
if (!(Test-Path $S1_registry_path)) {
if ((gwmi win32_operatingsystem | select osarchitecture).osarchitecture -eq "64-bit")
{
#64 bit logic here
Write-Host "Wow! You have a 64-bit OS! That's pretty awesome."
If (([System.Environment]::OSVersion.Version.Major -eq 10) -OR ([System.Environment]::OSVersion.Version.Major -eq 6 -AND [System.Environment]::OSVersion.Version.Minor -ge 2))
{
Write-Host "And you have a non-legacy version of windows. Even better!"
Invoke-Expression $InstallCommand64
}
else
{
Write-Host "And you have a legacy version of windows. Thats ok, I won't hold that against you."
switch -Wildcard ($Hostname)
{
'us01*' {$InstallCommand64Legacy='c:\Install\SentinelOne\SentinelOne-x64_windows_legacy_v2_0_0_79_us01.exe'}
'us02*' {$InstallCommand64Legacy='c:\Install\SentinelOne\SentinelOne-x64_windows_legacy_v2_0_0_79_us02.exe'}
'us03*' {$InstallCommand64Legacy='c:\Install\SentinelOne\SentinelOne-x64_windows_legacy_v2_0_0_79_us03.exe'}
'us04*' {$InstallCommand64Legacy='c:\Install\SentinelOne\SentinelOne-x64_windows_legacy_v2_0_0_79_us04.exe'}
'mx01*' {$InstallCommand64Legacy='c:\Install\SentinelOne\SentinelOne-x64_windows_legacy_v2_0_0_79_mx01.exe'}
'mx02*' {$InstallCommand64Legacy='c:\Install\SentinelOne\SentinelOne-x64_windows_legacy_v2_0_0_79_mx02.exe'}
'uk01*' {$InstallCommand64Legacy='c:\Install\SentinelOne\SentinelOne-x64_windows_legacy_v2_0_0_79_uk01.exe'}
'de01*' {$InstallCommand64Legacy='c:\Install\SentinelOne\SentinelOne-x64_windows_legacy_v2_0_0_79_de01.exe'}
'de02*' {$InstallCommand64Legacy='c:\Install\SentinelOne\SentinelOne-x64_windows_legacy_v2_0_0_79_de02.exe'}
'rs01*' {$InstallCommand64Legacy='c:\Install\SentinelOne\SentinelOne-x64_windows_legacy_v2_0_0_79_rs01.exe'}
}
Invoke-Expression $InstallCommand64
}
}
else
{
#32 bit logic here
Write-Host "ewwww... You have a 32-bit OS. Thats kinda lame. Oh well its a good thing we have a 32 bit version!"
If (([System.Environment]::OSVersion.Version.Major -eq 10) -OR ([System.Environment]::OSVersion.Version.Major -eq 3 -AND [System.Environment]::OSVersion.Version.Minor -ge 2))
{
Write-Host "And you have a non-legacy version of windows. Even better!"
Invoke-Expression $InstallCommand32
}
else
{
Write-Host "And you have a legacy version of windows. Thats ok, I won't hold that against you."
switch -Wildcard ($Hostname)
{
'us01*' {$InstallCommand32Legacy='c:\Install\SentinelOne\SentinelOne-win32_windows_legacy_v2_0_0_79_us01.exe'}
'us02*' {$InstallCommand32Legacy='c:\Install\SentinelOne\SentinelOne-win32_windows_legacy_v2_0_0_79_us02.exe'}
'us03*' {$InstallCommand32Legacy='c:\Install\SentinelOne\SentinelOne-win32_windows_legacy_v2_0_0_79_us03.exe'}
'us04*' {$InstallCommand32Legacy='c:\Install\SentinelOne\SentinelOne-win32_windows_legacy_v2_0_0_79_us04.exe'}
'mx01*' {$InstallCommand32Legacy='c:\Install\SentinelOne\SentinelOne-win32_windows_legacy_v2_0_0_79_mx01.exe'}
'mx02*' {$InstallCommand32Legacy='c:\Install\SentinelOne\SentinelOne-win32_windows_legacy_v2_0_0_79_mx02.exe'}
'uk01*' {$InstallCommand32Legacy='c:\Install\SentinelOne\SentinelOne-win32_windows_legacy_v2_0_0_79_uk01.exe'}
'de01*' {$InstallCommand32Legacy='c:\Install\SentinelOne\SentinelOne-win32_windows_legacy_v2_0_0_79_de01.exe'}
'de02*' {$InstallCommand32Legacy='c:\Install\SentinelOne\SentinelOne-win32_windows_legacy_v2_0_0_79_de02.exe'}
'rs01*' {$InstallCommand32Legacy='c:\Install\SentinelOne\SentinelOne-win32_windows_legacy_v2_0_0_79_rs01.exe'}
}
Invoke-Expression $InstallCommand32
}
}
} else {Write-Host "SentinelOne Installed."}
Start-Sleep 2
switch -Wildcard ($Hostname) {
'us01*' {$CB_UninstallCode = 'D3ZR6R44'}
'us02*' {$CB_UninstallCode = 'D3ZR6R44'}
'us03*' {$CB_UninstallCode = 'D3ZR6R44'}
'us04*' {$CB_UninstallCode = 'D3ZR6R44'}
'mx01*' {$CB_UninstallCode = 'D3ZR6R44'}
'mx02*' {$CB_UninstallCode = 'D3ZR6R44'}
'uk01*' {$CB_UninstallCode = 'SD3L14MB'}
'de01*' {$CB_UninstallCode = 'SD3L14MB'}
'de02*' {$CB_UninstallCode = 'SD3L14MB'}
'rs01*' {$CB_UninstallCode = 'SD3L14MB'}
'cn*' {$CB_UninstallCode = '9LLYJF1K'}
}
Write-Host "Your CB Uninstal Code is " $CB_UninstallCode
Write-Host "Uninstalling CB"
$CB_registry_path="HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{94D18106-D148-4E20-8183-6E01317E82D5}\"
if ((Test-Path $CB_registry_path)) {
& 'c:\Program Files\Confer\uninstall.exe' /uninstall $CB_UninstallCode
Write-Host "Ran CB Uninstall Command"
}