Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $path = "$env:temp\installs"
- if (!(test-path $path)) {
- New-Item -Path $path -ItemType Directory
- }
- Start-Transcript -Path "$path\screenconnect.log"
- Write-host "Setting variables"
- $company = [uri]::EscapeDataString($env:NINJA_ORGANIZATION_NAME)
- $location = [uri]::EscapeDataString($env:NINJA_LOCATION_NAME)
- $url = "https://YOURSCREENCONNECTURL/Bin/ScreenConnect.ClientSetup.msi?e=Access&y=Guest&c=$($company)&c=$($location)&c=&c=&c=&c=&c=&c="
- $file = "$path\connect.msi"
- Write-host "Downloading installer for $company $location from $url and saving at $file"
- [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
- try {
- (New-Object System.Net.WebClient).DownloadFile($url, $file)
- } catch {
- Write-Host $_.exception.Message
- }
- write-host "Installing $file with msiexec"
- try {
- msiexec /i $file /qn
- } catch {
- Write-Host $_.exception.Message
- }
- Stop-Transcript
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement