Setting environment variables remotely doesn't work for Windows 7

Hi,
$RemoteMachineList = 'machA', 'machB'
$session = New-PSSession $RemoteMachineList
Invoke-Command -Session $session {[Environment]::SetEnvironmentVariable("Role",0,"Machine")}
The above is the code snippet which I've tried for setting a machine level environment variable. After executing this code in a collection of XP and Windows 7 machines, when I go and check the advanced settings->system environment variables, I can see
the new entry "Role" in all the machines. But unfortunately, this env variables actually gets set only in XP machines(I did a set command from a cmd prompt/or an echo command) whereas in Windows 7 machines, this doesn't exists even though it
shows up in the advanced settings->system environment variables.
Tried in several machines, only Windows XP is yielding the required result.
Please help. 
Thanks in advance ! 
-Aravind

Thanks Chen, but still the same result. 
I'll narrow down the scenario(actually two scenarios) as per the way it's behaving on Windows 7 machines.
Case - 1
1. I do a SetEnvironmentVariable remotely.
2. I go to that remote machine and search in advanced settings -> system env variables window. Dont click on the OK Button.  Close these windows.
Result: Yes it is there as an entry.
3. I open up a command prompt and type 'set'
Result: No it is not set.
4. Again open up advanced settings -> system env variables window. Click on the OK Button.  Close these windows.
5. Now open up a command prompt window and type 'set'
Result: It is set now
Case 2:
1. I do a SetEnvironmentVariable remotely.
2. I go to that remote machine and search in advanced settings -> system env variables window. Dont click on the OK Button.  Close these windows.
Result: Yes it is there as an entry.
3. I open up a command prompt and type 'set'
Result: No it is not set.
4. I do a system restart.
5. Open up a command prompt and type 'set'
Result: It is set now
Any idea why this is behaving like this(more or less like setting a user level env variable), please  ? I've to some way get through this obstacle to advance further. Thanks a lot for the support

Similar Messages

  • Application Restart and Recovery APIs doesn't work for windows services

    I am using the Application Restart and Recovery mechanism (provided in Windows API Code Pack for Microsoft.NET Framework) to collect some information (i.e. stack information when there's an unhandledexception)  before my windows service crash down.
    It works well for windows form applications, but the callback method wouldn't be called if the host is a windows service. 
    I have checked the article: https://msdn.microsoft.com/zh-cn/subscriptions/downloads/cc303708
    But it doesn't specify clearly whether it works for a windows service. It seems that the recovery will only be activated when the user interacts with the error dialog of Windows Error Reporting (clicking "close" on the dialog, for example).
    So I am wondering is my guess right that the Application Restart and Recovery mechanism doesn't work for windows services. Or is there a better way to meet my requirement? 

    I would suggest trying ARR if that's what you want to use.  The restart portion won't work, but it doesn't need to as if you fail out of your service, the Windows service controller will handle recovery (up to and including restarting your service).
     You configure those recovery actions either through code or one of the built in administrative tools for services such as services.msc.  
    DebugDiag/ADplus and similar tools ultimately do use built-in APIs; you don't need to add anything external to collect debugging information.  You do however have to write a good deal of code to do somethings.  It's pretty simple to use the unmanaged
    function that I pointed out before and
    MiniDumpWriteDump to write a minidump when you hit an unexpected error(the dbghelp.dll that comes installed with Windows has it so you don't need anything additional installed).  You can even write a basic debugger that literally debugs a process using
    only kernel32 functions (see
    https://msdn.microsoft.com/en-us/library/windows/desktop/ms679301(v=vs.85).aspx if you're interested).  
    WinSDK Support Team Blog: http://blogs.msdn.com/b/winsdk/

  • Oracle client 9i doesn't work for windows ordinary user

    Hello All,
    I've installed oracle 9i client on windows xp. Client software works for user belonging to windows administrators group. it doesn't works for ordinary users not belonging to administrators group. Particularly when i run sqlplus from command line i get following error :
    Incorrect environment variable PLUS_DFLT
    Program execution error.
    i also need access to Oracle ODBC driver.
    When i try to configure ODBC source (created by user with administrator privileges) by common user i get following errors :
    The setup routines for Oracle for Oracle in OraHome9i ODBC driver couldn't be loaded due to system error code 5
    Could not load the setup or translator library
    Very appreciate for any help.
    Regards Arkadiusz Masny

    It sounds like the users on the machine do not have access to the Oracle home directory. Check the permissions of the folder by right properties, select the user and check that they have read and then select advanced. Tick the "replace permission entries....." box and apply. This will re apply all user rights in all folders and subfolders. Try again.
    HTH Mark F

  • My Mic Doesn't Work for Windows 7!

    My laptop Model is a Satellite M305-S4910 I just last week got my laptop upgraded to Windows 7, but when I use video chat on MSN Messenger or Skype or any type of Audio Recording it doesn't work, or when chatting it seems like my voice is from a far distance, Please I need help, It's the only why for me and my boyfriend to talk from overseas, I really need this mic to work Please help me
    Thank You

    Thanks Chen, but still the same result. 
    I'll narrow down the scenario(actually two scenarios) as per the way it's behaving on Windows 7 machines.
    Case - 1
    1. I do a SetEnvironmentVariable remotely.
    2. I go to that remote machine and search in advanced settings -> system env variables window. Dont click on the OK Button.  Close these windows.
    Result: Yes it is there as an entry.
    3. I open up a command prompt and type 'set'
    Result: No it is not set.
    4. Again open up advanced settings -> system env variables window. Click on the OK Button.  Close these windows.
    5. Now open up a command prompt window and type 'set'
    Result: It is set now
    Case 2:
    1. I do a SetEnvironmentVariable remotely.
    2. I go to that remote machine and search in advanced settings -> system env variables window. Dont click on the OK Button.  Close these windows.
    Result: Yes it is there as an entry.
    3. I open up a command prompt and type 'set'
    Result: No it is not set.
    4. I do a system restart.
    5. Open up a command prompt and type 'set'
    Result: It is set now
    Any idea why this is behaving like this(more or less like setting a user level env variable), please  ? I've to some way get through this obstacle to advance further. Thanks a lot for the support

  • Aio remote doesn't work on windows 8.1, can't findprinter

    hp aio remote on windows cannot find my printer.  i could tell it its ip #, but software disallows this, apparently assuming that sw is perfect and users are incompetent, where the opposite is usu true.  similarly, hp has no feedback mechanism and won't let me use support because mine expired a few mo ago.  so no way to tell hp they have a serious bug.  so it won't be fixed.  just throw out hp aio remote.  it's totally useless. it does have an install sw button, but my sw is installed, and i don't trust a program that can't find a printer nor tell if it's installed. i did download from hp website the latest full sw, which maybe includes aio remote, no way to tell, but no difference.  it also reports printer is offline when it's not. trying to download the latest aio remote seems impossible.  current doesn't tell me version or date.  new is not on hp web.  they refer me to windows store (without a link, tsk tsk), where i can find it (not in microsoftstore.com, but under windows.microsoft.com).  it says v55, no date.  can't download it because there's no download or install or similar button.  hp's concept of "install" seems different from microsoft's, because aio remote doesn't appear in uninstall cpl (named products & features to confuse users) nor 3rd party uninstallers. nor does the full sw.   there is an entry for basic driver sw, misleading us into thinking full sw not installed.  but it is, according to hp's proprietary noncompatible installation mechanism.    there seems no way to invoke aio remote directly (tsk,tsk)but dbl clicking the printer's icon in cpl devices and printers opens an interface with 4 choices, one of which is the non-working aio remote.  the other 3 work. (what's printing, prefs, and customize) it does work on android 4.x (name your own desert).  maybe it's not intended to work on windows?  they why distribute it? my serial # (in case hp reads this and wants to check it out) is th41f7104x and model # 7520e.  great printer.  full sw seems good, scan to pc, etc.  ews (embedded web server interface) works fine except security is unavailable.  hp uses a bogus certificate for its ews.  what's up with that?  presumably there's a way to get hp's cert and copy into my approved cert store, but if there is, i sure can't find it nor any docs.   and hesitate to experiment with security stuff, lest it lock me out.  i remember when even windows had docs. don't waste your time trying to get aio remote to work (as did i).  just use the ews, which remains unprotected from anyone on your wifi.

    Hello Lorenzo 1972,
    It sounds like you are unable to open iTunes even after a fresh install with the error that it cannot find the iTunes.exe file. That path, c:\program files (x86)\itunes\itunes.exe leads to the 32 bit program folder for iTunes. If you are using a shortcut you had on the desktop pre install, try going to C:\program files\itunes\ and finding the iTunes.exe file there.
    If not it sounds like iTunes may be installing a damaged copy of the 32 bit version of the application, so I would recommend the following article to help you get any old installation files out so you can install the 64 bit version fresh:
    Issues installing iTunes or QuickTime for Windows
    http://support.apple.com/kb/ht1926
    Thank you for using Apple Support Communities.
    All the best,
    Sterling

  • DVD software doesn't work for Windows 8

    I bought a new Lenovo Slim USB Portable DVD Burner. With the drive came the following software: BurnNow, DVD Movie Factory, WinDVD. Unfortunately that software will work in Windows 7, but it won't install in Windows 8. How can I get the software for Windows 8?

    You can try setting the installer (and then the application .exe's) to run in compatibility mode. See this for more:
    http://www.online-tech-tips.com/windows-8/run-a-pr​ogram-in-compatibility-mode-in-windows-8/
    Note: If you don't get the Compatibility tab on the Properties for the installer apps, try copying them to a folder on a local drive first and running them from there.

  • Graphic card driver update doesn't work for Windows 8.1 upgrade (Ideapad Y500)

    I upgraded my windows 8 to Windows 8.1 today and it probably is a huge mistake. After the upgrade my Ideapad Y500 started to look weird (Firefox stopped working). I searched around for solution and was told that I probably need to upgrade the driver to my graphic card. So I went to the driver download page and downloaded the NVIDIA GeForce GT750M Second VGA BIOS Update for Windows 8.1
    I followed the instruction to run the "Winflash_Yx00s.bat" file, but after I seleted "yes" to let it modify the system, there is a very fast flashing a little black window (too fast for me to see what it is), and nothing happens afterwards. I checked to make sure that nothing is running in the background. After waited for half an hour I tried to restart the computer and still nothing happens. The display still looks weird. 
    Please help me!

    when I read posts like yours I often do the test myself
    so I went into skype both metro and desktop skype and to my horror like you I did not have the option only my logitech webcam was an option
    I went into devices and see that ht had FaceTimeHD camera (Built-in) as malfunctioning not working devices there
    I went to my bootcamp driver zip and ran the apple AppleCamera64.exe
    but little did it help then I googled it
    https://www.google.dk/search?q=bootcamp+facetime+hd+camera+driver&oq=bootcamp+fa cetime+hd+camera+&aqs=chrome.1.69i57j0.9286j0j8&sourceid=chrome&es_sm=93&ie=UTF- 8
    came across this post at ms
    http://answers.microsoft.com/en-us/windows/forum/windows_8-hardware/facetime-hd- camera/0ef43e8a-45bc-4797-99f7-c57848b9f2bb
    did the uninstall of both of the unknown devices as suggested and ran a scan for new hardware and bam!
    the camera was back in action
    suppose looking like a gobling shark made it so I never noticed that win8.1 had broken my facetime cam before you brought it up

  • Windows XP Quicktime doesn't work for Windows XP!!!

    Ok. I bought Quicktime PRO for windows since it had features like looping.
    But... it does not play wmv files!!!
    The ultimate insult is that there is a wmv plugin for MAC version of quicktime.
    And there's no obvious way to rant directly to Apple, or get my money back.
    I do see that there has already been one post on this with no answer... thought I'd try again

    QuickTime Player can't open Windows Media Player formats. It never could and you should have seen that when reading the Web page carefully.
    The plug-in for Mac users is endorsed by Microsoft and is intended to replace the Windows Media Player for Mac. Microsoft hasn't updated WMP for Mac since 2003 and has discontinued it.
    Flip4Mac is third party software that enables most WMP formats be played via QuickTime. Ask them to write a Windows version.

  • OPA download - doesn't work for Windows 8 & Microsoft 2013?

    I downloaded the OPA software on to my laptop however when I am in a project and right click "Rules" - I do not have any options to "add new word document" or "add new excel document".
    Also, when I open a Rules doc that someone had sent me, I do not have OPA in the ribbon.
    Do you know if OPA runs on windows 8 and microsoft word/excel 2013?
    Thanks for your help!

    Per this thread: When will OPA 10.4.3 be released?
    Support for Office 2013 is not yet available, but coming soon...

  • Just bought a pair of earpods for the shuffle 3rd gen the first the remote doesn't work so i exchanged them and these don't work either! I already checked that they are compatible and should work! Any ideas or advice?

    Hi I recently bought a pair of earpods for my 3rd Gen ipod shuffle only the remote does not work, so i exchanged them from an unhelpful member of staff from Currys who said the problem could be my device. So i just tested the new ones and the same problem again! I already checked that they are compatible so i don't understand why the remote doesn't work. Will be greatful with any advice or answers on this one. Thanks!

    Actually they are not compatible: http://store.apple.com/us/product/MD827LL/A/apple-earpods-with-remote-and-mic

  • Photosmart c4580 windows 7 - set up CD doesn't work for Win 7!!!

    Hello,
    I've got my Photosmart c4580  for a while know, I still think it might be possible to get it wirelesse.
    The CD that was sold with it to set up the wifi connection does not work for Windows 7!!! Any idea, what I could download instead? All drivers are updated.
    Many thanks indeed,
    Caroline

    You need to download and install the full feature software and drivers for Win 7 here. http://h10025.www1.hp.com/ewfrf/wc/softwareCategory?os=4062&lc=en&cc=us&dlc=en&sw_lang=&product=3418... Now try.
    Say thanks by clicking the Kudos Thumbs Up to the right in the post.
    If my post resolved your problem, please mark it as an Accepted Solution ...
    I worked for HP but now I'm retired!

  • Mountain Lion: how set environment variables

    Am I correct that for Mountain Lion, if not earlier, the only way to set environment variables at the system level is to use (or create) a file /etc/launchd.conf that contains commands such as:
    setenv CATALINA_BASE /opt/local/share/java/tomcat6
    (That does seem to work as expected.)
    If so, how does one do this by referencing the value of something else, e.g., to set JAVA_HOME? I tried
    setenv JAVA_HOME $(/usr/libexec/java_home)
    but then in Terminal if I run
    echo $JAVA_HOME
    I just get back $(/usr/libexec/java_home).
    By contrast, if I put that same setenv JAVA_HOME $(/usr/libexec/java_home) command into my ~/.profile, then the result of echo $JAVA_HOME is the actual value referenced, namely, /Library/Java/JavaVirtualMachines/jdk1.7.0_15.jdk/Contents/Home.

    Linc Davis wrote:
    launchd is not a shell and does not peform expansion. You have to use literal expressions. But you can also modify the bash environment system-wide by editing the file /etc/profile.
    But sudo emacs /etc/profile won't let me edit this file: it's read-protected, emacs says.
    What permissions should I give it? Right now it's in group wheel, owned by root but with Read permission only.
    P.S. And is it really a good idea to edit /etc/profile -- assuming I can suitably set the permissions to do so? Apple goes out of its way to try to hide this file: /etc is a link to /private/etc, e.g.

  • How to set environment variable ORACLE_HOME ?

    Hi
    I trying to install SAP Solution manager 4.0 SR3:
    OS: Linux RHEL4u4
    DB: Oracle
    SAPinst now stops the installation.
    To proceed with the installation, install the Oracle database as follows:
    1.Log in as user orassm.
    2.Set the DISPLAY variable.
    3.Change to directory /oracle/stage/102_32/database/SAP.
    4.Start './RUNINSTALLER'.
    After you installed the Oracle database software, proceed with the database instance
    installation by choosing 'OK' in this dialog box.
    ./RUNINSTALLER
    oracle_stage is not set (OK)
    oracle_base is not set (OK)
    oracle_home is not set (OK)
    oracle_sid is not set (OK)
    oracle_home_name is not set (OK)
    oracle_inst_group is not set (OK)
    from_location is not set (OK)
    tmp_netca_file is not set (OK)
    tmp_dbca_file is not set (OK)
    Working in /oracle/stage/102_32/database/SAP ...
    The environment variable ORACLE_HOME is not set! abort ...
    How to set environment variable ORACLE_HOME ?
    Regards
    Eric

    i
    Switch shell to bash:
    orassm:x:502:503:SAP Database Administrator:/oracle/SSM:/bin/bash
    [root@csp-p-sm00 ~]# su - orassm
    [orassm@csp-p-sm00 ~]$
    But when try to run ./RUNINSTALL
    [orassm@csp-p-sm00 SAP]$ ./RUNINSTALLER
    oracle_stage is not set (OK)
    oracle_base is not set (OK)
    oracle_home is not set (OK)
    oracle_sid is not set (OK)
    oracle_home_name is not set (OK)
    oracle_inst_group is not set (OK)
    from_location is not set (OK)
    tmp_netca_file is not set (OK)
    tmp_dbca_file is not set (OK)
    Working in /oracle/stage/102_32/database/SAP ...
    The environment variable ORACLE_HOME is not set! abort ...
    Additionaly I've post csh.cshrc and csh.login
    /etc/cshrc
    csh configuration for all shell invocations.
    by default, we want this to get set.
    Even for non-interactive, non-login shells.
    [ "`id -gn`" = "`id -un`" -a `id -u` -gt 99 ]
    if $status then
            umask 022
    else
            umask 002
    endif
    if ($?prompt) then
      if ($?tcsh) then
        set prompt='[%n@%m %c]$ '
      else
        set prompt=\[`id -nu`@`hostname -s`\]\$\
      endif
    endif
    if ( $?tcsh ) then
            bindkey "^[[3~" delete-char
    endif
    setenv MAIL "/var/spool/mail/$USER"
    limit coredumpsize 0
    if ( -d /etc/profile.d ) then
            set nonomatch
            foreach i ( /etc/profile.d/*.csh )
                    if ( -r $i ) then
                            source $i
                    endif
            end
            unset i nonomatch
    endif
    /etc/csh.login
    System wide environment and startup programs, for login setup
    if ($?PATH) then
            if ( "$" !~ /usr/X11R6/bin ) then
                    setenv PATH "$:/usr/X11R6/bin"
            endif
    else
            if ( $uid == 0 ) then
                    setenv PATH "/sbin:/usr/sbin:/usr/local/sbin:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin"
            else
                    setenv PATH "/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin"
            endif
    endif
    setenv HOSTNAME `/bin/hostname`
    set history=1000
    if ( ! -f $HOME/.inputrc ) then
            setenv INPUTRC /etc/inputrc
    endif
    Regards
    Eric

  • Runtime.exec and setting environment variables

    Runtime.exec and setting environment variables
    I need a decent example which works on Windows.
    Got any?

    Thank you.
    I was hoping for an example of the use of
    http://java.sun.com/j2se/1.4.1/docs/api/java/lang/Runti
    e.html#exec(java.lang.String,%20java.lang.String[]) or
    http://java.sun.com/j2se/1.4.1/docs/api/java/lang/Runti
    e.html#exec(java.lang.String,%20java.lang.String[],%20j
    va.io.File) which take environment variable
    information such as PATH.
    The reason is because there is a library which is
    being loaded via loadLibrary (
    http://java.sun.com/j2se/1.4.1/docs/api/java/lang/Syste
    .html#loadLibrary(java.lang.String) ). However, for
    the child process to find the library the PATH needs
    to be updated.
    Any example regarding changing the PATH variable via
    Java so that libraries can be loaded and processes
    created? (Perhaps, I should make a new post and
    restate the question with this more explicit
    information?)
    That won't work. LoadLibrary occurs in the JVM environment. As I said you can't change the JVM environment via exec().
    If the shared library needs something in the path then you are going to have to set the path before your application starts up.
    If you just need to load the library from someplace that is not on the path then you should be using System.load().

  • The wifi at my school isn't very good. And I can't send iMessages through it. It works for some apps like score center and my radar app, but doesn't work for other apps like clash of clans and iMessage. How can I get it to work on that  wifi network

    The wifi at my school isn't very good. And I can't send iMessages through it. It works for some apps like score center and my radar app, but doesn't work for other apps like clash of clans and iMessage. How can I get it to work on my school wifi. I have an iPhone 4S on AT&T and iOS 7.04

    In a roaming network, your "main" router is the device that would require port mapping/forwarding to be configured in order to access the IP camera from the Internet. This router is also the one that would be provide the private IP address for the camera which you will want to be a static one.
    So as you described your network, the IP cameras should be getting an IP address or you assigned it a static one and this is the address that you would enter in the Private IP address (or equivalent depending on the router used) field when setting up port mapping.
    If you are not able to access this camera from the local network, then this should be troubleshot first.

Maybe you are looking for

  • Can I edit a PDF once it's created?

    I have a design contract I've made in Illustrator and then saved as a PDF doc. Unfortunately every time I have a client I have to edit the thing in Illustrator, then save it as a PDF again. This can be tedious as well as a waste of time. Is there a w

  • Want to clear images out of Aperture and start over

    Probably a dumb question, but I "played" around with Aperture-- imported some images etc and even have a couple of projects. However, after doing some study-- listening to tutorials I would like to start over. How can I clear everything out without l

  • Run  one Process without Button Click

    Hi Guys, I created one report using a simple Select. select ID_FACTURE, ID_NUM from FACTURE In Report Attributes I edited ID_FACTURE and in Column Link I put this: Link Text: <img src="#APP_IMAGES#delete.png"; border="0"> Target: Page in this Applica

  • How do I cancel adobe export pdf subcription

    how do i cancel a subscription for adobe export pdf?

  • Warning message in oc4j log when using af:region

    Hello - (Jdev 10.1.3 SU2) When testing my ADF faces app, the first time someone hits a page that uses a region, the following message appears in the embedded OC4J server log. I am concerned about the "WARNING" part - is this message normal or does it