Automatically create ODBC DSN connection with special port and password. Add-OdbcDsn cmdlet

Hi,
I first posted a question in the SQL forum but I'm posting it here instead because its a Powershell question.
In a non-persitent VDI enviroment we are trying to automatically create a ODBC DSN connection to a SQL server.
We are using Windows 8.1 so we also have Powershell 4 together with the add-odbcdsn cmdlet. 
But when trying to add set -SetPropertyValue for network port different than default and a password we get an error.
here is the command:
Add-OdbcDsn -Name test -DriverName "SQL Server" -DsnType User -SetPropertyValue @("PWD=test", "SERVER=10.0.0.1")
and here is the error message:
Add-OdbcDsn : Attempt to set the {UID or PWD} key of a DSN. These keys should not be stored in the registry for securit
y reason. Provide the credential information at runtime via SQLDriverConnect, SQLConnect or SQLBrowseConnect.
At line:1 char:1
+ Add-OdbcDsn -Name test -DriverName "SQL Server" -DsnType User -SetPropertyValue @ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (MSFT_OdbcDsnTask:Root/Microsoft/...SFT_OdbcDsnTask) [Add-OdbcDsn], Cim
Exception
+ FullyQualifiedErrorId : MI RESULT 4,Add-OdbcDsn
NB!:  this command does not contain a port number, but when adding it without a password(PWD string) we just the default port.

Hi Primeid,
Agree with Jrv, we cannot store  UID and PWD in an ODBC datasource, For example, you can create a DSN using the user interface but if you look at the DSN stored in the registry the UID and PWD are not stored.
ODBC it is always required when you connect using a DSN that the caller supply UID and PWD if they want to use standard login during connection time. 
These similar discussion are for your reference:
Creating ODBC DSN for SQL Native
Client fails for not-integrated authentication
is user name and password required in ODBC admin / User DSN?
In addition, to read data from a SQL Server database using an ODBC DSN with SQL Authentication via powershell, please refer to this script:
Open SQL database with ODBC DSN and SQL AuthenticationIf
there is anything else regarding this issue, please feel free to post back.
If you have any feedback on our support, please click here.
Best Regards,
Anna Wang
TechNet Community Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

Similar Messages

  • Automatically create ODBC DSN connection with powershell or GPO

    Hi,
    I'm trying to create a ODBC connection that has a special network port and also password automatically stored.
    I have tried to do this with the add-odbcdsn cmdlet and adding attributes to a group policy object configuration without luck.
    If I try to export settings with regedit and import them trough logonscript, the normal users dont have user rights to the LOCAL Machine hive.
    Therefore I have tried to export a USER DSN instead, but either of the port or password settings are exported.
    Please help.

    Hello,
    You can create a VB Script (.vbs) as the one create by Clamp77 on the following thread.
    http://stackoverflow.com/questions/23552529/can-i-create-a-bat-file-to-automate-data-sources-adding-in-odbc-data-source-adm
    Then you can run the script on computers using GPOs as explained on the following article.
    http://technet.microsoft.com/en-us/library/dn789196.aspx
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • How to create odbc (dsn) connection for OBIEE AND INFOR in unix environment

    Hi,
    we are establishing OBIA in Unix environment we set all the things fine but we are getting problem how to create ODBC connection
    for INFORMATICA AND OBIEE. I searched some blogs thats telling there is a ODBC.INI file we need to configure.
    but i am not getting clear idea to give parameters and it will not showing any TNSNAME ..........etc
    please any body give clear idea about how to create ODBC connection and LOCATION of that file AND parameter which i need to give.
    Thanks,
    charan....

    Hi Dpka,
    yah i already checked that one but i have not find out any parameter for TNS NAME information.
    is OBIEE connected to ORACLE DATA BASE without giving TNS information?............in UNIX OPERATING SYSTEM.
    pls give me the clear idea abt how to connect OBIEE, INFORMATICA to ORACLE DATA BASE IN UNIX ENVRNMENT
    thanks,
    charan.

  • How to create a login funtion with different usernames and password to iweb

    Hi,
    Im looking for hours for a solution to create / add a function to iweb which allows users to login to a member area with their own user names and passwords.
    Is there a simple way to realize this? So far I know there has to be a file with all the user name --> password combinations, can I add such a file to my idisk and then get it working with my iweb site?
    Is such an idea in general possible with iweb?
    Thanks for your help!
    Message was edited by: Macusar08

    One possibility may be to use the free drop.io to privately share links to your iWeb site pages and/or iDisk files. +"Each 'drop' (...) can be password-protected and set to expire after a period of time, so you can share exactly what you want with whom you want for as long as you want."+ (source).
    Note that drop.io doesn't require an email address, name or personal registration to set up a "drop". And you can place data in either one drop or multiple drops. Each drop comes with 100mb of storage for free and you can have as many drops as you want without signing up.

  • Http connection with user name and password

    Hello All,
    I'm trying to open http connection from my application on the 8100 device and i'm getting an error message saying that the port number isn't valid. I'm trying to add user name and password to the prefix of the url (e.g.: http://[email protected]/dir/)
    and the error message appears, but when i'm using the same url without the user name and password everything works great.
    Does anyone knows what's wrong or encountered this issue before?
    thanks.

    hello,
    I believe when you input the credentials, the website does a redirection to another port that is not supported by your internet access provider ?
    The search box on top-right of this page is your true friend, and the public Knowledge Base too:

  • Trying to create a wireless connection with an Imac and ibook

    I was connected to the internet using a DSL cable modem, and ethernet. My main computer is a iMAC G5 (bought last year) using Snow Leopard as the operating system.
    I recently acquired an old iBook (2004) running on Panther.
    It was connected to the internet using a dual type ethernet/wireless modem from Sympatico.
    It used the built-in airport to link to the internet.
    I bought this week a new Airport Express 802.11n Wi-Fi device.
    I sucessfully hooked up my iMAC to a new wireless network I created, but was unable to connect
    the old ibook. Did anybody else have this problem?
    Is there a solution?

    loqs wrote:You built the package (using --asroot with makepkg is not a good idea ) but you did missed Install_the_package
    Also see Kernel_Modules so the module is loaded automatically at boot.
    Seriously? I spent that many hours searching for my several error messages, trying to solve them, not wanting to ask for help without putting too much of my own effort into it and when I finally decide to ask for help it is when I didn't get a super essential thing like makepkg doesn't install and is merely to create .pkg.tar.xz?? Oh gosh... (;
    Well, thank you! I guess I'll take my next change to use Google to find out how to use makepkg without --asroot. Yes, wl is loaded now and it's set as the kernel driver in use!
    Unfortunately, after ip link set wlp2s0 up and typing dmesg | grep wl I get:
    wl: module license 'Mixed/Proprietary' taints kernel.
    wlan0: Broadcom BCM4727 802.11 Hybrid Wireless Controller 6.30.223.248 (r487574)
    systemd-udevd[148]: renamed network interface wlan0 to wlp2s0
    wl 0000:02:00.0: no hotplug settings from platform
    wl 0000:02:00.0: no hotplug settings from platform
    wl 0000:02:00.0: no hotplug settings from platform
    wl 0000:02:00.0: no hotplug settings from platform
    And therefor: No firmware loaded. Google doesn't give much about this message but hints to PCI or PCI-Express not working as it should. I found this and tried starting with pciehp.pciehp_force=1 and ordered a modprobe acpiphp but nothing changed.

  • Issue with creating oracle ODBC DSN connection

    Hi all,
    We have BO X! 3.1. We have created some webi reports. Our universe connection is created using following method.
    = Created a DSN connection for oracle 10g database
    = created Bo connection object by selecting Generic ODBC connection
    = in the service name we have given DSN name and tested successfully.
    we have created reports universe under Windows environment.
    = Now we deployed Biar file of the same on SOLARIS server.
    We have created odbc connection in odbc.ini  on solaris.
    we have used path "/../boxir3/bobje/odbc.ini"
    We have used "/BOXIR3/bobje/enterprise120/solaris_sparc/odbc/lib/libsqora.so.10.1" driver
    But when we test connection after deployment connection fails. giving error
    " A database error occured. The database error text is:. (WIS 10901)"
    Can anybody suggest me right method to create ODBC connection for oracle 10g on SOLARIS.
    Thanks in advance.
    Saurabh

    Hi Saurabh,
    You said your odb.ini is at the location "/../boxir3/bobje/odbc.ini". Verify if environment variable ODBCINI is pointing to this location. For this do a echo $ODBCINI. This should return the path of your odbc.ini file. If this command returns empty, that means this variable is not set. In this case you will have to set your ODBCINI using the below command.
    If you are using bash shell
    export ODBCINI=/../boxir3/bobje/odbc.ini.
    if this does not work try
    set ODBCINI=/../boxir3/bobje/odbc.ini
    Thanks
    -Anup-

  • Creating a TCP connection with SSL/TLS

    Hi,
    I am working in a application that depends on the server. I need to estabilish a TCP connection with SSL/Tls secure connection with the server in order to get the datas.
    I have the following code structure :
    - (id)initWithHostAddressNSString*)_host andPortint)_port
    [self clean];
    self.host = _host;
    self.port = _port;
    CFWriteStreamRef writeStream;
    CFReadStreamRef readStream;
    return self;
    -(BOOL)connect
    if ( self.host != nil )
    // Bind read/write streams to a new socket
    CFStreamCreatePairWithSocketToHost(kCFAllocatorDef ault, (CFStringRef)self.host, self.port, &readStream, &writeStream);
    return [self setupSocketStreams];
    - (BOOL)setupSocketStreams
    // Make sure streams were created correctly
    if ( readStream == nil || writeStream == nil )
    [self close];
    return NO;
    // Create buffers ---- has not been released , so need to check possible ways to release in future
    incomingDataBuffer = [[NSMutableData alloc] init];
    outgoingDataBuffer = [[NSMutableData alloc] init];
    // Indicate that we want socket to be closed whenever streams are closed
    CFReadStreamSetProperty(readStream, kCFStreamPropertyShouldCloseNativeSocket, kCFBooleanTrue);
    CFWriteStreamSetProperty(writeStream, kCFStreamPropertyShouldCloseNativeSocket, kCFBooleanTrue);
    //Indicate that the connection needs to be done in secure manner
    CFReadStreamSetProperty(readStream, kCFStreamPropertySocketSecurityLevel, kCFStreamSocketSecurityLevelNegotiatedSSL);
    CFWriteStreamSetProperty(writeStream, kCFStreamPropertySocketSecurityLevel, kCFStreamSocketSecurityLevelNegotiatedSSL);
    // We will be handling the following stream events
    CFOptionFlags registeredEvents = kCFStreamEventOpenCompleted |
    kCFStreamEventHasBytesAvailable | kCFStreamEventCanAcceptBytes |
    kCFStreamEventEndEncountered | kCFStreamEventErrorOccurred;
    // Setup stream context - reference to 'self' will be passed to stream event handling callbacks
    CFStreamClientContext ctx = {0, self, NULL, NULL, NULL};
    // Specify callbacks that will be handling stream events
    BOOL doSupportAsync = CFReadStreamSetClient(readStream, registeredEvents, readStreamEventHandler, &ctx);
    BOOL doSupportAsync1 = CFWriteStreamSetClient(writeStream, registeredEvents, writeStreamEventHandler, &ctx);
    NSLog(@"does supported in Asynchrnous format? : %d :%d", doSupportAsync, doSupportAsync1);
    // Schedule streams with current run loop
    CFReadStreamScheduleWithRunLoop(readStream, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
    CFWriteStreamScheduleWithRunLoop(writeStream, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
    // Open both streams
    if ( ! CFReadStreamOpen(readStream) || ! CFWriteStreamOpen(writeStream))
    // close the connection
    return NO;
    return YES;
    // call back method for reading
    void readStreamEventHandler(CFReadStreamRef stream,CFStreamEventType eventType, void *info)
    Connection* connection = (Connection*)info;
    [connection readStreamHandleEvent:eventType];
    // call back method for writing
    void writeStreamEventHandler(CFWriteStreamRef stream, CFStreamEventType eventType, void *info)
    Connection* connection = (Connection*)info;
    [connection writeStreamHandleEvent:eventType];
    `
    As above, I have used
    CFReadStreamSetProperty(readStream, kCFStreamPropertySocketSecurityLevel, kCFStreamSocketSecurityLevelSSLv3);
    CFWriteStreamSetProperty(writeStream, kCFStreamPropertySocketSecurityLevel, kCFStreamSocketSecurityLevelSSLv3);
    in order to make a secured connection using sockets.
    The url i am using is in the format "ssl://some domain.com"
    But in my call back method i am always getting only kCFStreamEventErrorOccurred for CFStreamEventType .
    I also tried with the url "https://some domain.com" ,but getting the same error.
    i also commented out setting kCFStreamPropertySocketSecurityLevel, but still i am receiving the same error that i mentioned above.
    I dont know how it returns the same error. I have followed the api's and docs , but they mentioned the same way of creating a connection as i had given above.
    I tried to get the error using the following code :
    CFStreamError error = CFWriteStreamGetError(writeStream);
    CFStreamErrorDomain errDomain = error.domain;
    SInt32 errCode = error.error;
    The value for errCode is 61 and errDomain is kCFStreamErrorDomainPOSIX. so i checked out the "errno.h", it specifies errCode as "Connection refused"
    I need a help to fix this issue.
    If the above code is not the right one,
    **(i)how to create a TCP connection with SSL/TLS with the server.**
    **(ii)How the url format should be(i.e its "ssl://" or "https://").**
    **(iii)If my above code is correct where lies the error.**
    I hope the server is working properly. Because I can able to communicate with the server and get the datas properly using BlackBerry and android phones. They have used SecuredConnection api's built in java. Their url format is "ssl://" and also using the same port number that i have used in my code.
    Any help would be greatly appreciated.
    Regards,
    Mohammed Sadiq.

    Hello Naxito. Welcome to the Apple Discussions!
    Try the following ...
    Perform a "factory default" reset of the AX
    o (ref: http://docs.info.apple.com/article.html?artnum=108044)
    Setup the AX
    Connect to the AX's wireless network, and then, using the AirPort Admin Utility, try these settings:
    AirPort tab
    o Base Station Name: <whatever you wish or use the default>
    o AirPort Network Name: <whatever you wish or use the default>
    o Create a closed network (unchecked)
    o Wireless Security: Not enabled
    o Channel: Automatic
    o Mode: 802.11b/g Compatible
    Internet tab
    o Connect Using: Ethernet
    o Configure: Manually
    o IP address: <Enter your college-provided IP address>
    o Subnet mask: <Enter your college-provided subnet mask IP address>
    o Router address: <Enter your college-provided router IP address>
    o DNS servers: <Enter your college-provided DNS server(s)
    o WAN Ethernet Port: Automatic
    <b>Network tab
    o Distribute IP addresses (checked)
    o Share a single IP address (using DHCP & NAT) (enabled)

  • Please help me creating a new listener with different port#.

    I have two instances in a server. both have different homes. I want to create a seperate listener for the second one i created.
    But that is not happening.
    here i tried to give name from LISTENER TO LISTENER1 & Port# from 1521 to 1524.
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = /apps2/oracle)
    (PROGRAM = extproc)
    LISTENER1 =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    (ADDRESS = (PROTOCOL = TCP)(HOST = aixth53)(PORT = 1524))
    When I check lsnrctl status with LISTENER1 , it still shows the other instance home with port#: 1521
    Please help me creating a new listener with different port#.
    Thanks,

    marist89 wrote:
    sb92075 wrote:
    marist89 wrote:
    sybrand_b wrote:
    The listener is a broker only and doesn't play any role in normal communications.
    It just forks a process or a thread, and that's it.And the listener is a single point of failure. Listener goes down, you can't connect to the db. That's why you need two listeners.If listener one goes down, then listener two goes down for exact same reason since it is a single executable file.I'm not playing tit-for-tat with you. Fact is, there are situations where people who are not you might want to use more than one listener.Some folks might want to jab a sharp pencil into their eye, too.
    Just because you can do something, it does not necessarily mean it should be done.

  • What cable type for connecting with gigabit port

    What kind of lan cable that I should use for connecting with gigabit port from Time Capsule to get the fastest transfer rate. And what is the maximum rate MB/sec that could be?

    You can use CAT5 or CAT6.
    max transfer rate is:
    Fast Ethernet has a theoretical speed of 100 Mbits/sec (12 MB/sec), while Gigabit Ethernet has a theoretical speed of 1000 Mbits/sec (120 MB/sec). That suggests a double speed advantage of Gigabit Ethernet over USB (60 MB/sec), but neither protocol hits its maximum. In reality, a typical USB connected disk is roughly equal to or lesser than the throughput of a shared drive attached over a Gigabit Ethernet network.
    Over wireless network:
    - 802.11b has a theoretical speed maximum of 11 Mbits/sec with a typical transfer rate of around 4.5 Mbits/sec (0.5 MB/sec) with an ideal signal.
    - 802.11g has a theoretical speed maximum of 54 Mbits/sec, with a typical transfer rate of around 23 Mbits/sec (2.5 MB/sec) with an ideal signal.
    - 802.11n has a theoretical speed maximum of 300 Mbits/sec, with a typical transfer rate of around 74 Mbits/sec (9.25 MB/sec) with an ideal signal.

  • How to use an apple id on an iPad but not have it connect  with my phone and mac

    I've recently sold my ipad to my younger sisters who are using my apple id. once they are in wifi they are able to use facetime and imessage but it connects with my email and phone number. They are also able to view my pictures in "my photo stream". Is there a way to let them us my apple id but completely disable the id from imessage, facetime, and making sure my photo stream does not show up?

    https://appleid.apple.com/cgi-bin/WebObjects/MyAppleId.woa/
    When you created your iCloud account, the @me.com email address you created also automatically became an AppleID, but you used an exisiting AppleID in the first place to create the iCloud account before deciding on that @me.com address.  So your iCloud account is actually the AppleID you used to initially create the account, not the @me.com address assigned once the iCloud account was active (look in your account settings on your iPhone or iPad and you can see what the iCloud account primary AppleID is).
    Unless you specifically started using your new @me.com address for things, it is an unused AppleID, but it is NOT your iCloud account primary ID (that is whatever AppleID you used to create the iCloud account initially).
    An AppleID is nothing more than an email address, but it is linked to an AppleID account held with Apple and thus can be used to log in to services including the various Apple stores.

  • When I restart my computer and hold the option key after creating a bootable usb with windows 7 and partitioning only the original partition shows up. Not the windows one or the bootable usb.

         Okay so first things first this isn't the newest macbook pro. When I open about my mac and go to system report it says it is a Macbook Pro 3,1 and the Boot Rom Version say MBP31.0070.B07. Originally when starting up Boot Camp Assistant there where only two options, the "create windows 7 bootable usb" was not there at all. So after some editing and helpful tutorials I was able to get the option show up and created a bootable usb with windows 7 and downloaded the support software onto a separate flash drive. Finally I did the last step and created a second partition for windows. Once the process is complete my computer automatically restarts.
         This is where the problem is. Once my computer makes the booting up sound it doesn't load up windows it gets stuck on a apple logo as if it's trying to reastart normally and can't. So I shut down and this time I hold down the option key during start up. It brings up the main partition and some recovery thing but no windows partiton and no bootable usb.
         I forgot to mention that I am running OS X 10.9.3. Okay any body want to help me out? Iv'e been at this for hours and can't get an inch closer to having windows. Please and thank you!
    P.S. If I missed a discussion that answer my question just point me to it. Iv'e been looking for a while, but who knows i might have missed one.

    The only known way to make it work on an external drive is by first installing Windows onto an internal drive, then cloning the install to an external Thunderbolt drive. Thunderbolt is seen as an extension of the internal bus, so Windows doesn't see it as an external device.

  • I cant connect with my imessage and facetime in my iphone; i already upload de i os 7.02 but the message still have it; it said that they have problem with the network; i reset the network and doesnt work

    I cant connect with my imessage and facetime in my iphone; i already upload de i os 7.02 but the message still have it; it said that they have problem with the network; i reset the network and doesnt work

    Hello, Toro Silva. 
    Thank you for visiting Apple Support Communities.
    The steps in the section labeled Unable to activate FaceTime or iMessage with phone number and Apple ID after waiting 24 hours (iPhone only) of the article below, should help resolve the issue.  Make sure to create a current backup prior to processing these steps.
    iOS: Troubleshooting FaceTime and iMessage activation
    http://support.apple.com/kb/ts4268
    Cheers,
    Jason H

  • I am experiencing wireless connection problem on 4s after ios 8.1 upgrade. The wireless icon appears showing that it's connected but webpages do not load. I have checked my internet connection with other devices and seems to be alright. what to do?

    Hi
    I am experiencing wireless connection problem on 4s after ios 8.1 upgrade. The wireless icon appears showing that it's connected but webpages do not load. I have checked my internet connection with other devices and seems to be alright. what to do?
    I have tried reseting the network settings and forgetting my wireless connection and re-connecting to it. I even backed up my phone on itunes and restored it, factory reseted it. Nothing seems to work.
    Also after my upgrade to ios 8.1 my personal hotspot option under cellular data has disappeared.
    Would you please help me out? I would really appreciate it.

    Hi..
    Restart your router then restart the iPhone to test.
    If that doesn't help, try this support article >   iOS: Troubleshooting Wi-Fi networks and connections

  • I have an account for apple but this is not acceptable for i cloud. It say it is correct ID and password but this is not icloud account. So my phone can not connect with my computer and not synchronization too

    I have an account for apple but this is not acceptable for i cloud. It say it is correct ID and password but this is not icloud account. So my phone can not connect with my computer and not synchronization too. Last a few months i have not use this phone. Just i start to use again. So most probably i gave my old mail address as a ID or password. So how can i clearing this subject. regards

    ErolSinan wrote:
    ... there is no button for update between the About and Usage buttons in the General. ...
    Correct. That is only a feature of iOS 5 or later...
    ErolSinan wrote:
    ... yes my phone is 3G.
    then it can only go as far as iOS 4.2.1

Maybe you are looking for

  • What version of itunes would show a ipod icon instead of a music icon on my ipad

    I sold this ipad to a friend and now it shows she only has IOS 4.2 and therefore can not load apps.  It also shows an ipod icon instead of a music icon.   It the reason she is having problems the version of itunes downloaded.  And is it possible her

  • Saturday's between date range

    Hi All,             I need to findout the number of satuday's between the given date range. Please tell me if there are any function modules or methods to calculate this. Regards Suprith

  • Move CUCM VM from one UCS220 to another during maint window

    Hello, I understand it is possible and supported to be able to cold migrate / host to host move a CUCM VM from one Cisco C220 server to another during a maint window to deal with a server issue. However I can't seem to find the exact process to follo

  • Hyperion Business Rule Architecture

    Hello All- Is there any document which gives us HBR version 11.1.1 detailed architecture? I know that HBR information are stored in AAS RDBMS database, but where the actual script is stored? How does HBR interfaces with planning? I went through HBR a

  • Setting up connection using a single connection string.

    Post Author: DubbleOh7 CA Forum: Data Connectivity and SQL I know about the ConnectionInfo object in for .NET crystal reports, but for security purposes we don't have access to a password of any kind, nor do we pass them around our web pages, they ar