Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested answer

Convert-PermissionSets

(0) ShareShare
ReportReport
Posted on by 10

Downloading Symbols from TESTINGSERVER Demo Database BC (21-0)
Invoke-Sqlcmd : Cannot open database "Demo Database BC (21-0)" requested by the login. The login failed.
Login failed for user 'ANANTSO\fs0539'.
At C:\Users\fs0539\Documents\Downloads\PermissionSetConversion\Convert-PermissionSets.psm1:499 char:13
+ $Apps = Invoke-Sqlcmd -ServerInstance $DatabaseServer -Database $ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Invoke-Sqlcmd], SqlException
+ FullyQualifiedErrorId : SqlExectionError,Microsoft.SqlServer.Management.PowerShell.GetScriptCommand

Invoke-Sqlcmd :
At C:\Users\fs0539\Documents\Downloads\PermissionSetConversion\Convert-PermissionSets.psm1:499 char:13
+ $Apps = Invoke-Sqlcmd -ServerInstance $DatabaseServer -Database $ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ParserError: (:) [Invoke-Sqlcmd], ParserException
+ FullyQualifiedErrorId : ExecutionFailureException,Microsoft.SqlServer.Management.PowerShell.GetScriptCommand

You cannot call a method on a null-valued expression.
At C:\Users\fs0539\Documents\Downloads\PermissionSetConversion\Convert-PermissionSets.psm1:502 char:17
+ ... $Apps | % { $_.Name = $_.Name.Replace('_Exclude_', '').TrimEnd('_')}
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

Proccessing Symbols
Quering permissions from TESTINGSERVER Demo Database BC (21-0)
Invoke-Sqlcmd : Cannot open database "Demo Database BC (21-0)" requested by the login. The login failed.
Login failed for user 'ANANTSOL\fs0539'.
At C:\Users\fs0539\Documents\Downloads\PermissionSetConversion\Convert-PermissionSets.psm1:518 char:20
+ ... rmissions = Invoke-Sqlcmd -ServerInstance $DatabaseServer -Database $ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Invoke-Sqlcmd], SqlException
+ FullyQualifiedErrorId : SqlExectionError,Microsoft.SqlServer.Management.PowerShell.GetScriptCommand

Invoke-Sqlcmd :
At C:\Users\fs0539\Documents\Downloads\PermissionSetConversion\Convert-PermissionSets.psm1:518 char:20
+ ... rmissions = Invoke-Sqlcmd -ServerInstance $DatabaseServer -Database $ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ParserError: (:) [Invoke-Sqlcmd], ParserException
+ FullyQualifiedErrorId : ExecutionFailureException,Microsoft.SqlServer.Management.PowerShell.GetScriptCommand
Convert-PermissionSets -DatabaseServer TESTINGSERVER -DatabaseName "Demo Database BC (21-0)" -Destination "C:\Users\Documents\Downloads\PermissionSetConversion"

After putting above command I'm getting below error please help me to resove this error.

Invoke-Sqlcmd : Cannot open database "Demo Database BC (21-0)" requested by the login. The login failed.
Login failed for user 'ANANTSOL\fs0539'.
At C:\Users\fs0539\Documents\Downloads\PermissionSetConversion\Convert-PermissionSets.psm1:558 char:34
+ ... leContent = Invoke-Sqlcmd -ServerInstance $DatabaseServer -Database $ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Invoke-Sqlcmd], SqlException
+ FullyQualifiedErrorId : SqlExectionError,Microsoft.SqlServer.Management.PowerShell.GetScriptCommand

Invoke-Sqlcmd :
At C:\Users\fs0539\Documents\Downloads\PermissionSetConversion\Convert-PermissionSets.psm1:558 char:34
+ ... leContent = Invoke-Sqlcmd -ServerInstance $DatabaseServer -Database $ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ParserError: (:) [Invoke-Sqlcmd], ParserException
+ FullyQualifiedErrorId : ExecutionFailureException,Microsoft.SqlServer.Management.PowerShell.GetScriptCommand

WritePermissionSets : Cannot validate argument on parameter 'PermissionSets'. The argument is null, empty, or an element of the argument
collection contains a null value. Supply a collection that does not contain any null values and then try the command again.
At C:\Users\fs0539\Documents\Downloads\PermissionSetConversion\Convert-PermissionSets.psm1:559 char:25
+ WritePermissionSets $PermissionSets $Destination $PermissionSetTa ...
+ ~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [WritePermissionSets], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationError,WritePermissionSets

  • Faisel Ahmad Profile Picture
    Faisel Ahmad 10 on at
    RE: Convert-PermissionSets

    yes

  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 77,925 Super User 2025 Season 1 on at
  • Suggested answer
    Inge M. Bruvik Profile Picture
    Inge M. Bruvik 997 Moderator on at
    RE: Convert-PermissionSets

    Are this user :ANANTSO\fs0539 - db owner in the database you are trying to access?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,494 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,307 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans