Page 1 of 1
Managing user on several server. How to import user
Posted: Mon Oct 28, 2013 1:04 am
by Ardy7201
i have 2-5 vpn server with diffrent location server.
let say, in this picture, i have 25 user on the hub :
http://prntscr.com/207bnm
so, i want the same 25user, in another server. how to import them?
Re: Managing user on several server. How to import user
Posted: Mon Oct 28, 2013 5:45 am
by inten
Hi.
You need a script :) That script will export them and import them back to all of your servers. Or you can use our VPN management solution that will be publicly available by the end of the year.
Re: Managing user on several server. How to import user
Posted: Mon Oct 28, 2013 7:44 am
by Ardy7201
inten wrote:
> Hi.
> You need a script :) That script will export them and import them back to
> all of your servers. Or you can use our VPN management solution that will
> be publicly available by the end of the year.
is it free? waiting your VPN management...
Re: Managing user on several server. How to import user
Posted: Mon Oct 28, 2013 11:17 am
by inten
Ardy7201 wrote:
> inten wrote:
> > Hi.
> > You need a script :) That script will export them and import them back to
> > all of your servers. Or you can use our VPN management solution that will
> > be publicly available by the end of the year.
Here is s small code to copy users from one server to another. But you cannot copy passwords, again you need a management solution.
$SourceServer = "From Server IP"
$SourceHub = "FROM HUB"
$SourcePassword = "FROM HUB PASSWORD"
$DestServer = "To Server IP"
$DestHub = "DESTINATION HUB"
$DestPassword = "DESTINATION HUB PASSWORD"
$result = Invoke-Expression -command "vpncmd /server $SourceServer /hub:$SourceHub /password:$SourcePassword /cmd:UserList"
$regex = new-object System.Text.RegularExpressions.Regex("User Name\s*\|\s*(.*?)\s")
foreach($match in $regex.Matches($result))
{
$username = $match.Groups[1].Value
$result = Invoke-Expression -command "vpncmd /server $DestServer /hub:$DestHub /password:$DestPassword /cmd:UserCreate $username /group: /realname: /note:"
Write-Host $result
Write-Host
}