on ‎2025 May 09 5:07 PM
Hi all,
old topic maybe, but with a new twist...
I have an SAP system with an oracle database on windows that I can connect to from the command line as sidadm just fine:
sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Fri May 9 17:52:12 2025
Version 19.14.0.0.0
Copyright (c) 1982, 2021, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.14.0.0.0
SQL>
If I try the same from a powershell script, I am getting ora-1017:
$AdminDomain = 'host'
$AdminUsername = 'sidadm'
$AdminPassword = 'password'
$credential = New-Object System.Management.Automation.PSCredential @(($AdminDomain + "\" + $AdminUsername), (ConvertTo-SecureString -String $AdminPassword -AsPlainText -Force))
Invoke-Command -Credential $credential -ComputerName localhost -ScriptBlock { get-childitem env:
sqlplus -S / as sysdba }
Resulting output:
Name Value PSComputerName
---- ----- --------------
DBMS_TYPE ora localhost
dbs_ora_schema SAPSR3 localhost
dbs_ora_tnsname SID localhost
NLS_LANG AMERICAN_AMERICA.UTF8 localhost
ORACLE_HOME F:\oracle\SID\19.0.0 localhost
ORACLE_SID SID localhost
PSModulePath C:\Users\sidadm\Documents\WindowsPowerShell\Modules;C:\Prog... localhost
PUBLIC C:\Users\Public localhost
rsdb_ssfs_connect 1 localhost
RSEC_SSFS_DATAPATH \\host\sapmnt\SID\SYS\global\security\rsecssfs\data localhost
RSEC_SSFS_KEYPATH \\host\sapmnt\SID\SYS\global\security\rsecssfs\key localhost
SAP_DIR_PERF F:\usr\sap\PRFCLOG localhost
SAPDATA_HOME K:\oracle\SID localhost
SAPEXE F:\usr\sap\SID\SYS\exe\uc\NTAMD64 localhost
SAPLOCALHOST host localhost
SAPSYSTEMNAME SID localhost
...
TNS_ADMIN \\host\sapmnt\SID\SYS\profile\oracle localhost
ERROR:
ORA-01017: invalid username/password; logon denied
a tnsping with invoke-command shows that I am connecting to the correct host and database.
Enabling audit trail creates no audit file for failed logins.
Enabling client trace in sqlnet.ora writes a trace file whenever sqlplus is invoked from the command line but not with invoke-command from powershell.
Any ideas ?
Request clarification before answering.
When you are logging on with SQLPLUS, you use the OPS$ connection method. With the POWERSHELL script, you are using username/password combination.
Please check these SAP notes:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 12 | |
| 9 | |
| 7 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.