Perhaps the code in PRKernel>>adminUser might help
How do I recover the admin's password?
I tried adding a user but couldn't make it a superuser.
k := PRKernel allInstances.
myKernel := k at:1
u := (PUUser named: 'newName') password: 'newPassword'.
(myKernel propertyAt: #users) add: u.
u addGroup: adminGroup. "error"
u superuser: true. "this doesn't work"
Magritte, Pier and Related Tools ...