Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • $ComputerList = "QWS_CLIENT1","QWS_CLIENT_2"

    foreach ($Computer in $ComputerList)
    {
    Invoke-Command -ComputerName $Computer
    {
    iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
    choco install PACKAGE_NAME -y
    }
    }

  • Making the command: Invoke-Command (ScriptBlock above) -credential Administrator


Adding multiple machines to a domain at the same time

Image Added



From the CSP portal, the Export Reverse Proxy button will generate a text file with all of the currently registered QWS Endpoints. Using this text file and the FRP channel, administrators can automate joining all of these endpoints to the domain in a few different ways, depending on corporate network structure.

Scripting logins to each entry on the exported list, and using pssh to execute the powershell command "$env:computername" will generate a list of machines names for each successful connection. If the names are discoverable between the VPN subnet and the domain server, one command can be executed to join them all at once.

With this list, in Powershell run these commands:

$computers = Get-Content -Path computers.txt
Add-Computer -ComputerName $computers -Domain "YourDomainName" -Restart

Alternatively, if the machine names are not discoverable, running pssh and executing the Powershell command below will join each machine to the domain as a connection is established over the FRP channel, and restart the VM:
Add-Computer –domainname "YourDomainName"  -Restart