Hello ! I have to create a lot of users for VPN SSL portals. I want to script the creation of this users. No difficulty to create account. But, how can I add an account to a user-groups by CLI ? In advance, thank's for your help ! :) Thierry
Nominating a forum post submits a request to create a new Knowledge Article based on the forum post topic. Please ensure your nomination includes a solution within the reply.
A while ago I've posted a batch command file (Windows) for creating a command file from a list of IPs. Maybe this can help: [link]https://forum.fortinet.com/tm.aspx?m=102532[/link]
It shouldn't be too difficult to adapt this to creating local users and user groups. Note that there is a limit for the number of users per group (Maximum Values matrix).
To get the correct syntax, create a backup textfile and search for "usergrp".
Thank you for your help ede_pfau. I already use python to generate all my commands line. Note : my request concerns local users only.
Hi ! Problem solved : # config user group # edit <group_name> # set member <member_name>
That's what I meant - syntax is documented in each backup file. I thought it was obvious (OK, "usergrp" <> "user group").
Becareful with the set command and adding users to a existing group. A better method if the group is already "created" is to use the append member option. This will add that new "user" to the existing member list.
I see scripter failure to notice this and drop various users when editing the group ;)
PCNSE
NSE
StrongSwan
Thank you Emnoc for the tip. This option can be use with all objects ?
It's useful for address groups , user groups, and fwpolicy for source interfaces or address.
The opposite command for removing just "one" object is the unselect member < membername(s)>
e.g
config user group
edit RWarriors
unselect member kenfelix
end
or if you had a string of userss;
config user group
edit RWarriors
unselect member kenfelix user2 user3 user4 user5
end
Hope that helps
PCNSE
NSE
StrongSwan
Select Forum Responses to become Knowledge Articles!
Select the “Nominate to Knowledge Base” button to recommend a forum post to become a knowledge article.
User | Count |
---|---|
1547 | |
1031 | |
749 | |
443 | |
210 |
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2024 Fortinet, Inc. All Rights Reserved.