Invoke-sqlcmd with domain user name and password

I am trying to execute below small SQL script from powershell by passing my domain user name and password..but it is throwing an error login failed for the user.
Howerver I am able to execute the same query by passing normal user 'non domain' and password. The issue is only when i am trying to connect with domain username.
Can you please suggest if there is any way to execute below query with domain user..
Invoke-Sqlcmd
-query "select name from master.sys.databases"
-ServerInstance "CM-NCKM-DBTST04\SQL2012" -username "sos\9venk" -password "xxxx"
Thanks
Venkat
venkat

Hi Venkat,
Agree with Mike, to connect sql via powershell, you can refer to this article about authentications:
Connecting to SQL Server through Powershell
Please try to gather credentials using Get-Credential, and then use New-PSSession -Authentication CredSSP to open the pssession.
A similar discussion about this issue is for your reference:
Invoke-SQLCmd with Different Credential
If there is anything else regarding this issue, please feel free to post back.
Best Regards,
Anna Wang
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

  • HT204053 I did not know my kids had set up an Itunes account for me with one user name and password.  then i got an i phone and set it up with a different email address and new password.  how can i get my accounts to merge so i can have all of my music on

    I did not know my kids had set up an Itunes account for me with one user name and password.  then i got an i phone and set it up with a different email address and new password.  how can i get my accounts to merge so i can have all of my music on my iphone

    Quote: "You cannot merge two or more Apple IDs into a single one. You can, however, use one Apple ID for iCloud services and another Apple ID for store purchases (including iTunes in the Cloud and iTunes Match). See “Using one Apple ID for iCloud and a different Apple ID for Store Purchases” above for details." See also Apple ID & iCloud FAQ: http://support.apple.com/kb/HT4895?viewlocale=en_US&locale=en_US
    You can set up your iCloud account on your iOS device under: "Settings > iCloud" and a other account for store purchases under "Settings > iTunes & App Stores". Unfortunately merging accounts is not possible but you could transfer all of your music manually via iTunes from your Mac or PC.

  • Problems with invalid user name and password

    We have a one week old MacBook 2.2GHz basic white model that is generally working well.
    However a problem has now arisen whereby on any attempt to shutdown or restart it won't accept the administrator user name and password, returning an 'invalid' warning. The issue seems to be the user name as the administrator password has worked OK in other situations. Naturally I have checked and re-checked the user name (which was in the form (first name followed by surname in upper and lower case) and it was OK (in any case it was being prompted automatically by the system.)
    I have subsequently changed the administrator name (to the form first name only in upper and lower) and the password as suggested by the following article:
    http://docs.info.apple.com/article.html?artnum=306876
    Nothing has changed. Can anyone help?

    HI Martin, a late post to confirm the solution from the last post by using the "RETURN" key works..
    (mouse click worked ok in Tiger 10.4.x I thought).
    Tis was a delight and so obvious after seeing these symptoms.
    I have posted this entry in case anyone else get's into this situation since OSX LEopard 10.5. Several people have encountered this issue where they may have:
    • LEopard 10.5.x installed
    • have 2 or more active users LOGGED into the OSX system via fast user / fastuser switching
    • request a SHUTDOWN or RESTART from an user
    • get a OSX request to supply administrator attributed user and it's associated password to validate SHUTDOWN | RESTART request,
    • have admin | root account verification failure of password after 'clicking'.
    After some months of frustration, it seems a simple PRESS of the "RETURN key" works!
    Simply, DON'T mouse click after entering admin user/password.... instead press "RETURN" key.
    fwiw.
    w

  • I have to log in everytime with my user name and password even though "Keep me logged in ...." is checked, this just started

    I don't know what else to say about this but I guess I have to enter something in this box.

    gemma252 wrote:
    I have just installed snow leopard and reset my admin name and password.
    Likely because both occurred at the same time and/or you created another Admin user/ didn't allow the new Admin to admin the machine?
    Hold c and boot off your Snow Leopard install disk and second screen in under the Utilities menu is Reset Password.
    There is also a Single User mode (caution root user!) way to reset passwords on each account.
    http://osxdaily.com/2011/04/25/change-admin-password-mac/
    Before you do that, make sure at any opportunity to backup your files manually to a external drive and disconnect.

  • Web Services with Authentication - User Name and Password.

    How to create a web service and web service client where the need is to authenticate using SOAP Header based authentiacation. The authentication is to be based on UserName and Password in the SOAP Header.
    Regards
    Pramod.

    Dear Pierluigi Vernetto
    What is meant when they say to include SOAPHeader with the parameters UserName, Password for Authentication. How this type of authentication is done.Can you please provide some code snipped to facilitate. I am new to the web services and did successfully a web service generation and client generation using WSDL.
    WSDL Snippet :
    - <wsdl:operation name="RegisterService">
    <soap12:operation soapAction="http://www.abc.com/webservices/RegisterService" style="document" />
    - <wsdl:input>
    <soap12:body use="literal" />
    <soap12:header message="tns:RegisterServiceAuthenticate_Info" part="Authenticate_Info" use="literal" />
    </wsdl:input>
    - <wsdl:output>
    <soap12:body use="literal" />
    </wsdl:output>
    </wsdl:operation>
    - <wsdl:types>
    - <s:schema elementFormDefault="qualified" targetNamespace="http://www.abc.com/webservices/">
    - <s:element name="RegisterService">
    - <s:complexType>
    - <s:sequence>
    - <s:element minOccurs="0" maxOccurs="1" name="InputText">
    - <s:complexType>
    - <s:sequence>
    <s:any />
    </s:sequence>
    </s:complexType>
    </s:element>
    </s:sequence>
    </s:complexType>
    </s:element>
    - <s:element name="RegisterServiceResponse">
    - <s:complexType>
    - <s:sequence>
    - <s:element minOccurs="0" maxOccurs="1" name="RegisterServiceResult">
    - <s:complexType>
    - <s:sequence>
    <s:any />
    </s:sequence>
    </s:complexType>
    </s:element>
    </s:sequence>
    </s:complexType>
    </s:element>
    <s:element name="Authenticate_Info" type="tns:Authenticate_Info" />
    - <s:complexType name="Authenticate_Info">
    - <s:sequence>
    <s:element minOccurs="0" maxOccurs="1" name="UserName" type="s:string" />
    <s:element minOccurs="0" maxOccurs="1" name="Password" type="s:string" />
    </s:sequence>
    <s:anyAttribute />
    </s:complexType>
    If i simply create the web service using the WSDL , will the Authenticate_Info will be taken care of.
    What needs to be done for the Client side .jsp code and how this information of UserName and Password will be passed while making the call to the web service.
    regards
    Pramod.

  • Although I can receive mail on my btinternet address I cannot reply or send. My settings , apart from user name are extactly the same as my wife's who has no problem.  We are the same account but with different user names and passwords.

    Settings use mail.btinternet.com as smtp, SsL is on, port 995

    Hello Bigstorr,
    It sounds like you are not able to send emails from your iPad.  I found a couple of resources that address issues with email on the iPad:
    Setting up and troubleshooting Mail
    https://www.apple.com/support/ipad/assistant/mail/
    iOS: Unable to send or receive email
    http://support.apple.com/kb/ts3899
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • Invalid User Name and Password in RCU

    I am trying to install SOA 11g in my machine (Windows 7 64 Bit).
    I have successfully installed the following
    1. JDK (Java 6 Update 45)
    2. Oracle XE 10g Database
    3. Weblogic Server
    While installing RCU, I am facing issue with Invalid User Name and Password. <<Attaching File = RCU_Error.jpg>>
    I am able to connect to database using sqlplus (for XE) with user = system. <<Attaching File = sqlplus.jpg>>
    Can anyone help on this?

    Hi Banerjee,
    SOA 11g is not certified or supported with DB 10.2.0.1 so request you to either upgrade the DB to 10.2.0.4 or use 11g DB.
    Regards,
    Prakash.

  • JNDI  user name and password

    Case 1, for a NON-JNDI based database connection:
    Connection conn = DriverManager.getConnection(url, "username", "password");
    Case 2, for a JNDI based database connection:
    Context context = new InitialContext();
    DataSource dataSource = (DataSource) context.lookup("java:comp/env/jdbc/test");
    Connection conn = dataSource.getConnection();
    Notice that for NON-JNDI based database connection, the username and password are specified. But for the
    JNDI based database connection, there is no username and password specified. How come? If I want to specify the username and password for JNDI based connection, how can I do it?
    Thanks
    Scott

    scottjsn wrote:
    Though your example shows using a jndi file, you user name is actually hard coded.There's no such thing as a "jndi file". The username is not hard coded because that's not code, it's a configuration file.
    I believe my original question is how to use JNDI with the user name and password.The username and password are always the same. You have one set of those for the database, for all the users in your application. The only situation where that might differ is for example a testing server or development server having a different username and password.
    They would have their own configuration files then.
    The user name and password can be dynamically retireved and set for each authorized user on the fly.Authorization is a different beast. This (your code) is about getting database connections through a DataSource object.

  • User Name and Password in weblogic realm while invoking a web service

    Hi,
    I deployed a rpc web service using WLS 7.0 SP2 in HP-UX 11 environment. When I
    invoke the web service through my browser (IE 6.0) using the web services url,
    it brings my service method correctly. From there, if I click the invoke button
    it asks me for a network user name and password under "weblogic" realm??? If I
    provide the admin user credentials (which I supplied while creating my domain)
    it is not accepting that it keeps popping up this network user password window
    over and over. Not sure which username/password I have to provide here to see
    the result of my service.
    If I try to invoke the web service through my client (static) I am getting a connection
    refused exception. I guess either way, I am not able to access my web service.
    In the attached file, I have cut and pasted the client stack trace as well as
    the server log trace from weblogic.
    Any ideas would be highly appreciated.
    Thanks,
    Ganesh
    [errorstacktrace.txt]

    I think the client is not able to do a HTTP POST
    to the WLS server but it can do a HTTP GET.
    I dont know why.
    http://manojc.com
    "Ganesh" <[email protected]> wrote in message
    news:3eba91bc$[email protected]..
    >
    Hi,
    I deployed a rpc web service using WLS 7.0 SP2 in HP-UX 11 environment.When I
    invoke the web service through my browser (IE 6.0) using the web servicesurl,
    it brings my service method correctly. From there, if I click the invokebutton
    it asks me for a network user name and password under "weblogic" realm???If I
    provide the admin user credentials (which I supplied while creating mydomain)
    it is not accepting that it keeps popping up this network user passwordwindow
    over and over. Not sure which username/password I have to provide here tosee
    the result of my service.
    If I try to invoke the web service through my client (static) I am gettinga connection
    refused exception. I guess either way, I am not able to access my webservice.
    In the attached file, I have cut and pasted the client stack trace as wellas
    the server log trace from weblogic.
    Any ideas would be highly appreciated.
    Thanks,
    Ganesh

  • How do I connect to Net Flix? I put in my user name and password which work fine with my iMac but not on my Apple TV?

    How do I connect to Net Flix? I put in my user name and password which work fine with my iMac but not on my Apple TV?

    Can you give me a screenshot of the User Accounts window in Control Panel?
    Please create a screenshot by following the guide mentioned at [[How do I create a screenshot of my problem?]].
    Once you've done this, attach the saved screenshot file to your forum post by clicking the '''Browse...''' button below the ''Post your reply'' box. You really help us to visualize the problem.

  • My app store is not working after installing mavericks. When I open app store it repeatedly asking me to login with apple ID and to provide User name and Password for proxy authentication in a loop.I am a newbie to mac,Please help me.

    My app store is not working after installing mavericks. When I open app store it repeatedly asking me to login with apple ID and to provide User name and Password for proxy authentication in a loop.I am a newbie to mac,Please help me.

    Hmmmm... would appear that you need to be actually logged in to enable the additional menu features.
    Have you tried deletting the plists for MAS?
    This page might help you out...
    http://www.macobserver.com/tmo/answers/how_to_identify_and_fix_problems_with_the _mac_app_store
    Failing that, I will have to throw this back to the forum to see if anyone else can advise further.
    Let me know how you get on?
    Thanks.

  • How can I get Firefox to run on a network with multiple users logging on with the same user name and password?

    I am trying to get Firefox running on a large network where I have multiple users that log on with the same user name and password. The problem is that when another user logs on to another computer the message comes up that their is already an instance of firefox running on that computer even though there really isn't. Only one instance can be run on the network at one time. I believe it is because firefox stores a shared profile as it thinks it is actually the same user even though it is being run on another computer. I repeat that each user that logs on uses the same user name and password but on different computers.

    I am trying to get Firefox running on a large network where I have multiple users that log on with the same user name and password. The problem is that when another user logs on to another computer the message comes up that their is already an instance of firefox running on that computer even though there really isn't. Only one instance can be run on the network at one time. I believe it is because firefox stores a shared profile as it thinks it is actually the same user even though it is being run on another computer. I repeat that each user that logs on uses the same user name and password but on different computers.

  • How to read the data from a file in another computer with user name and password login

    How to read read the data from a file in anohter computer which need to login with user name and password?

    duplicate post:  http://forums.ni.com/t5/LabVIEW/log-on-the-other-computer-with-user-name-and-password/m-p/2061478
    duplicate post:  http://forums.ni.com/t5/LabVIEW/do-need-to-enter-the-user-name-and-password-when-TCP-ip/m-p/2061612
    duplicate post   http://forums.ni.com/t5/LabVIEW/log-on-the-other-computer-with-user-name-and-password/m-p/2060682

  • When I try installing Firefox 6.0 from the binary file, a box with "Run As" in the type field appears, which asks me for user name and password. Please advise about the course of action that I should take.

    Trying to run it as the current user, or as one from a different account(administrator in this case) also doesn't work.

    I think the client is not able to do a HTTP POST
    to the WLS server but it can do a HTTP GET.
    I dont know why.
    http://manojc.com
    "Ganesh" <[email protected]> wrote in message
    news:3eba91bc$[email protected]..
    >
    Hi,
    I deployed a rpc web service using WLS 7.0 SP2 in HP-UX 11 environment.When I
    invoke the web service through my browser (IE 6.0) using the web servicesurl,
    it brings my service method correctly. From there, if I click the invokebutton
    it asks me for a network user name and password under "weblogic" realm???If I
    provide the admin user credentials (which I supplied while creating mydomain)
    it is not accepting that it keeps popping up this network user passwordwindow
    over and over. Not sure which username/password I have to provide here tosee
    the result of my service.
    If I try to invoke the web service through my client (static) I am gettinga connection
    refused exception. I guess either way, I am not able to access my webservice.
    In the attached file, I have cut and pasted the client stack trace as wellas
    the server log trace from weblogic.
    Any ideas would be highly appreciated.
    Thanks,
    Ganesh

  • Locked PDF files will not open with user name and password. Help?

    I go to school online and our eBooks are in pdf format. I download them to my MacBook so that I can read them offline. When I download them, they open as they always did but, when I put my username and password in to unlock them, it tells me something about the file is edited and a copy will be saved but, it never opens the file. I have adobe reader on it, I am getting frustrated! I don't want to be logged into class every time I am studying material. Any ideas? Thanks in advance - this is my first Mac so, bare with me

    Not using netwok magic. I shut it down when it comes up.  I have tried using 192.168.1.1 but still will not accept user name and password.  I never changed the factory default and it just continues to ask for the user name and password.  Web utility site will not come up.  I have a wired desktop as my main computer and that is the computer I have been trying to access the utility from. 

Maybe you are looking for