Convert-PermissionSets -DatabaseServer TESTINGSERVER -DatabaseName "Demo Database BC (21-0)" -Destination "C:\Users\Documents\Downloads\PermissionSetConversion\Convert-PermissionSets"
after putting above command I'm getting this error Please help me to resolve this.
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
Hi, I agree with Franz, from the information below, your user does not have permission to log into this database.
Invoke-Sqlcmd : Cannot open database "Demo Database BC (21-0)" requested by the login. The login failed.
Login failed for user 'ANANTSOL\fs0539'.
More about Convert permission sets into AL object: https://yzhums.com/12194/
And, from BC21, you can use new command to generate or update AL permission set directly.
More details: https://yzhums.com/29221/
Hope this helps as well.
Thanks.
ZHU
check if user 'ANANTSO\fs0539' has access to db "Demo Database BC (21-0)".
also follow www.sqlservercentral.com/.../invoke-sqlcmd-cannot-open-database-requested-by-the-login-login-login-failed
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,188 Super User 2024 Season 2
Martin Dráb 230,030 Most Valuable Professional
nmaenpaa 101,156