How to Pass password to Run as a Network Account in powershell

Hello,
I ve been asked to raise this as a new topic as given in the link. The response also says that it is not possible to pass the password of a network account in powershell. How else can I implement the requirement?
http://social.technet.microsoft.com/Forums/windowsserver/en-US/41a4ba3d-93fd-485b-be22-c877afff1bd8/how-to-run-a-powershell-script-in-admin-account?forum=ITCG&prof=required
My requirement is that, I am need to run the powershell script via a network account. The powershell is called via a script on an ETL tool. When I ask it to print the output of the below command, the output says " Enter
the password of domain\username:". 
PS > runas
/user:{domain}\{username} powershell -file {nameOfPowershellScript.ps1}
Hence I had to modify the code to pass the password also in the same command. I am new to powershell scripting and the below command doesn't work.
Please suggest the appropriate way to pass the password of the network account.
 Referred to a link http://technet.microsoft.com/en-us/magazine/ff714574.aspx. 
$password = Get-Content c:\temp\password.txt | ConvertTo-SecureString 
$credential = New-Object System.Management.Automation.PSCredential
"CachedUser",$password 
PS > runas
/user:{domain}\{username} powershell -file {nameOfPowershellScript.ps1}
PS >$credential.Password | ConvertFrom-SecureString | Set-Content
c:\temp\password.txt 

Thanks for the pointer. Question that I have is I am referencing sqljdbc4.jar in my application, which in turn using sqljdbc_auth.dll.
Which one should i refernce through <nativelib>. Is it sqljdbc4.jar or sqljdbc_auth.dll.
have added the following line to the .jnlp.
<nativelib href="sqljdbc4.jar"/>
But still it is complaining on sqljdbc_audth.dll. If it is sqljdbc_auth.dll, can I use <nativelib> to pass it.
In that case does it need to be signed?. If so,
Is it possible to sign .dll using 'jarsigner'?.
Edited by: 878645 on Apr 26, 2012 3:43 PM

Similar Messages

  • How to pass password from jsp to Applet

    Hi ,
    I can pass the user to applet like below. But password will be seen from view source.
    How can pass password without showing in the view source.
    <PARAM NAME="loginname" VALUE="<%=request.getParameter("loginname")%>">
    <PARAM NAME="loginpassword" VALUE="<%=request.getParameter("loginpassword")%>">
    Thanks in advance.
    Rockesh

    Or alternatively, determine why you need to pass the password on to the Applet.
    For example, if the Applet needs to log into a resource, it is much more secure to ask the user for a password then, as opposed to getting the password from a form, passing it on to the Applet and then having the Applet blindly relay the password to the server, the database, whatever.
    If the Applet doesn't need to do anything with the password, then I must question the wisdom of passing on the password in the first place.
    If the Applet uses the password to do authentication, then the best solution is to generate hashes of the password and compare those hashes as needed. This would make it much more difficult for someone to either eavesdrop on it, or guess it through random trial and error. We can take it one step further. When the JSP code is executed - generate a one time unique password that's extremely long, at least 128 characters. Embed the password in the resulting HTML page as a hidden field and seed the Applet with the password. That would tie the Applet to a particular web page.
    I really like SpinyNorman's JavaScript, but if that's indeed your purpose, you might as well do it in the Applet itself. In other words, it's kind of pointless to ask for a password in order to launch the Applet - once the user gets the Applet's URL by some means, he can just bypass the JavaScript authentication.

  • How could become my iPhone runs on all networks

    How could become my iPhone runs on all networks

    There is no "format" to change.
    No one can help you if you cannot or will not clearly explain the problem.

  • AIX 5.2 : how to pass password value while creating a user on AIX server

    Hi ,
    Test connection is successful with AIX server , I can successfully create a user on AIX server, with defualt password.
    I am not passing the any password value still some default value is being populated for the user...
    In AIX while creating the user , use get force to set the password...
    But while configuring the schema for AIX adapter ...if password attribute is given then it will give the error
    as invalid attribute...while creating a user if password value pass...
    how to set the password for the user..what attribute need to set for the password .
    thanks ..

    The default password might be the IdM account password of the user you are trying to provision. You don;t need to keep password in the resource schema. Just set password.password and password.confirmPassword and select AIX resource for password reset. Check the workflow-form-views document for more information on password view.

  • How to hide password when run proc

    hi,
    my database is on oracle 10g, in my application i run proc from remote computer where i hav to write hole the path like
    @server.exe username/password@sid price
    so is there any solution by i can hide my password & no one can know my passowrd where he can see this syntax.
    thxs

    You can put the password string in a file and use that file.

  • Pass password to runas command?

    Is there any way to do this? I need to kick off a executable on a Windows 2000 system but I need to do it as Administrator. I was going to use the runas command, but apparently there is no parameter for password. Instead, it prompts for it. Is there any way to fill in a prompt after you run it?
    I'm guessing the answer is no since once you start the program with a run process it's off doing it's own thing, but figured I'd ask.
    Anyone have any other suggestions?
    Thanks,
    James

    I don't know or have su.exe, so I can't say for sure. But generally speaking it is possible to start cmd.exe, then send commands to it, including "set". Like the following:    public static void main(String[] args) throws Exception {
            String c = "cmd.exe";
            System.out.println(c);
            Process p = Runtime.getRuntime().exec(c);
            PrintWriter writer = new PrintWriter(p.getOutputStream());
            BufferedReader in = new BufferedReader(
                new InputStreamReader(p.getInputStream()));
            Thread.currentThread().sleep(1000);
            writer.println("set foo=bar");
            writer.println("set");
            writer.flush();
            Thread.currentThread().sleep(1000);
            while (in.ready()) {
                System.out.println("From process: " + in.readLine());
            System.out.println("Process \'" + c + "\' finished");
        }This starts a new instance of command exe, sets the environment variable foo to be "bar" (only in the shell you just started, you don't have to explicitly null it out afterwards), and then lists the environment variables in that shell. However, it's not really bulletproof - I had to toy around with thread.sleep() to get the above to work as intended.
    Another (and probably easier) way might be to have your java program write a small bat file with the required commands, execute it, and delete it again.

  • How to pass password to an lftp connection using shell script

    Hi
    I need to transfer a file to server which support FTPS protocol. I am using lftp utility for this purpose. User credentials used to establish the connection expires after a period(eg: 45 days/3 months) . Can anyone guide me with me an approach to use the password in the shell script which transfer the file to the remote server other than hard coding the password in the script.
    Thanks
    Ramya

    SSH is a better option but unfortunately it's not always available. If you worry about security, you could use the bookmark lftp feature:
    $ lftp ftp://username@server
    Password:
    lftp username@server:~>  set bmk:save-passwords true
    lftp username@server:~> bookmark add yourserver
    lftp username@server:~> bookmark list
    lftp username@server:~> quit
    $ lftp yourserver &
    $ ps -aux | grep lftp
    The password is stored in ~/.lftp/bookmarks (not encrypted) but you can protect the file with the right permissions as you would do with your certificates with SSH.

  • How get permission / password to access Mac on network?

    I have an iMac and an iBook connected to a single wireless network. Both computers access the internet just fine; both use a printer on the same network. (Printer is not wireless; it's connected to the iMac.)
    I'm trying to take the networking to the next level -- specifically, I want to sync Quicken files on the two computers using QuickSync.
    I'm stuck at a very basic level, though. When I click on the icon for network, the name of the laptop comes up. (It's basically my wife's computer, so her name appears.) I click on the icon of that "server" and the name of my computer appears and I am asked to type in a password, to gain access.
    What password am I supposed to enter? My own administrative password doesn't work. Her administrative password doesn't work. I don't see any explanation in "Help" as to how one adds another person to a list of people who can access your computer. What am I doing wrong?

    Before I go this alternate route, I'd like to be able to figure out the basic Apple file-sharing routine. This is supposed to be a basic, simple feature of networked Macs, right?
    I've now got Appletalk enabled on both computers. They are using the same network. Yet when I put files into the "public" or "drop box" of one computer, they do not appear in the public or drop box folder of the other.
    Moreover -- this may be separate from the Appletalk issue-- when I click on Network and request permission to access the "other" computer (in whichever direction), I am asked for a password. It rejects every relevant password I can think of.
    Can anyone else help me out with this? There must be something simple I'm doing wrong. My ultimate goal (syncing Quicken via Quicksync) is a slightly complex operation. But I'm stuck at Apple 101 -- sharing files over two apples linked in a home network. That's supposed to be easy.
    imac 15 / ibook g3 12 Mac OS X (10.3.9)
    imac 15 / ibook g3 12

  • How to config BSP to run in public network

    Dear BSP experts
    I am new to BSP development , i have create one BSP application , and test ok in SAP , and got the URL of the BSP ,it can be tested within our company using the URL , but not outside . so do i need to config something so i can run this BSP application anywhere ? and how ? thanks
    Best Regards
    Jacky

    Hi Jacky,
    You need to assign public IP to your SAP system to be accessed from internet (outside your LAN) and the domain name to be assigned to the server and registered in DNS.
    Otherwise, use web dispatcher to catch and redirect the requests to SAP server.
    Regards,
    Ravi

  • I can not run any Adobe application (Not responding) with a network account

    HEllo All,
    My First question:
    Which impact will I have if I copy the content of
    /Users/Library/Preferences/
    to:
    HD/Library/Prefernecs/
    Here is my problem related to my first question:
    I installed Illustaror, photoshop, adobe Acrobat Pro, and adobe reader on my iMace runing 10.6.1.
    I installed its with my local admin account and all run fine.
    I also have a X OS Server with network account.
    I joined my iMac on that server and when I log with a network account, all of my a
    Adobe application are not responding (Illustartor, Photoshop, Adobe Pro and Adobe)
    I red That I should copy /users/Library/Preferences/Adobe Illusratot CS4 Setting/ folder to the user home folder within the same path.
    This is work.
    But how can I make sure that all of ALL my Adobe application will work for all Users??
    many than for your help
    Message was edited by: pierrot10

    Hello,
    Someone has an idea to help?
    The problem is for illustrator, adobe reader and adobe pro. For all of them, when I run it with a locl account, it works, but when I run its from the same workstation but with a network account:
    - illustartor freez
    - adobe reader craches and retsat and craches...
    - Adobe Acrobat pro freez.
    Only photoshop works.
    Do you have an idea how can I make it working with a network account but only from the same workstation?
    Many thank for your help
    Pierrot

  • How to pass username and password while invoking a web service through wsdl

    Hello All,
    i am calling a web service through wsdl, but it is giving error 401. i want to know how to pass userid and password when i am invoking webservice?
    i am using NetBeans 6.1.
    i did following thing:
    First i created one web application, then i right clicked on project new->web service client, and gave the url for my wsdl.
    after that i create one main class and try to call my required operation by that wsdl.
    Thanks in advance

    Thanks dumchikov, i tried the same thing what ever you told but there is no option for security.
    when i right clicked on web service reference its open 1 window which have 2 tab one is quality of service and second is wsdl customization, then i clicked on wsdl customization. which contain Global Customization, Port Types, Port Type Operations, Port Type Faults, Binding, Binding Operations, Services, Ports and External Binding Files. it don't have security option.

  • How to pass user name and password in openConnection method ?

    Hi, Exports,
              I am trying to post data from applet to another application which is
              protected by network password.
              How to pass user name and password when I use openConnection method? In java
              doc, this method looks like do not accept these two parameters.
              Thanks
              ----- my code in applet ---------
              URL url = new URL("http://127.0.0.1/xml/index.cfm");
              URLConnection connection = url.openConnection();
              connection.setDoInput(true);
              connection.setDoOutput(true);
              connection.setUseCaches(false);
              connection.setAllowUserInteraction(false);
              DataOutputStream dos = new DataOutputStream(connection.getOutputStream());
              dos.writeBytes("POST " + path + " HTTP/1.0\r\n");
              dos.writeBytes("Referer: http://127.0.0.1/XML/index.cfm\r\n");
              dos.writeBytes("Content-Type:
              multipart/form-data;boundary=---------------------------7d0b414b04\r\n");
              dos.writeBytes("Host: "+host+":"+port+"\r\n");
              dos.writeBytes("Content-Length:" + buff.length()+"\r\n");
              dos.writeBytes("Connection: Keep-Alive\r\n\n");
              dos.writeBytes("-----------------------------7d0b414b04\r\nContent-Dispositi
              on: form-data;name=\"xmlDoc\"\r\n\r\n");
              dos.writeBytes(buff.toString());
              dos.writeBytes("\r\n-----------------------------7d0b414b04--\r\n");
              dos.close();
              

    you need to negotiate Authentication in ur applet code...
              For example:
              If u r using Form based auth u need to send Post a request with j_user_name &
              j_password to the action j_security_check. and when server returns back the
              cookie
              u need to hold it and pass that cookie to the each and every request made to the
              protected application.
              Basically u need to imitate the browser.
              regards
              aseem
              David wrote:
              > Hi, Exports,
              >
              > I am trying to post data from applet to another application which is
              > protected by network password.
              > How to pass user name and password when I use openConnection method? In java
              > doc, this method looks like do not accept these two parameters.
              >
              > Thanks
              >
              > ----- my code in applet ---------
              > URL url = new URL("http://127.0.0.1/xml/index.cfm");
              > URLConnection connection = url.openConnection();
              > connection.setDoInput(true);
              > connection.setDoOutput(true);
              > connection.setUseCaches(false);
              > connection.setAllowUserInteraction(false);
              > DataOutputStream dos = new DataOutputStream(connection.getOutputStream());
              > dos.writeBytes("POST " + path + " HTTP/1.0\r\n");
              > dos.writeBytes("Referer: http://127.0.0.1/XML/index.cfm\r\n");
              > dos.writeBytes("Content-Type:
              > multipart/form-data;boundary=---------------------------7d0b414b04\r\n");
              > dos.writeBytes("Host: "+host+":"+port+"\r\n");
              > dos.writeBytes("Content-Length:" + buff.length()+"\r\n");
              > dos.writeBytes("Connection: Keep-Alive\r\n\n");
              > dos.writeBytes("-----------------------------7d0b414b04\r\nContent-Dispositi
              > on: form-data;name=\"xmlDoc\"\r\n\r\n");
              > dos.writeBytes(buff.toString());
              > dos.writeBytes("\r\n-----------------------------7d0b414b04--\r\n");
              > dos.close();
              >
              > ------------------------------------------
              

  • How to pass column name at run time in function.

    how to pass column name at run time in function as parameter.
    thank in advance
    pramod patel

    Hello,
    Using dynamic sql you can pass column name to function. well I am not getting what you really want to do ? Please write in more detail. By the way I am providing one example here. see it uses dynamic sql.
    Create or replace function fun_updtest (p_columnname_varchar2 in varchar2,
    p_value_number in number)
    return number is
    v_stmt varchar2(500);
    begin
    v_stmt := 'update emp
    set '||p_columnname_varchar2||' = '||to_char(p_value_number)||'
              where empno = 7369';
    execute immediate v_stmt;
    return 0;
    commit;
    end;
    call to this function can be like this..
    declare
    v_number               number;
    begin
    v_number := fun_updtest('SAL',5000);
    end;
    Adinath Kamode

  • How to pass username and password from form to web service

    Hi All,
    We need to develop an offline interactive to form.
    When on desktop computer, the user has to click on button and it calls a web service (exposed via PI ) which updates the backend.
    But backend needs an authorised user for updation. We have a dummy user with authorisations.
    But how to pass the that username with its password to web service
    Please give your suggestions
    Regards,
    Aditya Deshpande

    i am closing this thread

  • How to pass username and password with the portal url

    i want to access portal from my web site. i have created username and password fields in my web page. when submited , my portal page should open. so how to pass username and password with the portal url.

    This is not straightforward; but it is doable.
    First tell us about your portal version; portal 10.1.4 has a slightly different method of doing it and the pre-10g portals were completely different animals.
    And if you are in AS Rel 2, then the most important document for you would probably be the following:
    [Creating Deployment Specific Pages| http://download-west.oracle.com/docs/cd/B14099_19/idmanage.1012/b14078/custom.htm#i1015535]
    You might want to use it in conjunction with some metalink notes about your portal version and such a login page.
    hope that helps!
    AMN

Maybe you are looking for