How to Set a machine level Environment variable in remote machines

Hi,
I have to set a List($ProjectName) as the value of an environment variable($PROJECTS).
The cmdlet which I tried is :
$remoteMachineList = 'machA', 'machB'
$ProjectName = 'ProjA', 'ProjB', 'ProjC'
foreach($remoteMachine in $remoteMachineList){ icm -comp $remoteMachine {
[Environment]::SetEnvironmentVariable("PROJECTS",$ProjectName,"Machine")
This doesn't throw any errors but it's not setting the value of it. If I give a string or an integer value directly instead of the $ProjectName in the above code, it's working fine.
PLease Help, Thanks in advance !

You have to do a little more work when supplying outside variables into a PSSession (using Invoke-Command in this case) by using the -ArgumentList parameter and supplying a Param() statement in the scriptblock.
$remoteMachineList = 'machA', 'machB'
$ProjectName = 'ProjA', 'ProjB', 'ProjC'
foreach($remoteMachine in $remoteMachineList){
icm -comp $remoteMachine {
Param ($ProjectName)
[Environment]::SetEnvironmentVariable("PROJECTS",$ProjectName,"Machine")
} -ArgumentList $ProjectName
Boe Prox
Blog |
Twitter
PoshWSUS |
PoshPAIG | PoshChat |
PoshEventUI
PowerShell Deep Dives Book

Similar Messages

  • How to Set and Use a global variable within a session?

    Dear All,
    I'm new to jsp, and would like to ask how to set and use a global variable within a session?
    Thanks in advance.
    Regards,
    Cecil

    With session.setAttribute("name",object) you can store a Attribute in the session object.
    with session.getAttribute("name") you can get it.
    That's it.
    Regards,
    Geri

  • How to set transaction isolation level for a method in a Local Interface

              By reference at:
              http://e-docs.bea.com/wls/docs61/ejb/reference.html#1071267,
              the value for method-intf can only be "Remote" or "Home".
              My question is--
              How to set transaction isolation level for a method inside a Local Interface or
              Local_Home Interface?
              Thanks.
              Xing
              

    I'd try 6.1SP2. I'm pretty sure this works now.
              -- Rob
              Xing wrote:
              > I tried "Local", but got an error when deploying the EJB jar, saying that only
              > "Remote" or "Home" is allowed.
              >
              > Any idea?
              >
              > Xing
              >
              > Rob Woollen <[email protected]> wrote:
              > >
              > >
              > >Use LocalHome or Local.
              > >
              > >-- Rob
              > >
              > >Xing wrote:
              > >
              > >> By reference at:
              > >> http://e-docs.bea.com/wls/docs61/ejb/reference.html#1071267,
              > >> the value for method-intf can only be "Remote" or "Home".
              > >>
              > >> My question is--
              > >>
              > >> How to set transaction isolation level for a method inside a Local
              > >Interface or
              > >> Local_Home Interface?
              > >>
              > >> Thanks.
              > >>
              > >> Xing
              > >
              > >--
              > >
              > >----------------------------------------------------------------------
              > >
              > >AVAILABLE NOW!: Building J2EE Applications & BEA WebLogic Server
              > >
              > >by Michael Girdley, Rob Woollen, and Sandra Emerson
              > >
              > >http://learnWebLogic.com
              > >
              > >
              > >
              > >
              > ><!doctype html public "-//w3c//dtd html 4.0 transitional//en">
              > ><html>
              > >Use LocalHome or Local.
              > ><p>-- Rob
              > ><p>Xing wrote:
              > ><blockquote TYPE=CITE>By reference at:
              > ><br>http://e-docs.bea.com/wls/docs61/ejb/reference.html#1071267,
              > ><br>the value for method-intf can only be "Remote" or "Home".
              > ><p>My question is--
              > ><p>How to set transaction isolation level for a method inside a Local
              > >Interface
              > >or
              > ><br>Local_Home Interface?
              > ><p>Thanks.
              > ><p>Xing</blockquote>
              > >
              > ><pre>--
              > >
              > >----------------------------------------------------------------------
              > >
              > >AVAILABLE NOW!: Building J2EE Applications & BEA WebLogic Server
              > >
              > >by Michael Girdley, Rob Woollen, and Sandra Emerson
              > >
              > >http://learnWebLogic.com</pre>
              > > </html>
              > >
              > >
              AVAILABLE NOW!: Building J2EE Applications & BEA WebLogic Server
              by Michael Girdley, Rob Woollen, and Sandra Emerson
              http://learnWebLogic.com
              [att1.html]
              

  • How do i get value of Environment variables from a java program?

    Hai,
    I have a setup file wherein i set the path for the root directory , in the following way.
    setenv TPEROOT "/home/systpe/khurram/changes"
    when i give echo $TPEROOT
    the path , home/systpe/khurram/changes , is displayed on the console
    If i want to assign the $TPEROOT to a string variable str in my java program , then how can i do it.
    I want to use the value of the environment variable in my program.
    Any help in this regard would be very useful
    Thanks
    khurram

    java -DTPEROOT=$TPEROOT my&#337;ackage.myclass myargs

  • How to set the value of a variable in a cluster in LabVIEW from C#?

    Hi guys, I'm working on a small c# program, which using the interface provided by LabVIEW.  And I know that, using lv.SetControlValue(name, value) can set a variable just on the front panel. But in my case, there're several clusters on the front panel. So it confused me how to set the variables in these clusters. For example there's a cluster named clusterA, and a variable in it named valueA, I've tried something like this:
    lv.SetControlValue("clusterA.valueA",1);
    but it totally not work. Anyone has some experience about this stuff? Thanks a lot!!
    Solved!
    Go to Solution.

    Hey guys, thanks a lot for all your reply. I just find a simply way to solve this porblem. For example, there a cluster named "ClusterA", and there are only two control values in it, which are: an int value named "IntA" (default value IntA = 10)and a  string value named "StringA" (default value StringA = "abc"). In C# if you invoke the method:
    var clusterA = (Array) vi.GetControlValue("ClusterA");
    you will get an Array looks like: clusterA = {10, "abc"}; Then if you want to change IntA to 123, you just need to do:
    clusterA.SetValue(123, 0); // 123 is the value, 0 is the index of IntA in the array clusterA, after this clusterA = {123, "abc"}
    After this, you just need to give the array back to LabVIEW by using:
    vi.SetControlValue("ClusterA", clusterA);
    and now see the panel in you LabVIEW, the IntA is changed.

  • How do I use a UNIX environment variable for the path of a file name

    We are running Forms 6i over the web. The forms server runs on a UNIX (HP-UX) machine.
    I want to read the contents of a file, which is simple enough, using the TEXT_IO package. However, I want to reference a UNIX environment variable that specifies the file path i.e
    PROCEDURE get_file IS
    in_file Text_IO.File_Type;
    linebuf VARCHAR2(1800);
    filename VARCHAR2(200);
    BEGIN
    filename:= '$LOG_DIR/RCAS181.log';
    in_file := Text_IO.Fopen(filename, 'r');
    .....other stuff
    Notice the filename string references my unix env variable '$LOG_DIR'. However, this doesnt work. If I put the full pathname it works fine.
    Any suggestions ?

    Have a look at TOOL_ENV.GETVAR()

  • Servlets: how do I get client's environment variables

    Hi everybody
    I make various servlets, and like to get the client's environment variables (such as used by the SET command under Windows). Especially username which is set in Windows-NT.
    Are there any straight forward way to get these?
    .. or can I get them and return them via a javaScript?
    Arne

    The servlet runs on the server. The browser and JavaScript run on the client. If you wanted to use JavaScript to pass them back, you would have to pass them back to the server through another servlet.
    Or you could use an applet and get at the standard Java properties. Nobody should use environment variables anyway, as you can't guarantee a computer even has them. :-)

  • How to set report output to session variable

    Hi,
    Is there any way to set report output to session variable . If my report returns 1 row and 1 column.
    I have a dashboard prompt where i am selecting Name , but i want to find out the ID of that name .
    that ID i want to pass to a column Fx , to achieve this i created a intermediate report and i got the ID. Now my problem is how do i set this ID in session variable .
    Please help if anyone knows...

    Did you read this:
    how to set session / presentation variable in repository variable
    Dashboard prompt on Month Name but report filter on month ID:
    Re: Dashboard prompt on Month Name but report filter on month ID needed
    If you have dashboard prompt (name) then you may have only one report that is filtered by name but show id or not show id but use id in the function. Or two reports like in the solution in the second link above and the second report has id in the function and filter by id from the first report. You don't need to set this ID in session variable for this example.
    Please close your previous threads if they are answered.
    Regards
    Goran
    http://108obiee.blogspot.com

  • How to set Transaction isolation level in Weblogic 11g

    How do I set the transaction isolation level in Weblogic?
    Some references that I found suggest that I have to explicitely state the isolation level in the weblogic-ejb-jar.xml per ejb. If I am using EJB 3.0 why would I need to do that?
    Can I set this up as a property in the JDBC datasource setup?
    Other application servers like Websphere actually allows for this. Can this be done in Weblogic?
    Currently I get the following message if I don't set the isolation level:
    Transaction attribute: TX_NOT_SUPPORTED Isolation Level: No Isolation Level Set Tx Timeout: 30000
    What seems to be happening is that one update of my transaction is getting rolled back and other consequent calls are failing due to foreign key issues due to the first rollback.
    I think the issue is related to the isolation level or the transaction time out being too low.
    Any ideas?
    BTW: I am using openjpa and using a MS SQLServer. Not sure if that helps the discussion.
    Thanks
    Edited by: rrivera on Jun 2, 2010 9:18 AM

    How do I set the transaction isolation level in Weblogic?
    Some references that I found suggest that I have to explicitely state the isolation level in the weblogic-ejb-jar.xml per ejb. If I am using EJB 3.0 why would I need to do that?
    Can I set this up as a property in the JDBC datasource setup?
    Other application servers like Websphere actually allows for this. Can this be done in Weblogic?
    Currently I get the following message if I don't set the isolation level:
    Transaction attribute: TX_NOT_SUPPORTED Isolation Level: No Isolation Level Set Tx Timeout: 30000
    What seems to be happening is that one update of my transaction is getting rolled back and other consequent calls are failing due to foreign key issues due to the first rollback.
    I think the issue is related to the isolation level or the transaction time out being too low.
    Any ideas?
    BTW: I am using openjpa and using a MS SQLServer. Not sure if that helps the discussion.
    Thanks
    Edited by: rrivera on Jun 2, 2010 9:18 AM

  • How to set the isolation level on Entity EJBs

    I am using 10.1.3.3 of the OC4J app server.
    I am creating an application that uses EJB 2.1.
    I am trying to set the isolation levels on the EJBs to either serializable or repeatable read.
    When i deploy the EAR file from the OC4J admin console, i can set the isolation level property on the EJB's however when i inspect the orion-ejb-jar.xml file I do not see the isolation level being set. Furthermore, i tried to manually change the isolation setting by editing the orion-ejb-jar.xml and adding the isolation="serialiable" attribute on the entity bean descriptor. I then stopped and restarted the server. I noticed that my change was no longer in the file.
    Can someone please let me know how to solve this problem and set the isolation level on Entity EJBs . Thanks

    I find it at ejb.pdf from BEA.
              The transaction-isolation stanza can contain the elements shown here:
              <transaction-isolation>
              <isolation-level>Serializable</isolation-level>
              <method>
              <description>...</description>
              <ejb-name>...</ejb-name>
              <method-intf>...</method-intf>
              <method-name>...</method-name>
              <method-params>...</method-params>
              </method>
              </transaction-isolation>
              "Hyun Min" <[email protected]> wrote in message
              news:3c4e7a83$[email protected]..
              > Hi!
              >
              > I have a question.
              > How to set the transaction isolation level using CMT in descriptor?
              >
              > The Isolation level not supported in CMT?
              >
              > Thanks.
              > Hyun Min
              >
              >
              

  • How does java access user specific environment variables ?

    Hi,
    I'm running a java application on a W2K o/s. My application needs to be able to access the user environment variables in Windows but I don't know how to do this. Can anyone help ?
    Thanks.

    http://www.rgagnon.com/javadetails/java-0150.html

  • How to set Dynamic value to context variable

    hi all
    Can anyone suggest me how to change value of context variable.
    In short i need to set dynamic value to context variable
    here is my code in web.xml
    *<context-param>*
    *<param-name>sessionTimeOutValue</param-name>*
    *<param-value>200</param-value>*
    *</context-param>*

    ChintanPatel wrote:
    here is my code in web.xml
    *<context-param>*
    *<param-name>sessionTimeOutValue</param-name>*
    *<param-value>200</param-value>*
    *</context-param>*You can set the session time using httpsession.setmaxinactiveinterval

  • System level environment variable stuck on -- for no apparent reason

    A few days ago in my development work I turned on AEDebugSends and AEDebugReceives environment variables in a terminal shell so I could log the apple events being sent by my app. I have done this many times before but now they somehow have gotten on system wide and I can't get them off.
    This means that AppleEvents are being logged for everything - for every user and this is persisting between reboots. -- this is leading to massive console.log and makes my debugging very difficult as every 10 seconds or some apple event gets logged
    here is the output of an env command:
    TERMPROGRAM=AppleTerminal
    TERM=xterm-color
    SHELL=/bin/bash
    AEDebug=1
    TERMPROGRAMVERSION=133
    USER=smorr
    _CF_USER_TEXTENCODING=0x1F5:0:0
    AEDebugOSL=1
    PATH=/bin:/sbin:/usr/bin:/usr/sbin
    PWD=/Users/smorr
    SHLVL=1
    HOME=/Users/smorr
    AEDebugVerbose=1
    AEDebugReceives=1
    LOGNAME=smorr
    AEDebugSends=1
    SECURITYSESSIONID=4144f0
    _=/usr/bin/env
    I have looked at ~/.profile and /etc/profile and /etc/bash_rc and there is nothing that turns on these variables.
    I'd appreciate any help or direction from anyone.

    Hi smorr,
       Are you saying that you actually see those environment variables set in your ~/.MacOSX/environment.plist file or that you discovered that technote and think that you'll find those variables set there? We need to know because no one has ever reported a process programmatically changing that file. It may be there for developers to use and it would certainly be perfect for that. It would be important to be certain about the first report.
       For what it's worth there's a file that Apple's Terminal is notorious for setting incorrectly and that its preference file, ~/Library/Preferences/com.apple.Terminal.plist. If you haven't seen those variables in your ~/.MacOSX/environment.plist file then perusal of the preferences file would be prudent.
    Gary
    ~~~~
       An expert is a person who avoids the small errors as he
       sweeps on to the grand fallacy.
             -- Benjamin Stolberg

  • Setting UI60_ICON and other environment variables

    Hi, I am developing using forms 6i. I tried setting the UI60_ICON environment variable from
    1. The Control Panel -> System -> Advanced -> Environment Variable -> System Variables and
    2. The Registry Editor -> Edit ->New -> String Value
    But my icons will still not appear in my forms. Can some one help me.
    I do not add the .ico extension when I use the icon name. And I also make sure the icon has been place in the path I have stated. The icon appears when I place them in the FORMS60 environment variable.
    I need help.

    Try to set with Registry Editor
    HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE (where you see FORM_PATH and other)
    variable
    UI_ICON instead UI60_icon
    Hope helps

  • How to Get the Client's Environment Variables?

    I have a page which need inputing account of the intranet then send a mail upon the intranet.So,it is important for me to verify if the account is legal or if this account is the user himself or herself in order to refuse any bad sending.
    Of course I can get Environment Variables of "user.name" of my own PC.But How can I get Others before they can send mail?

    You can't read with an applet some system properties, including the "user.name" property. Not even with a signed applet.
    Here you have some links:
    http://java.sun.com/docs/books/tutorial/applet/practical/properties.html
    http://java.sun.com/docs/books/tutorial/applet/practical/security.html
    http://java.sun.com/sfaq/#getProps
    So you should find another way, for instance authentication.

Maybe you are looking for

  • Install dual boot Windows 7 onto Yoga 13

    Hi I'd like to install Win 7 alongside the Windows 8 that came installed on my Yoga. Does anybody have any tips or advice for doing this ..... I don;t want to damage the one key recovery system ... will changing the size of the Windows 8 partition to

  • Four finger swipe not working

    It worked fine til I updated iPhoto earlier today. Anyone have suggestions on how to get it working again? TIA

  • Unresponsive Firefox nessages in my gmail acct., FB acct. and FB warning log ins from a different browser...

    When I am inside my Gmail account checking my email I get the "Firefox is unresponsive" message all the time since about a couple weeks or so. I get the same when inside my FB page. And twice now I got a message from FB that tells me that s/o has log

  • Customer Spl GL 'O' not able to post

    Hi Guru, We are tring to post the transaction with Spl GL 'O" for customer entry..,,but while we are entring profit center in the transaction the system is giving  "PO value is lesser than Order Value" but there is no relation with this error message

  • Enhancements to Standard SAP

    hi experts, i badly need some information on the enhancements to Std SAP. what r the situations and scenarios that std SAP cann't provide solution and which need some enhancements. If anyone prepared some enhancements & know them kindly forward them