Last active
March 27, 2020 05:40
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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