Unable to open the connection

If I give above it throws an error like below

Exception calling open with 0 arguments: input string was not in a correct format

@Kesava Welcome to PowerShell.org forums

To understand above error and why it fails you will have to share more code above it to understand what is $conn variable.

Please find the Code below:
how to connect to oracle server using kerberos account from Powershell.
I am getting connection open error, like below

let me write my script here which is in Powershell.

H:\kerberos\kinit.exe -f -k -t H:\kerberos\keytab\uat\abcd.keytab a_pday_b@exchad.abcd.net
add-type -path "C:............\oracle.manageddataaccess.dll"
$env = 'abcd' (abcd is the username)
$datasource = "here my hostname..."
$conn = new-object oracle.manageddataaccess.client.oracleconnection
$conn.connectionstring = "data source=$datasource;user id=/;"
$conn.open() # in this line I am getting error

$command = new-object oracle.manageddataaccess.client.oraclecommand
$command.connection = $conn
$command.commandtype = [system.data.commandtype]::text

$oraclequery = "select name from dual;"

$result = $command.commandtext = #oraclequery

$result = $command.executereader() # getting same error here also

write-host "done"

trying to executing above script in Powershell and I am getting below error:

exception calling “open” with “0” argument(s): “input string was not in a correct format.”

Your connection string is pretty basic so it’s unlikely, I think, to actually be a problem with the connection string.

Have you reviewed this thread on Stack Overflow. There are possible workarounds on there:


Had this script ever worked? If not, do you know if the “oracle.manageddataaccess.client.oracleconnection” object requires more than “connectionstring”? It may be worth doing Get-Member on the variable and looking through the Properties.

$conn | get-member