Solved

Error running powercfg command duirng SCCM 2007 OSD via Task Sequence

Posted on 2011-09-13
25
3,288 Views
Last Modified: 2012-08-14
During Operating System Deployment  of a Windows 2003/XP Operating System via Task Sequence in SCCM 2007 R2 SP2 (NOT R3, we are not running and will not be running R3), I need to be able to create a new power scheme via command line or script, and then set configure some specific settings via command line or script.

The commands I need to run are as follows:

powercfg /create “MyScheme Standard”
powercfg /change " MyScheme Standard" /monitor-timeout-ac 0
powercfg /change " MyScheme Standard" /standby-timeout-ac 0
powercfg /change " MyScheme Standard" /disk-timeout-ac 0
powercfg /hibernate off
powercfg /setactive "MyScheme Standard"

Right now, I have an operating system task sequence that Reboots the computer to the “Currently Installed Default Operating System”

Then, the task sequence attempts to run the series of line item objects below.

Line Item Object 1
Type: Run Command Line
Name: Create Power Scheme
Description:
Command Line: powercfg /create “MyScheme Standard”
Disable 64-bit Redirection: Unchecked
Start in: C:\Windows\system32
Package: Unchecked
Time out (minutes): 5 minutes
Run this step as the following account: Unchecked

Line Item Object 2
Type: Run Command Line
Name: Turn off Monitor Timeout
Description:
Command Line: powercfg /change " MyScheme Standard" /monitor-timeout-ac 0
Disable 64-bit Redirection: Unchecked
Start in: C:\Windows\system32
Package: Unchecked
Time out (minutes): 5 minutes
Run this step as the following account: Unchecked

Line Item Object 3
Type: Run Command Line
Name: Turn off Standby
Description:
Command Line: powercfg /change " MyScheme Standard" /standby-timeout-ac 0
Disable 64-bit Redirection: Unchecked
Start in: C:\Windows\system32
Package: Unchecked
Time out (minutes): 5 minutes
Run this step as the following account: Unchecked

Line Item Object 4
Type: Run Command Line
Name: Set Disk Timeout to 0
Description:
Command Line: powercfg /change " MyScheme Standard" /disk-timeout-ac 0
Disable 64-bit Redirection: Unchecked
Start in: C:\Windows\system32
Package: Unchecked
Time out (minutes): 5 minutes
Run this step as the following account: Unchecked

Line Item Object 5
Type: Run Command Line
Name: Turn off Hibernate
Description:
Command Line: powercfg /hibernate off
Disable 64-bit Redirection: Unchecked
Start in: C:\Windows\system32
Package: Unchecked
Time out (minutes): 5 minutes
Run this step as the following account: Unchecked

Line Item Object 6
Type: Run Command Line
Name: Set MyScheme to Active
Description:
Command Line: powercfg /setactive "MyScheme Standard"
Disable 64-bit Redirection: Unchecked
Start in: C:\Windows\system32
Package: Unchecked
Time out (minutes): 5 minutes
Run this step as the following account: Unchecked

Unfortunately, the process errors out on Line Item Object 1 with an error stating the following.

Start executing an instruction. Instruction name: Create "MyScheme Standard" Power Scheme. Instruction pointer: 145      TSManager      9/12/2011 7:16:04 PM      2480 (0x09B0)
Set a global environment variable _SMSTSCurrentActionName=Create "MyScheme Standard" Power Scheme      TSManager      9/12/2011 7:16:04 PM      2480 (0x09B0)
Set a global environment variable _SMSTSNextInstructionPointer=145      TSManager      9/12/2011 7:16:04 PM      2480 (0x09B0)
Set a local default variable SMSTSDisableWow64Redirection      TSManager      9/12/2011 7:16:04 PM      2480 (0x09B0)
Set a local default variable _SMSTSRunCommandLineAsUser      TSManager      9/12/2011 7:16:04 PM      2480 (0x09B0)
Set a global environment variable _SMSTSLogPath=C:\WINDOWS\system32\CCM\Logs\SMSTSLog      TSManager      9/12/2011 7:16:04 PM      2480 (0x09B0)
Expand a string: smsswd.exe /run: powercfg /create “MyScheme Standard”      TSManager      9/12/2011 7:16:04 PM      2480 (0x09B0)
Expand a string:       TSManager      9/12/2011 7:16:04 PM      2480 (0x09B0)
Command line for extension .exe is "%1" %*      TSManager      9/12/2011 7:16:04 PM      2480 (0x09B0)
Set command line: smsswd.exe /run: powercfg /create “MyScheme Standard”      TSManager      9/12/2011 7:16:04 PM      2480 (0x09B0)
Start executing the command line: smsswd.exe /run: powercfg /create “MyScheme Standard”      TSManager      9/12/2011 7:16:04 PM      2480 (0x09B0)
!--------------------------------------------------------------------------------------------!      TSManager      9/12/2011 7:16:04 PM      2480 (0x09B0)
Expand a string: WinPEandFullOS      TSManager      9/12/2011 7:16:04 PM      2480 (0x09B0)
Executing command line: smsswd.exe /run: powercfg /create “MyScheme Standard”      TSManager      9/12/2011 7:16:04 PM      2480 (0x09B0)
=======================[ smsswd.exe ] =======================      InstallSoftware      9/12/2011 7:16:04 PM      3736 (0x0E98)
PackageID = ''      InstallSoftware      9/12/2011 7:16:04 PM      3736 (0x0E98)
BaseVar   = '', ContinueOnError=''      InstallSoftware      9/12/2011 7:16:04 PM      3736 (0x0E98)
SwdAction = '0001'      InstallSoftware      9/12/2011 7:16:04 PM      3736 (0x0E98)
Set command line: Run command line      InstallSoftware      9/12/2011 7:16:04 PM      3736 (0x0E98)
Working dir 'not set'      InstallSoftware      9/12/2011 7:16:04 PM      3736 (0x0E98)
Executing command line: Run command line      InstallSoftware      9/12/2011 7:16:04 PM      3736 (0x0E98)
Process completed with exit code 1      InstallSoftware      9/12/2011 7:16:04 PM      3736 (0x0E98)
Invalid Parameters -- try "/?" for help      InstallSoftware      9/12/2011 7:16:04 PM      3736 (0x0E98)
Command line returned 1      InstallSoftware      9/12/2011 7:16:04 PM      3736 (0x0E98)
Process completed with exit code 1      TSManager      9/12/2011 7:16:04 PM      2480 (0x09B0)
!--------------------------------------------------------------------------------------------!      TSManager      9/12/2011 7:16:04 PM      2480 (0x09B0)
Failed to run the action: Create "MyScheme Standard" Power Scheme.
Incorrect function. (Error: 00000001; Source: Windows)      TSManager      9/12/2011 7:16:04 PM      2480 (0x09B0)
Sending status message . . .      TSManager      9/12/2011 7:16:04 PM      2480 (0x09B0)
Send a task execution status message SMS_TSExecution_ActionFailError      TSManager      9/12/2011 7:16:04 PM      2480 (0x09B0)
MP server MYSERVER.MYDOMAIN.COM and port 80. SSL=false. CRL=false.      TSManager      9/12/2011 7:16:04 PM      2480 (0x09B0)
Site code: BCG      TSManager      9/12/2011 7:16:04 PM      2480 (0x09B0)
Client machine name: TEST001      TSManager      9/12/2011 7:16:04 PM      2480 (0x09B0)
Client Identity: GUID:8AF69A04-6DA0-4090-A210-527029DBDA47      TSManager      9/12/2011 7:16:04 PM      2480 (0x09B0)
Advertisement ID: BCG20361      TSManager      9/12/2011 7:16:04 PM      2480 (0x09B0)
Package ID: BCG00306      TSManager      9/12/2011 7:16:04 PM      2480 (0x09B0)
Sending StatusMessage      TSManager      9/12/2011 7:16:04 PM      2480 (0x09B0)
Formatted header:      TSManager      9/12/2011 7:16:04 PM      2480 (0x09B0)
<Msg SchemaVersion="1.1" ReplyCompression="zlib"><ID/><SourceID>6e54fc07-f39e-4d2a-87ff-cc4bc1376576</SourceID><SourceHost/><TargetAddress>mp:[http]MP_StatusManager</TargetAddress><ReplyTo>direct:OSD</ReplyTo><Priority>3</Priority><Timeout>3600</Timeout><SentTime>2011-09-12T23:16:04Z</SentTime><Protocol>http</Protocol><Body Type="ByteRange" Offset="0" Length="2810"/><Hooks/><Payload Type="inline"/><TargetHost/><TargetEndpoint>StatusReceiver</TargetEndpoint><ReplyMode>Sync</ReplyMode><CorrelationID/></Msg>
      TSManager      9/12/2011 7:16:04 PM      2480 (0x09B0)
CLibSMSMessageWinHttpTransport::Send: URL: MYSERVER.MYDOMAIN.COM:80  CCM_POST /ccm_system/request      TSManager      9/12/2011 7:16:04 PM      2480 (0x09B0)
The request has succeeded. 200 OK      TSManager      9/12/2011 7:16:04 PM      2480 (0x09B0)
Set a global environment variable _SMSTSLastActionRetCode=1      TSManager      9/12/2011 7:16:04 PM      2480 (0x09B0)
Set a global environment variable _SMSTSLastActionSucceeded=false      TSManager      9/12/2011 7:16:04 PM      2480 (0x09B0)
Clear local default environment      TSManager      9/12/2011 7:16:04 PM      2480 (0x09B0)
Let the parent group (Disable Sleep Mode (WIN XP/WIN2K3)) decides whether to continue execution      TSManager      9/12/2011 7:16:05 PM      2480 (0x09B0)
Let the parent group (Post OS Install Configuration Tasks) decide whether to continue execution      TSManager      9/12/2011 7:16:05 PM      2480 (0x09B0)
Let the parent group (Setup Operating System) decide whether to continue execution      TSManager      9/12/2011 7:16:05 PM      2480 (0x09B0)
The execution of the group (Setup Operating System) has failed and the execution has been aborted. An action failed.
Operation aborted (Error: 80004004; Source: Windows)      TSManager      9/12/2011 7:16:05 PM      2480 (0x09B0)
Failed to run the last action: Create "MyScheme Standard" Power Scheme. Execution of task sequence failed.
Incorrect function. (Error: 00000001; Source: Windows)      TSManager      9/12/2011 7:16:05 PM      2480 (0x09B0)




It looks like SCCM is saying there is some kind of syntax error issue with powercfg /create “MyScheme Standard”

If I log into a fully deployed Windows 2003 or XP OS, I can run this manually without incident.

Is this command something that cannot be run during OSD after the computer has been Rebooted to the “Currently Installed Default Operating System”?

Is there another way to make SCCM run this command?

Should this command be in a VB Script instead?

What type of task sequence line item object do I need to muddle around with to make this work?
0
Comment
Question by:ACECORP
  • 15
  • 5
  • 3
  • +1
25 Comments
 
LVL 9

Expert Comment

by:BlueYonder
ID: 36531896
The easiest way is to do it through group policy.  Here is the link http://support.microsoft.com/kb/915160.
0
 
LVL 5

Author Comment

by:ACECORP
ID: 36531953
I need to use a script or command line object via the OSD Task Sequence. Group policy is not an option.
0
 
LVL 31

Expert Comment

by:merowinger
ID: 36534485
try
cmd /c powercfg /create “MyScheme Standard”
cmd /c powercfg /change " MyScheme Standard" /monitor-timeout-ac 0
cmd /c powercfg /change " MyScheme Standard" /standby-timeout-ac 0
cmd /c powercfg /change " MyScheme Standard" /disk-timeout-ac 0
cmd /c powercfg /hibernate off
cmd /c powercfg /setactive "MyScheme Standard"


0
 
LVL 10

Expert Comment

by:Kezzi
ID: 36535174
what you can try doing is tick the option to continue on error.  sometimes these tasks are successfull but dont return proper success codes so SCCM treats them as failures.  if after continue on error the scheme is not created then you can be sure its not the return codes causing the failure the command itself.
0
 
LVL 5

Author Comment

by:ACECORP
ID: 36538007
merowinger, unfortunately adding the "cmd /c" part in front of each command did not resolve the issue. The exact same error occurred that I have included in my origional post.
0
 
LVL 5

Author Comment

by:ACECORP
ID: 36538029
Kezzi, unfortunately choosing the option to continue on error still resulted in failure. My task sequence continued to the end, but the same invalid parameter error still occurred when executing each command line item.

Once the deployment finishes and I log in as myself, I can execute each command without any problem, but each command results in error when trying to execute it from within the SCCM Task Sequence.

Expand a string: WinPEandFullOS      TSManager      9/12/2011 7:16:04 PM      2480 (0x09B0)
Executing command line: smsswd.exe /run: powercfg /create “MyScheme Standard”      TSManager      9/12/2011 7:16:04 PM      2480 (0x09B0)
=======================[ smsswd.exe ] =======================      InstallSoftware      9/12/2011 7:16:04 PM      3736 (0x0E98)
PackageID = ''      InstallSoftware      9/12/2011 7:16:04 PM      3736 (0x0E98)
BaseVar   = '', ContinueOnError=''      InstallSoftware      9/12/2011 7:16:04 PM      3736 (0x0E98)
SwdAction = '0001'      InstallSoftware      9/12/2011 7:16:04 PM      3736 (0x0E98)
Set command line: Run command line      InstallSoftware      9/12/2011 7:16:04 PM      3736 (0x0E98)
Working dir 'not set'      InstallSoftware      9/12/2011 7:16:04 PM      3736 (0x0E98)
Executing command line: Run command line      InstallSoftware      9/12/2011 7:16:04 PM      3736 (0x0E98)
Process completed with exit code 1      InstallSoftware      9/12/2011 7:16:04 PM      3736 (0x0E98)
Invalid Parameters -- try "/?" for help      InstallSoftware      9/12/2011 7:16:04 PM      3736 (0x0E98)
Command line returned 1      InstallSoftware      9/12/2011 7:16:04 PM      3736 (0x0E98)
Process completed with exit code 1      TSManager      9/12/2011 7:16:04 PM      2480 (0x09B0)
0
 
LVL 5

Author Comment

by:ACECORP
ID: 36539158
I engaged Microsoft Support on this and they are "completely stumped" at how to get past this.

Microsoft Support requested that I "add all the commands in a BATCH file", create a package for the batch file, and then and replace the individual "run command line task sequence line item objects" with a single command line task sequence line item object that runs the batch file from the package I just created.

However, doing that results in the same error.
0
 
LVL 5

Author Comment

by:ACECORP
ID: 36539162
The next thing Microsoft Support suggested is that I swap out the sinle "command line task sequence line item object" that runs the batch file from the package, and replace it with an "install software task sequence line item object" that runs the createandchangepwr.bat file.

So I did this, and running the batch file via the task sequence in this way still results in the same probelm of the power changes not being made.

Now, once the OS Deployment process is finished and the computer boots up so someone can log into it and use it, the script works, but I need to set this so that those power settings are already present before anyone logs in and implemented via the OSD task sequence.

Is there a way to make these same changes via the registry?
0
 
LVL 31

Expert Comment

by:merowinger
ID: 36541186
Did you take the wrong quotes?
Command Line: powercfg /create MyScheme Standard

Take thi one ""
Best would be if you first try to use Schema Names without spaces


powercfg /create MyScheme
powercfg /change MyScheme /monitor-timeout-ac 0
powercfg /change MyScheme /standby-timeout-ac 0
powercfg /change MyScheme /disk-timeout-ac 0
powercfg /hibernate off
powercfg /setactive MyScheme


Are you sure the "powercfg /create" command is available? if i run powercfg /? it's not listed!
0
 
LVL 5

Author Comment

by:ACECORP
ID: 36544795
I tried removing the quotes, and I no longer get an error in the smsts.log as shown below.

Parsing step node: Create "MyScheme" Power Scheme      TSManager      9/15/2011 12:05:30 PM      548 (0x0224)
Description:       TSManager      9/15/2011 12:05:30 PM      548 (0x0224)
ContinueOnError:       TSManager      9/15/2011 12:05:30 PM      548 (0x0224)
SuccessCodeList: 0 3010      TSManager      9/15/2011 12:05:30 PM      548 (0x0224)
(__hrMethodRetVal == ((HRESULT)0L)) || (bFailIfMissing == false), HRESULT=80070002 (e:\nts_sms_fre\SMS\common\inc\ccmxml.h,566)      TSManager      9/15/2011 12:05:30 PM      548 (0x0224)
No condition is associated with the step.      TSManager      9/15/2011 12:05:30 PM      548 (0x0224)
Disable:       TSManager      9/15/2011 12:05:30 PM      548 (0x0224)
Start in dir:       TSManager      9/15/2011 12:05:30 PM      548 (0x0224)
Run in attribute: WinPEandFullOS      TSManager      9/15/2011 12:05:30 PM      548 (0x0224)
Timeout:       TSManager      9/15/2011 12:05:30 PM      548 (0x0224)
DefaultVarlist found      TSManager      9/15/2011 12:05:30 PM      548 (0x0224)
Variable name: SMSTSDisableWow64Redirection      TSManager      9/15/2011 12:05:30 PM      548 (0x0224)
Variable name: _SMSTSRunCommandLineAsUser      TSManager      9/15/2011 12:05:30 PM      548 (0x0224)
Variable name: WorkingDirectory      TSManager      9/15/2011 12:05:30 PM      548 (0x0224)
                   Action command line: smsswd.exe /run: powercfg /create MyScheme      TSManager      9/15/2011 12:05:30 PM      548 (0x0224)
Action command line: smsswd.exe /run: powercfg /create MyScheme      TSManager      9/15/2011 12:05:30 PM      548 (0x0224)
Adding instruction at 146      TSManager      9/15/2011 12:05:30 PM      548 (0x0224)

**** the material below is related to the next step in the task sequence and I disabled it until I can get the creation of the new power scheme working ****

Parsing step node: Disable Screen Sleep      TSManager      9/15/2011 12:05:30 PM      548 (0x0224)
Description:       TSManager      9/15/2011 12:05:30 PM      548 (0x0224)
ContinueOnError:       TSManager      9/15/2011 12:05:30 PM      548 (0x0224)
SuccessCodeList: 0 3010      TSManager      9/15/2011 12:05:30 PM      548 (0x0224)
(__hrMethodRetVal == ((HRESULT)0L)) || (bFailIfMissing == false), HRESULT=80070002 (e:\nts_sms_fre\SMS\common\inc\ccmxml.h,566)      TSManager      9/15/2011 12:05:30 PM      548 (0x0224)
No condition is associated with the step.      TSManager      9/15/2011 12:05:30 PM      548 (0x0224)
Disable: true      TSManager      9/15/2011 12:05:30 PM      548 (0x0224)

However, even though no error message occurrs, the power scheme is still not being created because it is not available or selectable once the Operating System Deployment process completes as shown below.

 MyScheme is not available
See there is no MyScheme power scheme to select.

However, once OSD is done, and I log into the machine and manually type in powercfg /create MyScheme at a command prompt, it creates as shown below.

However this is of no use to me as I need this to be created during OSD.

 MyScheme is available
This is utterly rediculous that it is this complex just to add a custom power scheme via SCCM as a Task Sequence Line Item Object during Operating System Deployment.

There has got to be someone out there that knows what I must do to make this work.

Please Help! :)
0
 
LVL 31

Expert Comment

by:merowinger
ID: 36547838
You get the error "The system cannot find the file specified"
0
 
LVL 5

Author Comment

by:ACECORP
ID: 36551365
Unforunately, I don't see the error message "The system cannot find the file specified" anywhere in the SMSTS.log.

To generate a more detailed accounting of the problem, I used 4 different task sequence line item objects, from within SCCM to see if a specific line item object works.

The attached PDF "4-Methods-AllFail.pdf"  details the results. I will post the relevent sections fo the smsts.log file shortly.

I am hoping that someone has a clue as to why this isn't working when run from an OSD Task Sequence. It runs without incident once the machine is fully deployed and I log in and manually run it from a command prompt. But I need to run it during OS Deployment as part of a task sequence line item object.



4-Methods-AllFail.pdf
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 31

Assisted Solution

by:merowinger
merowinger earned 50 total points
ID: 36579974
I've a powercfg command running in my Task Sequence.
I tried it as following:

1. Create a vbScript (.vbs) containing the following code:

Dim objShell : Set objShell = CreateObject("Wscript.Shell")
objShell.Run "powercfg /create MyScheme",0,True
objShell.Run "powercfg /change MyScheme /monitor-timeout-ac 0",0,True
'...

Open in new window


2. Create a Package with the vbScript as Source

3. in your Task Sequence add a "Run command line" step with the following content:
- Command Line: cscript.exe YourScript.vbs
- Package: Chose the Package containing the Script
0
 
LVL 5

Author Comment

by:ACECORP
ID: 36602031


merowinger, while it works outside of an OSD Deployment Task Sequence, it does not work during one, unfortunately....

SCCM did not issue any error message during the OSD, nor did I find any error in the smsts.log as shown below.

 
Parsing step node: Create "MyScheme" Power Scheme w/Pkg	TSManager	9/26/2011 4:33:44 PM	536 (0x0218)
Description: 	TSManager	9/26/2011 4:33:44 PM	536 (0x0218)
ContinueOnError: 	TSManager	9/26/2011 4:33:44 PM	536 (0x0218)
SuccessCodeList: 0 3010	TSManager	9/26/2011 4:33:44 PM	536 (0x0218)
(__hrMethodRetVal == ((HRESULT)0L)) || (bFailIfMissing == false), HRESULT=80070002 (e:\nts_sms_fre\SMS\common\inc\ccmxml.h,566)	TSManager	9/26/2011 4:33:44 PM	536 (0x0218)
No condition is associated with the step.	TSManager	9/26/2011 4:33:44 PM	536 (0x0218)
Disable: 	TSManager	9/26/2011 4:33:44 PM	536 (0x0218)
Start in dir: 	TSManager	9/26/2011 4:33:44 PM	536 (0x0218)
Run in attribute: WinPEandFullOS	TSManager	9/26/2011 4:33:44 PM	536 (0x0218)
Timeout: 	TSManager	9/26/2011 4:33:44 PM	536 (0x0218)
DefaultVarlist found	TSManager	9/26/2011 4:33:44 PM	536 (0x0218)
Variable name: SMSTSDisableWow64Redirection	TSManager	9/26/2011 4:33:44 PM	536 (0x0218)
Variable name: _SMSTSRunCommandLineAsUser	TSManager	9/26/2011 4:33:44 PM	536 (0x0218)
Action command line: smsswd.exe /run:BCG0031D cscript.exe DisableSleepXP.vbs	TSManager	9/26/2011 4:33:44 PM	536 (0x0218)
Adding instruction at 145	TSManager	9/26/2011 4:33:44 PM	536 (0x0218)
Processed all elements	TSManager	9/26/2011 4:33:44 PM	536 (0x0218)
Adding end group instruction at 146	TSManager	9/26/2011 4:33:44 PM	536 (0x0218)
The next instruction after group will be at 147	TSManager	9/26/2011 4:33:44 PM	536 (0x0218)
Processed all elements	TSManager	9/26/2011 4:33:44 PM	536 (0x0218)
Adding end group instruction at 147	TSManager	9/26/2011 4:33:44 PM	536 (0x0218)
The next instruction after group will be at 148	TSManager	9/26/2011 4:33:44 PM	536 (0x0218)
Processing group	TSManager	9/26/2011 4:33:44 PM	536 (0x0218)

Open in new window


When I logged into the machine after OSD finished to check for the existance of the powerscheme and settings, the new power scheme is nowhere to be found as shown below.  

New Power Scheme Not Present
The OSD Task Sequence Line Item is shown below.

 Task Sequence Line Item
The contents of the VBS Script File I am using are shown below
 
 
Dim objShell : Set objShell = CreateObject("Wscript.Shell")
objShell.Run "powercfg /create MyScheme",0,True
objShell.Run "powercfg /change MyScheme /monitor-timeout-ac 0",0,True
objShell.Run "powercfg /change MyScheme /standby-timeout-ac 0",0,True
objShell.Run "powercfg /change MyScheme /disk-timeout-ac 0",0,True

Open in new window


I just don't know what else I can do to make this work....
0
 
LVL 31

Expert Comment

by:merowinger
ID: 36707792
You just added the Log from the Task Sequence parsing but not from executing. Please search the client for smsts*.log file
0
 
LVL 10

Expert Comment

by:Kezzi
ID: 36709271
If you already have a package created for the VBS file power scheme, then why are you calling it via a command line instead of calling the Program via the Install Package option in the Task Sequence?
(so your package just has the VBS file in it, and you set your advertisement options to download first)

Have you tested a deployment via the Package to an existing machine on your network instead of just through the build process?
0
 
LVL 5

Author Comment

by:ACECORP
ID: 36718613
I am actually still working on this issue with MSFT Professional Support and it has gone unresolved for more than three weeks. Their technicians are having one hell of a time determining the problem. I will paste updates here once I have something.
0
 
LVL 5

Author Comment

by:ACECORP
ID: 36718988
Kezzi, when I run the run the script against a collection that contains my test machine, as an advertised software application whose configuration is shown below, I do not get any failure messages in the ConfigMgr Status Message Viewer.

Run As Package
In fact, the ConfigMgr Status Message viewer shows success as you can see directly below.

Severity	Type	Site code	Date / Time	System	Component	Message ID	Description
Information	Milestone	BCG	9/28/2011 1:57:30 PM	TEST001	Software Distribution	10008	The program for advertisement "BCG20374" completed successfully ("BCG0031D" - "Run_DisableSleepMode_WinXP").   User context: NT AUTHORITY\SYSTEM    Systems Management Server (SMS) determines status for each program it executes. If SMS cannot find or correlate any installation status Management Information Format (MIF) files for the program, it uses the program's exit code to determine status. This program returned an exit code that indicates it completed successfully.
Information	Milestone	BCG	9/28/2011 1:57:29 PM	TEST001	Software Distribution	10005	Program started for advertisement "BCG20374" ("BCG0031D" - "Run_DisableSleepMode_WinXP").    Command line: C:\WINDOWS\System32\WScript.exe "C:\WINDOWS\system32\CCM\Cache\BCG0031D.9.System\DisableSleepXP.vbs"  Working directory: C:\WINDOWS\system32\CCM\Cache\BCG0031D.9.System\  User context: NT AUTHORITY\SYSTEM

Open in new window


The contents of the DisableSleepXP.vbs file is shown below

Dim objShell : Set objShell = CreateObject("Wscript.Shell")
objShell.Run "powercfg /create MyScheme",0,True
objShell.Run "powercfg /change MyScheme /monitor-timeout-ac 0",0,True
objShell.Run "powercfg /change MyScheme /standby-timeout-ac 0",0,True
objShell.Run "powercfg /change MyScheme /disk-timeout-ac 0",0,True

Open in new window


However, when I log into my test machine to check and see if the changes were made, they were not. No additional power profile has been added and none of the settings in the DisableSleepXP.vbs script have been applied. However, the execmgr.log on the client does not show any error either, as shown below.

 
CExecutionStatus::CExecutionStatus	execmgr	9/28/2011 1:57:30 PM	2896 (0x0B50)
Looking for MIF file to get program status	execmgr	9/28/2011 1:57:30 PM	2896 (0x0B50)
Looking for MIF file in directory C:\WINDOWS\	execmgr	9/28/2011 1:57:30 PM	2896 (0x0B50)
Found MIF File SMSAdvancedClient.sccm2007ac-sp2-kb2509007-x86-enu.mif, Checking for match	execmgr	9/28/2011 1:57:30 PM	2896 (0x0B50)
Looking for MIF file in directory C:\WINDOWS\system32\	execmgr	9/28/2011 1:57:30 PM	2896 (0x0B50)
Script for  Package:BCG0031D, Program: Run_DisableSleepMode_WinXP succeeded with exit code 0	execmgr	9/28/2011 1:57:30 PM	2896 (0x0B50)
Raising event:
[SMS_CodePage(437), SMS_LocaleID(1033)]
instance of SoftDistProgramCompletedSuccessfullyEvent
{
	AdvertisementId = "BCG20374";
	ClientID = "GUID:96CB727F-8F5B-4312-A661-61B6200A340B";
	DateTime = "20110928175730.275000+000";
	MachineName = "TEST001";
	PackageName = "BCG0031D";
	ProcessID = 1860;
	ProgramName = "Run_DisableSleepMode_WinXP";
	SiteCode = "BCG";
	ThreadID = 2896;
	UserContext = "NT AUTHORITY\\SYSTEM";
};
	execmgr	9/28/2011 1:57:30 PM	2896 (0x0B50)
Raised Program Success Event for Ad:BCG20374, Package:BCG0031D, Program: Run_DisableSleepMode_WinXP	execmgr	9/28/2011 1:57:30 PM	2896 (0x0B50)
Execution is complete for program Run_DisableSleepMode_WinXP. The exit code is 0, the execution status is Success	execmgr	9/28/2011 1:57:30 PM	888 (0x0378)
Deleting request from pending queue, package BCG0031D, program Run_DisableSleepMode_WinXP, advertisement BCG20374	execmgr	9/28/2011 1:57:30 PM	888 (0x0378)
CExecutionRequest::InvalidAndDeleteFromWmi Run_DisableSleepMode_WinXP	execmgr	9/28/2011 1:57:30 PM	888 (0x0378)
Called delete and free Request for advert BCG20374, package BCG0031D, program Run_DisableSleepMode_WinXP	execmgr	9/28/2011 1:57:30 PM	888 (0x0378)
Execution request deleted for package BCG0031D program Run_DisableSleepMode_WinXP, advert BCG20374	execmgr	9/28/2011 1:57:30 PM	888 (0x0378)
Execution Manager timer has been fired.	execmgr	9/28/2011 2:02:46 PM	2772 (0x0AD4)
CExecutionRequestManager::OnTimer - Processing UI Notify Timer	execmgr	9/28/2011 2:02:46 PM	2772 (0x0AD4)
Entering CTimerTask::CancelTimer.	execmgr	9/28/2011 2:02:46 PM	2772 (0x0AD4)

Open in new window


Whoever can solve this problem, should truly be put in change of managing Microsoft's SCCM Professional Support department.
0
 
LVL 5

Author Comment

by:ACECORP
ID: 36719044
Merowinger, the portion of the log I uploaded is the only portion that is present in the smsts-20110926-163345.log on the client machine. There is nothing else in the smsts-20110926-163345.log file related to the running of that script other than the lines shown in that log.

I'd like to also note that the failures occurr under the following conditions, even though no error messages can be found.

(1) As part of OSD Task Sequence - running the vbs script by means of an OSD Task Sequence Line Item using the Run Command Line Object

(2) As part of OSD Task Sequence - running the vbs script by means of  an OSD Task Sequence Line Item uisng the Install Software Line Item Object, and running the Run_DisableSleepMode_WINXP program as shown in my reply to
Kezzi.

(3) Outside of OSD Task Sequence via Advertisement to a Pre-Existing Line Machine - running the vbs script by means of an OSD Task Sequence Line Item using the Install Software Line Item Object, and running the Run_DisableSleepMode_WINXP program
0
 
LVL 10

Accepted Solution

by:
Kezzi earned 450 total points
ID: 36816784
What you need is better logging in your script.  So here, try mine.  It will create a log file called the same name as the script (so you can rename the script to what you want) in the C:\Windows\Temp directory.

It will log every action it does, including the correct error codes and pass the error code back to SCCM.

For some reason, if i did not put CMD /c infront of the command line it would not work.  Having CMD /c there and putting MyScheme in quotes allowed it to create the power scheme, but none of the change options would work.  if I put CMD /c in front of the change command, it failed, if i removed it, it didnt error out but it still did not work.   So i created a bit of a work around for you.  Considering you want to disable power saving, the scheme that replicates this is called Always On.  So....

a) why not just set the powerscheme to Always On.
b) if you set Always On as your default power scheme, then create a new scheme, the new scheme is based on the active scheme, hence the Always on.  

I have created this script asd b)

 Create-PowerScheme.vbs Create-PowerScheme.vbs
0
 
LVL 5

Author Comment

by:ACECORP
ID: 36904087
Kezzi, I am out of the office for a couple of weeks, but I will try the code you posted when I return and update this post accordingly.
0
 
LVL 5

Author Comment

by:ACECORP
ID: 37045858
This project has been put on hold for an indefinte period of time due to numerous complications that have arisen. Apparently when the power scheme is changed during the operating system deployment process in SCCM, they are run as the LOCAL\SYSTEM user and the power scheme settings are not applied to all current and future user id's that log into the computer.
0
 
LVL 5

Author Comment

by:ACECORP
ID: 37045861
I will aware points to those who have spend time and effort contrbuting and answering my questions.
0
 
LVL 5

Author Closing Comment

by:ACECORP
ID: 37045891
While these solutions work from a functional standpoint, they do actually solve my problem. I want to make sure folks are compensated for their time and effort as it was much appreciated. At least I better understand the complexity of the issue and can go back and address it in greater detail when time permits.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Setting up a Microsoft WSUS update system is free relatively speaking if you have hard disk space and processor capacity.   However, WSUS can be a blessing and a curse. For example, there is nothing worse than approving updates and they just have…
I have put this article together as i needed to get all the information that might be available already into one general document that could be referenced once without searching the Internet for the different pieces. I have had a few issues where…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now