Skip to content

Instantly share code, notes, and snippets.

@christaylorcodes
Last active March 27, 2020 05:40
Show Gist options
  • Select an option

  • Save christaylorcodes/0e00bc694a4997232cae320342355544 to your computer and use it in GitHub Desktop.

Select an option

Save christaylorcodes/0e00bc694a4997232cae320342355544 to your computer and use it in GitHub Desktop.
Sudo code as an example of creating agents for each user and emailing them their config.
Import-Module VeeamPN
$AllUsers = Get-ADUser -Filter * -Properties emailaddress
Connect-VeeamPN -VeeamPNServer $VeeamPNServer -Credential $Credentials
$Clients = Get-VeeamPNClient
foreach($User in $UserList){
$Result = New-VeeamPNClient -ClientName $User.EmailAddress
$ConfigPath = Get-VeeamPNClientConfig -ID $Result.id -OutputPath $ConfigDirectory
Update-VeeamPNConfig -Config $ConfigPath -Routes $Routes -DNS $DNS
Send-MailMessage -To $User.EmailAddress -from $From -Subject 'VeeamPN!' -Attachments $ConfigPath -Body $Body -SmtpServer $SMTPServer
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment