Managing user on several server. How to import user

Post your questions about SoftEther VPN software here. Please answer questions if you can afford.
Post Reply
Ardy7201
Posts: 18
Joined: Sun Oct 20, 2013 6:58 am

Managing user on several server. How to import user

Post by Ardy7201 » Mon Oct 28, 2013 1:04 am

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?

inten
Posts: 370
Joined: Fri Oct 18, 2013 8:15 am
Location: All around the world
Contact:

Re: Managing user on several server. How to import user

Post by inten » Mon Oct 28, 2013 5:45 am

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.
When you don't like the answer, change the question.
Cheers,
Team.

VPNHPanel.com
This account is not associated to SoftEther project.

Ardy7201
Posts: 18
Joined: Sun Oct 20, 2013 6:58 am

Re: Managing user on several server. How to import user

Post by Ardy7201 » Mon Oct 28, 2013 7:44 am

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...

inten
Posts: 370
Joined: Fri Oct 18, 2013 8:15 am
Location: All around the world
Contact:

Re: Managing user on several server. How to import user

Post by inten » Mon Oct 28, 2013 11:17 am

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
}
When you don't like the answer, change the question.
Cheers,
Team.

VPNHPanel.com
This account is not associated to SoftEther project.

Post Reply