Bài viết này hướng dẫn import config SSL Vpn vào Sophos connect bằng Provision file. File provision được upload lên onedrive để có thể download được từ bất cứ đâu.
1 Upload file config ssl vpn lên Onedrive.
![](https://uploads.thegioifirewall.com/image-5250.png)
Upload file config.pro lên Onedrive và chỉnh quyền truy cập để cho phép truy cập file từ đường link fshare
![](https://uploads.thegioifirewall.com/image-5251.png)
Chuột phải vào file và chọn nhúng hoặc embedded để lấy mã nhúng, sau đó trong mục src= ta có đường link đường link như trên.
Sau khi có được link, ta thay chữ embed thành download, ví dụ như link ở trên như sau:
https://onedrive.live.com/embed?resid=B1E37D033F50D6DD%21124&authkey=!ACt92S94PZRJTtk
https://onedrive.live.com/download?resid=B1E37D033F50D6DD%21124&authkey=!ACt92S94PZRJTtk
Cách kiểm tra đường link hoạt động hay chưa là truy cập link đó bằng trình duyệt thì file sẽ được download.
Vậy là ta đã có 1 link download trực tiếp file từ onedrive
2 Script download và import file vào Sophos connect.
Ta có đoạn script powershell như sau
$onedriveFileUrl = "https://onedrive.live.com/download?resid=B1E37D033F50D6DD%21124&authkey=!ACt92S94PZRJTtk"
$localFilePath = "$($env:USERPROFILE)\Downloads\config.pro"
Invoke-WebRequest -Uri $onedriveFileUrl -OutFile $localFilePath
Start-Process -FilePath "$($env:USERPROFILE)\Downloads\config.pro"
Start-Sleep -Seconds 10
Remove-Item "$($env:USERPROFILE)\Downloads\config.pro"
Trong đó:
- $onedriveFileUrl: là đường dẫn file download của Onedrive
- $localFilePath: là đường dẫn lưu file, ví dụ ở đây lưu ở thư mục Download với name là config2.pro
- Start-Process -FilePath: lệnh này để chạy file vừa download khi nãy, file lúc nãy down ở trong thư mục Dowload
Lưu file lại thành .ps1 và sau đó run file powershell này hoặc dùng gpo deploy powershell script xuống máy user.
![](https://uploads.thegioifirewall.com/image-5252.png)
Sau khi chạy script xong. Kiểm ra lại trong Sophos connect, config đã được import
![](https://uploads.thegioifirewall.com/image-5253.png)