Skip to main content

Notifications

Business Central forum
Suggested answer

User Permissions - On Premise

editSubscribe (0) ShareShare
ReportReport
Posted on by 22
Hi Everyone

I am busy uploading a large amount of Users for a Business Central On Prem instance, using a script I run in PowerShell ISE.
 
foreach ($User in $Users) 
{
$FullName = $User.'FullName'
$Login = $User.'Login'
$Email = $User.'Email'
$PermissionSetId = $User.'PermissionSet'
$CompanyName = $User.'Company'
 

New-NavServerUser -ServerInstance BC220 -WindowsAccount $Login -FullName /$FullName/ -AuthenticationEmail /$Email/ -LanguageId 1033 -Force -Tenant cbzg -State Enabled
#Command To create a new Users
New-NAVServerUserPermissionSet -ServerInstance BC220 -WindowsAccount $Login -PermissionSetId $PermissionSetId -CompanyName $CompanyName -Force -Tenant cbzg
#Command to assign a permission set to a User
}
 
The script successfully creates the Users and assigns some of the permissions to the users - however I get the following error for some of the fields:

New-NAVServerUserPermissionSet : The Aggregate Permission Set does not exist. Identification fields and values: Scope='System',App 
ID='{00000000-0000-0000-0000-000000000000}',Role ID='D365 ACCOUNTANTS'
At C://Users/badenhorst//Desktop//User Import Script - ON PREMISE.ps1:21 char:1
+ New-NAVServerUserPermissionSet -ServerInstance BC220 -WindowsAccount  ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (0:Int32) [New-NAVServerUserPermissionSet], FaultException`1
    + FullyQualifiedErrorId : MicrosoftDynamicsNavServer$BC220/cbzg,Microsoft.Dynamics.Nav.Management.Cmdlets.NewNavServerUserPermissionSet
 
 
I'm not sure why the error specifies that the permission set does not exist - I used the name as it appears in the environment.

If anyone can see where I missed something it would be appreciated.

Thank You!
 
 
Categories:
  • Suggested answer
    HVGEEL Profile Picture
    HVGEEL 286 on at
    User Permissions - On Premise
    the GUID for the Permission set is empty: is says ID='{00000000-0000-0000-0000-000000000000}'
     
    That appears to be some kind of NullPointer. 
    You are using the name 365 ACCOUNTANTS, but with a non-existing ID
  • gdrenteria Profile Picture
    gdrenteria 3,108 Super User on at
    User Permissions - On Premise

Helpful resources

Quick Links

Take the Community feedback survey!

Answer this brief 15-question survey about your Community experience…

Demystifying Copilot: Service Edition with Sundar Raghavan

Sundar answers more questions about Copilot for Service...

Dynamics 365 Business Central vs Finance and SCM

Take a look at the key differences between Business Central and…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,375 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 223,308 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,140

Featured topics

Product updates

Dynamics 365 release plans