03-04-2020 09:39 AM
Hi everyone,
for automation purposes, I want that every user on a Win 2012 machine with NetBackup 8.1.2 can do SQL restore via command line using dbbackex command.
I observed that, if a user ("Y0001" in this case) has never done access to NetBackup MS SQL Client on the client and never set userid and password (typically "sa") for the SQL instance, dbbackex fails with this error:
18:06:46.669 [10912.356] <4> CDBIniParms::CDBIniParms: INF - NT User is Y0001
18:06:48.732 [10912.356] <16> DB_CryptAcquireContext: ERR - Error in CryptAcquireContext : 2148074309.
18:06:48.732 [10912.356] <1> DB_CryptAcquireContext: CONTINUATION: - The requested operation cannot be completed. The computer must be trusted for delegation and the current user account must be configured to allow delegation.
When NT User Y0001 runs NetBackup SQL Agent and set for the first time userid and password, dbbackex ends fine
I need that other users could run dbbackex command, without setting userid and password in NetBackup MS SQL Client
Thanks in advance
db
Solved! Go to Solution.
03-13-2020 01:55 AM - edited 03-13-2020 01:56 AM
Ok, I seen that a user that has never set SQL username and password with NetBackup SQL Client, doesn't have this key registry:
"HKCU:\Software\Veritas\NetBackup\NetBackup for Microsoft SQL Server"
So I said to my PS script to check for the key and to create it if it doesn't exist, adding to the regkey the SQL properties that are needed for the access to the instance
$REGKEY_CHECK = Test-Path -Path "HKCU:\Software\Veritas\NetBackup" if (-not $REGKEY_CHECK) { $REGKEY_PATH = "HKCU:\Software\Veritas\NetBackup" $REGKEY_NAME = "NetBackup for Microsoft SQL Server" New-Item -Force -Path $REGKEY_PATH -Name $REGKEY_NAME New-ItemProperty -Path "$REGKEY_PATH\$REGKEY_NAME" -Name "DEFAULT_SQL_HOST" -Value $TARGETCLIENT New-ItemProperty -Path "$REGKEY_PATH\$REGKEY_NAME" -Name "DEFAULT_SQL_INSTANCE" -Value $TARGETINSTANCE New-ItemProperty -Path "$REGKEY_PATH\$REGKEY_NAME" -Name "DEFAULT_SQL_NB_MASTER_SERVER" -Value $NBU_MASTER New-ItemProperty -Path "$REGKEY_PATH\$REGKEY_NAME" -Name "DEFAULT_SQL_STANDARD_USERID" -Value "sa" } else { }
03-05-2020 04:36 AM
Hello,
it is not probably possible, a user must login at least once - for example look here: https://www.veritas.com/support/en_US/article.100032299.
Also note that a user must have sysadmin role in SQL instance to pefrom restores.
Regards
Michal
03-06-2020 01:32 AM
I'm wondering if there is a way to set SQL instance credentials from command line
db
03-13-2020 01:55 AM - edited 03-13-2020 01:56 AM
Ok, I seen that a user that has never set SQL username and password with NetBackup SQL Client, doesn't have this key registry:
"HKCU:\Software\Veritas\NetBackup\NetBackup for Microsoft SQL Server"
So I said to my PS script to check for the key and to create it if it doesn't exist, adding to the regkey the SQL properties that are needed for the access to the instance
$REGKEY_CHECK = Test-Path -Path "HKCU:\Software\Veritas\NetBackup" if (-not $REGKEY_CHECK) { $REGKEY_PATH = "HKCU:\Software\Veritas\NetBackup" $REGKEY_NAME = "NetBackup for Microsoft SQL Server" New-Item -Force -Path $REGKEY_PATH -Name $REGKEY_NAME New-ItemProperty -Path "$REGKEY_PATH\$REGKEY_NAME" -Name "DEFAULT_SQL_HOST" -Value $TARGETCLIENT New-ItemProperty -Path "$REGKEY_PATH\$REGKEY_NAME" -Name "DEFAULT_SQL_INSTANCE" -Value $TARGETINSTANCE New-ItemProperty -Path "$REGKEY_PATH\$REGKEY_NAME" -Name "DEFAULT_SQL_NB_MASTER_SERVER" -Value $NBU_MASTER New-ItemProperty -Path "$REGKEY_PATH\$REGKEY_NAME" -Name "DEFAULT_SQL_STANDARD_USERID" -Value "sa" } else { }