Announcement

Collapse
No announcement yet.

Runing batch file via gpo problem

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Runing batch file via gpo problem

    I have two dc (2000 and 2003 )
    On 2003 server i working with gpmc .I have OU named Computers +linked GPO named Power Save.
    I trying via GPO to get control over Power Schemes on Win XP SP2 machines!
    Here is my batch :
    @echo off
    net use x: \\dns_domainname\netlogon
    x:
    powercfg.exe /change "always on" /monitor-timeout-ac 25
    powercfg.exe /SETACTIVE "always on"
    c:
    net use x: /delete
    When I run file on local machine –working fine
    No errors in event viewer (on server and local machine)
    I tried Computer and User Configurations (logon scripts) –:
    Windows Settings ->Scripts->Logon ->\\ dns_domainname\SysVol\ dns_domainname\scripts\powersave.bat ---nothing
    Waiting for help!
    Thank you!

  • #2
    Re: Runing batch file via gpo problem

    You can open a command prompt and type gpresult (at the workstation) to diagnose GPO difficulties. It will tell you which GPOs have run etc.

    I think you have linked this script to the computers OU and then maybe you put the computer into that OU. You'll need to make sure any drive mapping is done by the user, not the computer, at user logon, not computer startup, so maybe you will want to link the script to an OU containing users?
    Best wishes,
    PaulH.
    MCP:Server 2003; MCITP:Server 2008; MCTS: SBS2008

    Comment


    • #3
      Re: Runing batch file via gpo problem

      In Gpresult i see that policy applied !
      Relinking to OU Users -no changes!
      Thank you! May be another ideas?

      Comment


      • #4
        Re: Runing batch file via gpo problem

        What I don't get is the reason for mapping the drive... The powercfg.exe command should exist in every XPSP2 computer... So why do you map the netlogon share?
        If the GPO shows in gpresult, that means that the batch file is not doing what is supposed to. Check again the mapping issue....
        As another idea, you can take a look at EZ GPO. It's free. I never tested it, so please do it yourself before going production.

        Sorin Solomon

        »»»»»
        In order to succeed, your desire for success should be greater than your fear of failure.
        -
        «««««

        Comment


        • #5
          Re: Runing batch file via gpo problem

          Originally posted by ynrahc View Post
          In Gpresult i see that policy applied !
          Relinking to OU Users -no changes!
          Thank you! May be another ideas?
          "Users" is not an OU, it is a Container. GPOs cannot be linked to Containers, they can only be linked to OUs.


          Tom
          For my own and your protection, I do not provide support by private message under any circumstances. All such messages will be deleted and ignored.

          Anything you say will be misquoted and used against you

          Comment


          • #6
            Re: Runing batch file via gpo problem

            I mean Users=FirmNameUsers OU
            Anything else?

            Comment


            • #7
              Re: Runing batch file via gpo problem

              Originally posted by ynrahc View Post
              Anything else?
              If you already mentioned it... Why are you mapping the X drive?

              Sorin Solomon

              »»»»»
              In order to succeed, your desire for success should be greater than your fear of failure.
              -
              «««««

              Comment


              • #8
                Re: Runing batch file via gpo problem

                I want to run my batch on remote machines from there (according to Microsoft)
                I know that each xp machine has powercfg ,but Microsoft says so.
                Again if i run my bat from remote location it's works :something wrong whith gpo settings!by the way now i see replication problem between DC's .Cheking ...
                Thank you for help!

                Comment


                • #9
                  Re: Runing batch file via gpo problem

                  Try downloading third party GPO for global power save control.
                  I used in my last compnay. If i remeber correctly you need to push an agent to all pc. Then import the GPO.
                  http://www.energystar.gov/index.cfm?...t.pr_pm_ez_gpo

                  Comment


                  • #10
                    Re: Runing batch file via gpo problem

                    Originally posted by ynrahc View Post
                    I want to run my batch on remote machines from there (according to Microsoft)
                    Duh? You are running your batch from the scripts' folder... Have you copied powercfg.exe to the share you map as X: ? Have you tried running it from there?
                    Can you point me to Microsoft's article you're referring to?
                    Besides that, have you checked EZ GPO ? Is it any good ?
                    Last edited by sorinso; 9th August 2007, 14:08.

                    Sorin Solomon

                    »»»»»
                    In order to succeed, your desire for success should be greater than your fear of failure.
                    -
                    «««««

                    Comment


                    • #11
                      Re: Runing batch file via gpo problem

                      Let's just look at a few simple things here - we need to establish if the script is actually running via the GPO. At the first line of the script, please add a new line saying:
                      echo hello > c:\testme.txt
                      (Providing the user has write access to the root of C: other wise adjust accordingly)

                      Now try it via the GPO, (not by running it manually from the workstation). Does the file "testme.txt" appear on the workstation's C: drive?
                      • If so, the script is running via GPO and you need to fix the rest of the script, (because GPO is not broken).
                      • If not, the script is not running via GPO and we need to find out why.

                      Let's pin down the cause of the fault, then we can fix it.

                      Let us know how you got along.
                      Best wishes,
                      PaulH.
                      MCP:Server 2003; MCITP:Server 2008; MCTS: SBS2008

                      Comment


                      • #12
                        Re: Runing batch file via gpo problem

                        Originally posted by ynrahc View Post
                        I want to run my batch on remote machines from there (according to Microsoft)
                        I know that each xp machine has powercfg ,but Microsoft says so.
                        Again if i run my bat from remote location it's works :something wrong whith gpo settings!by the way now i see replication problem between DC's .Cheking ...
                        Thank you for help!
                        Originally posted by sorinso View Post
                        Can you point me to Microsoft's article you're referring to?
                        This must be the one;
                        http://support.microsoft.com/kb/915160

                        => this batch is only an User configuration logonscript!
                        "Note The first time that the user logs on to the user's computer, the policy will fail because the other rights and permissions have not taken effect. The second time that the user logs on to the computer, the policy is applied, and the user has permission to change the power scheme settings."

                        \Rems

                        This posting is provided "AS IS" with no warranties, and confers no rights.

                        __________________

                        ** Remember to give credit where credit's due **
                        and leave Reputation Points for meaningful posts

                        Comment


                        • #13
                          Re: Runing batch file via gpo problem

                          10nx, Rems...

                          Sorin Solomon

                          »»»»»
                          In order to succeed, your desire for success should be greater than your fear of failure.
                          -
                          «««««

                          Comment


                          • #14
                            Re: Runing batch file via gpo problem

                            In EZ GPO i can't manage HD +i need it.
                            I'm linking my gpo to "firm users" OU or "Firmcomputers " OU but Microsoft says in
                            915160 New policy under domain container is it critical?
                            Thank you !

                            Comment


                            • #15
                              Re: Runing batch file via gpo problem

                              Download Beta Version 2.1.0

                              There is an option for - AC/DC No User HardDrisk Spindown Timeout
                              Attached Files

                              Comment

                              Working...
                              X