How can I connect to a UNIX server to execute a command?

How can I connect to a UNIX server and execute a command using PowerShell? My shell script is sitting on one server, while the UNIX box is on another.
also, I don't like the idea of hardcoding a username/password within the script file in order to do so.
-Nothing to see. Move along.

You will need a library to handle SSH connections.
I'm using SSH.NET, you can find info on it here : http://www.powershelladmin.com/wiki/SSH_from_PowerShell_using_the_SSH.NET_library
It has a bit of a learning curve but the web site has some fairly good tutorials.

Similar Messages

  • How can I connect to a windows server from a mac book pro

    How can I connect to a windows server from a mac book pre?

    I have a Dell Power Edge T110 ii in the office that has files and software I need to access when away from the office, when I am on the road I use a mac book pro and an iPad.
    I am sorry if I am being a bit vague but this is all new to me, I have tried 3 IT guys but they can not find a way.
    Any help is greatly appeciated.

  • How can i connect to a SQL Server 2000 database usgin JSP?

    I need (URGENT) to connect to SQL Server 2000 databse using JSP. I do not know how to program using JSP, so if anyone has any code snippet please let me see it. What i need is to give my site some login/password security.
    Anyone?
    Thx.

    just create an ODBC of your database from control pannel -> administrative tools -> data sources (ODBC) ,double click it .....
    go to the tab SYstem DSN , click on ADD button. select the driver for your connection. it will be the last one in the list "SQL Server".
    click Next then give ur DSN name there, description and Server Name , on next give your username and password of SQL server. when it will be connected to the server celect your database from there and hence there will be an ODBC bridge same as in case of MS Access.
    code for connecting to ODBC is
    // DSN-NAME same as in System DSN.
    // username and password are of your databse
    try
              url = "jdbc:odbc:DSN-NAME";
              Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver" );
              connect = DriverManager.getConnection( url,"username","password" );
              catch ( ClassNotFoundException cnfex ) {
                        setErrorMsg( cnfex.getMessage() );
              catch ( SQLException sqlex ) {
                        setErrorMsg( sqlex.getMessage() );
              catch ( Exception ex ) {
                        setErrorMsg( ex.getMessage() );
    Now you are connected to the SQL Server ..... use connect object for further processing .........

  • How can i connect to a Database Server (live data)?

    hi,
    i'm trying to figure out how i can create a dashboard that's connected to live data coming from a Database server.  i have the username and password and the DB name, but can't find a direct way from within SAP dashboard design where i can make the connection.
    MUST i go through XML?
    i know other tools like Tableu that allow direct connections to the server.
    is this possible?

    Hi Sam
    Please refer to the tutorial http://scn.sap.com/docs/DOC-7946 and under "Connecting to Data Sources" section you will get the step by step guidance of various data connectivity options..
    Basically the options available under Data > Connections > Add and Query Browser in Dashboards 4 are your options.
    If you want to write direct SQL to get data you have to use add-ons InfoBurst like InfoBurst infosol.com/solutions/infoburst/
    Runali

  • Home sharing problem: How can I connect a NAS iTunes server to Apple TV 2?

    I have a NAS (network attached storage) that has an iTunes server and I can see the music that I have on that NAS when I open my iTunes on my computers. However, I was wondering if there is a way to add that NAS/iTunes Server to my Home Sharing and not have to turn my computer ON every time.

    the short answer is no.
    the itunes server on your NAS is a pseudo (fake) itunes instance.
    you need a real instance of itunes (that has HomeSharing), and that means itunes running on a pc/laptop.
    you can use your NAS as the storage location for itunes, but appletv cannot connect direct to the NAS.

  • How can you connect to MS SQL Server through Oracle 9i?

    i.e. we want to connect through a stored procedure and NOT a form. Our live DB is still in 9i.

    CKPT wrote:
    user12240205 wrote:
    i.e. we want to connect through a stored procedure and NOT a form. Our live DB is still in 9i.we want to connect through a stored procedure -- connect through stored procedire? i never heard. can you please post your views this information is not enough.CREATE PROCEDURE proc1 (p_sqlsever_credentials varchar2, p_status OUT boolean) IS
    BEGIN
    -- Connect to SQL Server using p_sqlsever_credentials
    -- Execute Stored Procedure (SP) in the SQL Server DB passing paras to it.
    -- If SP in SQL Server is successful then SP will COMMIT in SQL Server
    -- If failure it will be rolled back there.
    -- SP will return status
    -- Pass the status to the calling program
    END;
    /

  • How can i connect oracle8 client to server in linux?

    Who can give me a sample?
    I mean how to config some .ora file....
    null

    http://lmgtfy.com/?q=apple+id+disabled

  • Linux Server to connect Windows 2008 R2 Server to execute powershell commands

    Is it possible to do remotely executing powershell scripts on Windows 2008 R2 from Linux Server. I explored the option of FreeSSHD, but there is no option for password less authentication.
    Any thoughts and hints greatly appreciated.
    Retheesh
    Thanks and Regards, Retheesh Kumar R

    I am going to respectfully disagree with my post mates! Muhahahaha!
    If the target server (your Windows 2008 R2 box) can accept secure shell (ssh) connections, you should be able to ssh into the server then start PowerShell just like any other shell. That said, I suspect you will run into quirks. For example, I bet the
    "out-gridview" commandlet does some whacky stuff. You may get some strange terminal emulation junk too, but by and large you should be okay. I have Cygwin deployed to a Windows machine. That installation includes the OpenSSH package.
    [1] Cygwin http://www.cygwin.com/
    [2] How to run the OpenSSH SSHD server on Windows using Cygwin;
    http://www.noah.org/ssh/cygwin-sshd.html
    This would be like ssh'ing into some Linux machine then firing up ksh. If you're used to Linux, you no doubt know what I'm talking about.
    Now, here is the trick. You'll have to setup key based authentication on the Windows machine once you have your SSH server all setup. If you know how to do this on Linux, its the same process for Cygwin. The following article can help you -- remember the
    process is pretty much the same for Cygwin on Windows as it is for Linux distributions:
    [3] SSH with authentication key instead of password;
    http://www.debian-administration.org/articles/530
    You have your work cut out for you. Give it a try, and tell us how you fare.
    I hope this helps bro!
    Cheers,
    A-

  • How can i connect to SQL Server 7.0 on Windons Using JDBC

    How can i connect to Microsoft SQL Server 7.0 on a windows enviroment ?
    in sql server 2000 some jar files are required that is
    What you need to do is actually add all three jar files to your class path individually. There are three jar files that come with this driver the msbase.jar, msutil.jar, and mssqlserver.jar. for sqlQ server 2000.
    now the problem is that i cant find these files on my system. firstly where these files will be located. secondly are they will be used to connect to SQL Server 7.0. thirdly if not what is the procedure.
    My next Problem is that I have Websphere Studio Application Developer. in which their is this facility of Database Webpages its like a wizard which makes automatically beans servlets and JSP but before that you need a Driver Name and and Class Name for to Connect to the Database.
    Can you tell what is the specific Driver Path for the Microsoft SQL Server 7.0 . secondly is this the class which is used to connect to SQL server 7.0 "com.microsoft.jdbc.sqlserver.SQLServerDriver" where can i find this one. for SQL server 7.0.
    please provide some guidance in this regard.

    You can search for the JDBC drivers at, http://industry.java.sun.com/products/jdbc/drivers
    All the three jars that you specified are part of MsSQL Server jdbc driver. You need them (in the classpath) to get connected to the database.
    "com.microsoft.jdbc.sqlserver.SQLServerDriver" is the class in mssqlserver.jar. This is the driver class which will be used to get connected to the database.
    You can search in this forum for writting jdbc code (for Sql Server). If you don't find these jars, give me your e-mail id.
    Sudha

  • How can I connect to SQL Server CE?

    Hi!
    How can I connect to SQL Server CE ?
    Any idea?
    I found jdbc driver for SQL Server 6.5,7.0,2000.
    But no driver for SQL CE.
    Thanks for any suggestion....

    I am also searching for same answer.
    I wanna choose Access as a db. but I can't find that so I have a no choice to select SQL2000CE though.
    I am stuck in driver problem. I can't find that.
    Should I use Oracle Lite or PointBase?
    I am under a lot of stress... like you've been...
    I wish you find and post that....

  • How can SQLDeveloper connect to 10g DB on server but UI cannot

    How can SQLDeveloper connect to 10g DB on server but the User Interface on local laptop cannot? What does the UI need that SQL Developer doesn't need?

    What kind of UI are you talking about?
    SQL Developer can use different type of connection method to connect to Oracle database.
    For example, basic method of SQL Developer is JDBC Thin connection, in which case, SQL Developer will use JDBC driver that come with it, don't need any other thing installed.
    SQL Developer also can use TNS method which will require Oracle client installed and TNS names configured.

  • How can I connect NetBeans 6.1 with SQL Server 2005?

    Hello guys...
    how can i connect NetBeans 6.1 with SQL Server 2005?
    there is no SQL Server in Server list when we create a new Web Project and choose Server.
    I'm new to NetBeans and this is my first time of posting.
    If has some errors and unwanted disturbing,pls understand me. Thanks.
    (If you have references or some snippets, i'll be glad if u can share.)
    scsfdev

    The JDBC-ODBC bridge wasn't recognizing any of the primary keys I had set up in SQL Server. After lots of head banging, here's the solution I came up with:
    1. Download the appropriate driver. SQL Server 2000 requires the SQL Server 2000 JDBC driver (http://www.microsoft.com/downloads/details.aspx?FamilyId=07287B11-0502-461A-B138-2AA54BFDC03A&displaylang=en).
    SQL Server 2005 download: (http://www.microsoft.com/downloads/details.aspx?familyid=C47053EB-3B64-4794-950D-81E1EC91C1BA&displaylang=en)
    3. After installing, right-click on "Libraries" in your project, and choose "Add Library...". Next, give it a name (i.e. SQLServer2000), and select "Class Libraries".
    4. On the next screen, find the JAR files (should be in C:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib\), and add them under the "Classpath" tab. It will now be available under "Libraries" for future projects.
    5. You can now create a connection to a specific database under the "Services" tab (next to "Projects" and "Files" in the top left of the screen). Select "Microsoft Sql Server 2000 (Microsoft Driver)" and format the "Database URL" like this:
    jdbc:microsoft:sqlserver//YOURSERVER:1433;DatabaseName=YOURDATABASE
    1433 is the default port, though your DBA may have changed it.
    I posted a simpler version of this on the NetBeans.org FAQ page - they had the following title with no content on the answer page:
    "Cannot Select Tables From MsSql 2000 Because It Says No Primary Key Next To Each Table But The Tables DO Have A Primary Key. What Do I Do?"

  • Using Terminal with a dial-up connection to a Unix server

    Normally I use a cable modem at home to connect to a Unix server at work. All I have to do is fire up the Terminal application, type "telnet servername.domainname.com", and I am up and running.
    A couple days ago my cable modem service died and it is going to take a week to get it fixed. Wanting to find a temporary alternative connection, I remembered that my PowerMac G5 came equipped with an Apple internal modem. I connected the modem to a phone line, went to the Network configuration panel in System Preferences, and configured the modem to dial-up the Unix server at work. Using the Internet Connect application, the modem can connect to the Unix server, but that application attempts to make a PPP connection, not a plain old-fashioned command-line Unix connection.
    What I really want to do is use the Terminal application to dial-up the Unix server. Does anybody know how to do that?
    PowerMac G5   Mac OS X (10.4.4)  

    You need to know more about how the server at the other end is configured.
    Internet Connect will only manage an internet connection, typically via PPP. If the server at the other end is not configured as a PPP server then you're not going to get anywhere with it.
    If the server is set to use the modem as a standard serial interface then you'll need a terminal emulator that can manage the serial ports (terminal.app is not such an app).
    Fortunately there are many options, including the venerable ZTerm. This will let you use the modem to dial a number and log in over a simple serial line.

  • Connection to a Unix-Server with Java

    Hi!
    I've got a little problem! I must write a java programm that connects to a unix-server! The programm should connect to the server and writes a command like "ls"! How can I do this? Can someone help me?
    Thanks Flyer2004

    Hi,
    something to help you with your assignment.
    The code below will connect to a server on a port.
    public void run() {
    try
    Socket socket = new Socket( "abc.com" , 13312 );
    System.out.println( "Connected to the server" );
    PrintWriter pw = new PrintWriter( socket.getOutputStream(), true );
    BufferedReader stdIn = new BufferedReader( new InputStreamReader(System.in) );
    BufferedReader in = new BufferedReader( new InputStreamReader( socket.getInputStream() ) );
    String userInput;
    while ( (userInput = stdIn.readLine()) != null ) {
    pw.println( userInput );
    System.out.println("echo: " + in.readLine() );
    catch ( Exception ex )
    ex.printStackTrace();     
    you can use this code to connect to a port.
    now comes the server part.....
    ServerSocket serverSocket = new ServerSocket( 7777 );
    FileInputStream fis = new FileInputStream( "test.dat" );
    Socket socket = serverSocket.accept();
    OutputStream os = socket.getOutputStream();
    byte[] buffer = new byte[1024];
    int bytes = 0 ;
    int i = 0 ;
    while( ( bytes = fis.read( buffer ) ) != -1 ) {
    os.write( buffer, 0, bytes );
    os.flush();
    i++ ;
    System.out.println( "bytes sent : " + i + " KB " ) ;
    os.close();
    fis.close();
    The code above post's the file back...
    in your case you want the output of your command so use "Runtime.runexec" and run your command on the server..
    use the above code and replace the file downloading part with your code....
    send back the output of the same to the client...
    just in case ...
    if you want to do any random commands... you need to let your server knwo that and the code for that needs to be persent on the system.
    by the way this is pure vanilla and it needs to be modified a lot.
    Regards,
    myraid

  • Can't connect to X11 window server using '127.0.0.1:0.0'

    Oracle 9i R2 on Redhat Fedora Core 2
    In the terminal on Xwindow enviroment
    # xhost +
    # su - oracle
    $ export DISPLAY=127.0.0.1:0.0
    $./runInstaller
    It display error messege below
    Exception in thread "main" java.lang.InternalError: Can't connect to X11 window server using '127.0.0.1:0.0' as the value of the DISPLAY variable.
    Why can't connect to X11 window server? Can you tell me how to solve that problem? Thanks

    hello
    I am trying to install Oracle 10g in Sun Solaris 10 all the while I ahve the following error. Please help to install oracle in sun solaris environment.
    I have tried all the step of installation
    Starting Oracle Universal Installer...
    Checking installer requirements...
    Checking operating system version: must be 5.6, 5.7, 5.8 or 5.9. Actual 5.10 Failed <<<<
    Ignoring required pre-requisite failures. Continuing...Preparing to launch Oracle Universal Installer from /tmp/OraInstall2005-08-07_10-51-43AM. Please wait ...$ Oracle Universal Installer, Version 10.1.0.3.0 Production
    Copyright (C) 1999, 2004, Oracle. All rights reserved.
    Xlib: connection to ":0.0" refused by server
    Xlib: No protocol specified
    Can't connect to X11 window server using ':0' as the value of the DISPLAY variable.
    :0
    :0
    Unable to start an interactive install session because of the following error:Can't connect to X11 window server using ':0' as the value of the DISPLAY variable. The DISPLAY environment variable should be set to <hostname or IP address>:<screen>, where the <screen> is usually '0.0'.
    Depending on the Unix Shell, you can use one of the following commands as examples to set the DISPLAY environment variable:
    - For csh: % setenv DISPLAY 192.168.1.128:0.0
    - For sh, ksh and bash: $ DISPLAY=192.168.1.128:0.0; export DISPLAY
    Use the following command to see what shell is being used:
    echo $SHELL
    Use the following command to view the current DISPLAY environment variable setting:
    echo $DISPLAY
    - Make sure that client users are authorized to connect to the X Server.
    To enable client users to access the X Server, open an xterm, dtterm or xconsole as the user that started the session and type the following command:
    % xhost +
    To test that the DISPLAY environment variable is set correctly, run a X11 basedprogram that comes with the native operating system such as 'xclock':
    % <full path to xclock... see below>
    If you are not able to run xclock successfully, please refer to your PC-X Server or OS vendor for further assistance.
    Typical path for 'xclock': ''

Maybe you are looking for