Import-Module PS_OPNsenseConnect-OPNsense -Url $url -Credential $apicredential -SkipCertificateCheck# Import users from CSV file$users = Import-Csv -Path U:\opnsense\passwords.csv# Loop the usersforeach ($user in $users) { # Build the Freeradius user JSON string $json = '{{ "user": {{ "enabled": 1, "password": "{0}", "username": "{1}" }} }}' -f $user.password, $user.username # Invoke the API call to create the user Invoke-OPNsenseCommand -Module freeradius -Controller user -Command adduser -Json $json -Method POST}# List all the Freeradius usersGet-OPNsenseItem -Freeradius UserDisconnect-OPNsense
Still, you could point a new Auth Server to the internal FreeRADIUS plugin and use it for system authentication.