Skip to main content

Notifications

Announcements

No record found.

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 74,115 Super User 2024 Season 2 on at
  • Suggested answer
    Inge M. Bruvik Profile Picture
    Inge M. Bruvik 32,748 Super User 2024 Season 1 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,391 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans