I'm trying to create a package that will run SystemInfo on a collection of servers and save the results on a network share:
It works great if I run the following command from one of the servers: systeminfo.exe > "\\ServerName\Share\%computername%.txt"
But it fails when I try and push it out through SCCM.
I put the same command in the "Command line" of SCCM (systeminfo.exe > "\\ServerName\Share\%computername%.txt") but it fails with an error code 1:
Policy arrived for parent package BQR00097 program Server update listexecmgr11/21/2016 12:48:19 PM3876 (0x0F24)
Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="BQR00097",ProgramID="Server update list", actionType 6l, value NULL, user NULL, session 4294967295l, level 0l, verbosity 30lexecmgr11/21/2016 12:48:19 PM3876 (0x0F24)
Raising event:
[SMS_CodePage(437), SMS_LocaleID(1033)]
instance of SoftDistProgramOfferReceivedEvent
{
AdvertisementId = "BQR2009D";
ClientID = "GUID:5436AECC-196C-4755-9294-0C5574017E11";
DateTime = "20161121204819.564000+000";
MachineName = "**********";
ProcessID = 3032;
SiteCode = "BQR";
ThreadID = 3876;
};
execmgr
11/21/2016 12:48:19 PM3876 (0x0F24)
Validating chain of dependent programs for package BQR00097 optional program Server update listexecmgr11/21/2016 12:49:45 PM3876 (0x0F24)
Validating package BQR00097 program Server update list in the chain. The content request ID is {00000000-0000-0000-0000-000000000000}execmgr11/21/2016 12:49:45 PM3876 (0x0F24)
Creating an optional execution request for package BQR00097 program Server update listexecmgr
11/21/2016 12:49:46 PM3876 (0x0F24)
An existing MTC token was not supplied, using ExecutionRequest's Id as MTC token and this execution request is the owner of resultant MTC task.execmgr11/21/2016 12:49:46 PM3876 (0x0F24)
Request a MTC task for execution request of package BQR00097, program Server update list with request id: {F62098D2-7199-4F75-8B13-E7D765694D13}execmgr11/21/2016 12:49:46 PM3876 (0x0F24)
Execution Request for advert package BQR00097 program Server update list state change from NotExist to Readyexecmgr11/21/2016 12:49:46 PM3876 (0x0F24)
MTC task with id {F62098D2-7199-4F75-8B13-E7D765694D13}, changed state from 0 to 4execmgr11/21/2016 12:49:46 PM3996 (0x0F9C)
Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="BQR00097",ProgramID="Server update list", actionType 1l, value , user NULL, session 4294967295l, level 0l, verbosity 30lexecmgr11/21/2016 12:49:46 PM3876 (0x0F24)
MTC signaled SWD execution request with program id: Server update list, package id: BQR00097 for execution.execmgr11/21/2016 12:49:46 PM3996 (0x0F9C)
Sending ack to MTC for task with id: {F62098D2-7199-4F75-8B13-E7D765694D13}execmgr11/21/2016 12:49:46 PM3996 (0x0F9C)
Executing program systeminfo.exe > "\********\********\\%computername%.txt" in Admin contextexecmgr11/21/2016 12:49:46 PM3996 (0x0F9C)
Execution Request for advert package BQR00097 program Server update list state change from Ready to NotifyExecutionexecmgr11/21/2016 12:49:46 PM3996 (0x0F9C)
Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="BQR00097",ProgramID="Server update list", actionType 1l, value , user NULL, session 4294967295l, level 0l, verbosity 30lexecmgr11/21/2016 12:49:46 PM3996 (0x0F9C)
Executing program as a scriptexecmgr11/21/2016 12:49:46 PM3996 (0x0F9C)
Successfully prepared command line "C:\Windows\system32\systeminfo.exe" > "\\********\\********\\*******.txt"execmgr11/21/2016 12:49:46 PM3996 (0x0F9C)
Command line = "C:\Windows\system32\systeminfo.exe" > "\\********\\********\\*******.txt", Working Directory = C:\Windows\system32\execmgr11/21/2016 12:49:46 PM3996 (0x0F9C)
Running "C:\Windows\system32\systeminfo.exe" > "\\bfile\BShare\Depts\FinOps\IT\SOX\2016 SOX\EV4a\DAVESTESTSERVER.txt" with 32bitLauncherexecmgr11/21/2016 12:49:46 PM3996 (0x0F9C)
Created Process for the passed command line
execmgr11/21/2016 12:49:46 PM3996 (0x0F9C)
Raising event:
[SMS_CodePage(437), SMS_LocaleID(1033)]
instance of SoftDistProgramStartedEvent
{
AdvertisementId = "BQR2009D";
ClientID = "GUID:5436AECC-196C-4755-9294-0C5574017E11";
CommandLine = "\"C:\\Windows\\system32\\systeminfo.exe\" > \"\\\\********\\********\\*******.txt\"";
DateTime = "20161121204946.580000+000";
MachineName = "********";
PackageName = "BQR00097";
ProcessID = 3032;
ProgramName = "Server update list";
SiteCode = "BQR";
ThreadID = 3996;
UserContext = "NT AUTHORITY\\SYSTEM";
WorkingDirectory = "C:\\Windows\\system32\\";
};
execmgr
11/21/2016 12:49:46 PM3996 (0x0F9C)
Raised Program Started Event for Ad:BQR2009D, Package:BQR00097, Program: Server update listexecmgr11/21/2016 12:49:46 PM3996 (0x0F9C)
Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="BQR00097",ProgramID="Server update list", actionType 1l, value NULL, user NULL, session 4294967295l, level 0l, verbosity 30lexecmgr11/21/2016 12:49:46 PM3996 (0x0F9C)
Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="BQR00097",ProgramID="Server update list", actionType 1l, value , user NULL, session 4294967295l, level 0l, verbosity 30lexecmgr11/21/2016 12:49:46 PM3996 (0x0F9C)
MTC task with id {F62098D2-7199-4F75-8B13-E7D765694D13}, changed state from 4 to 5execmgr11/21/2016 12:49:46 PM4564 (0x11D4)
Program exit code 1execmgr11/21/2016 12:49:46 PM276 (0x0114)
Looking for MIF file to get program statusexecmgr11/21/2016 12:49:46 PM276 (0x0114)
Script for Package:BQR00097, Program: Server update list failed with exit code 1execmgr11/21/2016 12:49:46 PM276 (0x0114)
Raising event:
[SMS_CodePage(437), SMS_LocaleID(1033)]
instance of SoftDistProgramErrorEvent
{
AdvertisementId = "BQR2009D";
ClientID = "GUID:5436AECC-196C-4755-9294-0C5574017E11";
DateTime = "20161121204946.938000+000";
ExitCode = "1";
MachineName = "********";
PackageName = "BQR00097";
ProcessID = 3032;
ProgramName = "Server update list";
SiteCode = "BQR";
ThreadID = 276;
UserContext = "NT AUTHORITY\\SYSTEM";
};
execmgr
11/21/2016 12:49:46 PM276 (0x0114)
Raised Program Error Event for Ad:BQR2009D, Package:BQR00097, Program: Server update listexecmgr11/21/2016 12:49:46 PM276 (0x0114)
Execution is complete for program Server update list. The exit code is 1, the execution status is FailureNonRetryexecmgr11/21/2016 12:49:47 PM276 (0x0114)
Requesting MTC to delete task with id: {F62098D2-7199-4F75-8B13-E7D765694D13}execmgr11/21/2016 12:49:47 PM276 (0x0114)
MTC task with id: {F62098D2-7199-4F75-8B13-E7D765694D13} deleted successfully.execmgr11/21/2016 12:49:47 PM276 (0x0114)
Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="BQR00097",ProgramID="Server update list", actionType 10l, value Result:FALSE, user NULL, session 4294967295l, level 0l, verbosity 30lexecmgr11/21/2016 12:49:47 PM276 (0x0114)
Requesting MTC to delete task with id: {F62098D2-7199-4F75-8B13-E7D765694D13}execmgr11/21/2016 12:49:47 PM276 (0x0114)
This execution request does not have a corresponding task in MTC.execmgr11/21/2016 12:49:47 PM276 (0x0114)
Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="BQR00097",ProgramID="Server update list", actionType 1l, value , user NULL, session 4294967295l, level 0l, verbosity 30lexecmgr11/21/2016 12:49:47 PM276 (0x0114)
I also tried creating batch file using %windir%\Sysnative\cmd.exe systeminfo.exe > "\\ServerName\Share\%computername%.txt", but I get a 259 error after the process times out. (I tried it without "cmd.exe", %windir%\Sysnative\systeminfo.exe> "\\ServerName\Share\%computername%.txt"
Validating chain of dependent programs for package BQR00097 optional program Server update listexecmgr11/21/2016 8:40:01 AM944 (0x03B0)
Validating package BQR00097 program Server update list in the chain. The content request ID is {00000000-0000-0000-0000-000000000000}execmgr11/21/2016 8:40:01 AM944 (0x03B0)
Creating an optional execution request for package BQR00097 program Server update listexecmgr
11/21/2016 8:40:01 AM944 (0x03B0)
An existing MTC token was not supplied, using ExecutionRequest's Id as MTC token and this execution request is the owner of resultant MTC task.execmgr11/21/2016 8:40:01 AM944 (0x03B0)
Request a MTC task for execution request of package BQR00097, program Server update list with request id: {18B051ED-62EC-4E68-A651-36DD9B9DB047}execmgr11/21/2016 8:40:01 AM944 (0x03B0)
Execution Request for advert package BQR00097 program Server update list state change from NotExist to Readyexecmgr11/21/2016 8:40:01 AM944 (0x03B0)
Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="BQR00097",ProgramID="Server update list", actionType 1l, value , user NULL, session 4294967295l, level 0l, verbosity 30lexecmgr11/21/2016 8:40:01 AM944 (0x03B0)
MTC task with id {18B051ED-62EC-4E68-A651-36DD9B9DB047}, changed state from 0 to 4execmgr11/21/2016 8:40:01 AM3300 (0x0CE4)
MTC signaled SWD execution request with program id: Server update list, package id: BQR00097 for execution.execmgr11/21/2016 8:40:01 AM3300 (0x0CE4)
Sending ack to MTC for task with id: {18B051ED-62EC-4E68-A651-36DD9B9DB047}execmgr11/21/2016 8:40:01 AM3300 (0x0CE4)
Executing program %windir%\Sysnative\cmd.exe systeminfo.exe > "\\******\*********\%computername%.txt" in Admin contextexecmgr11/21/2016 8:40:01 AM3300 (0x0CE4)
Execution Request for advert package BQR00097 program Server update list state change from Ready to NotifyExecutionexecmgr11/21/2016 8:40:01 AM3300 (0x0CE4)
Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="BQR00097",ProgramID="Server update list", actionType 1l, value , user NULL, session 4294967295l, level 0l, verbosity 30lexecmgr11/21/2016 8:40:01 AM3300 (0x0CE4)
Executing program as a scriptexecmgr11/21/2016 8:40:01 AM3300 (0x0CE4)
Successfully prepared command line "C:\Windows\sysnative\cmd.exe" systeminfo.exe > "\\*******\*******\******.txt"execmgr11/21/2016 8:40:01 AM3300 (0x0CE4)
Command line = "C:\Windows\sysnative\cmd.exe" systeminfo.exe > "\\*****\*****\*******.txt", Working Directory = C:\Windows\system32\execmgr11/21/2016 8:40:01 AM3300 (0x0CE4)
Running "C:\Windows\sysnative\cmd.exe" systeminfo.exe > "\\********\*****\*******.txt" with 32bitLauncherexecmgr11/21/2016 8:40:01 AM3300 (0x0CE4)
Created Process for the passed command line
execmgr11/21/2016 8:40:02 AM3300 (0x0CE4)
Raising event:
[SMS_CodePage(437), SMS_LocaleID(1033)]
instance of SoftDistProgramStartedEvent
{
AdvertisementId = "BQR2009B";
ClientID = "GUID:5436AECC-196C-4755-9294-0C5574017E11";
CommandLine = "\"C:\\Windows\\sysnative\\cmd.exe\" systeminfo.exe > \"\\\\******\\*****\\*****.txt\"";
DateTime = "20161121164002.407000+000";
MachineName = "*******";
PackageName = "BQR00097";
ProcessID = 3032;
ProgramName = "Server update list";
SiteCode = "BQR";
ThreadID = 3300;
UserContext = "NT AUTHORITY\\SYSTEM";
WorkingDirectory = "C:\\Windows\\system32\\";
};
execmgr
11/21/2016 8:40:02 AM3300 (0x0CE4)
Raised Program Started Event for Ad:BQR2009B, Package:BQR00097, Program: Server update listexecmgr11/21/2016 8:40:02 AM3300 (0x0CE4)
Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="BQR00097",ProgramID="Server update list", actionType 1l, value NULL, user NULL, session 4294967295l, level 0l, verbosity 30lexecmgr11/21/2016 8:40:02 AM3300 (0x0CE4)
Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="BQR00097",ProgramID="Server update list", actionType 1l, value , user NULL, session 4294967295l, level 0l, verbosity 30lexecmgr11/21/2016 8:40:02 AM3300 (0x0CE4)
MTC task with id {18B051ED-62EC-4E68-A651-36DD9B9DB047}, changed state from 4 to 5execmgr11/21/2016 8:40:02 AM2384 (0x0950)
Program exit code 259execmgr11/21/2016 8:55:02 AM3376 (0x0D30)
Looking for MIF file to get program statusexecmgr11/21/2016 8:55:02 AM3376 (0x0D30)
Program ran past its maximum runtime. It will be orphanedexecmgr11/21/2016 8:55:02 AM3376 (0x0D30)
Raising event:
[SMS_CodePage(437), SMS_LocaleID(1033)]
instance of SoftDistProgramExceededTime
{
AdvertisementId = "BQR2009B";
ClientID = "GUID:5436AECC-196C-4755-9294-0C5574017E11";
DateTime = "20161121165502.440000+000";
MachineName = "*****";
MaximumTime = "15";
PackageName = "BQR00097";
ProcessID = 3032;
ProgramName = "Server update list";
SiteCode = "BQR";
ThreadID = 3376;
};
execmgr
11/21/2016 8:55:02 AM3376 (0x0D30)
Raised Program Exceeded Time Event for Ad:BQR2009B, Package:BQR00097, Program: Server update listexecmgr11/21/2016 8:55:02 AM3376 (0x0D30)
Execution is complete for program Server update list. The exit code is 259, the execution status is Unknown Statusexecmgr11/21/2016 8:55:02 AM2412 (0x096C)
Requesting MTC to delete task with id: {18B051ED-62EC-4E68-A651-36DD9B9DB047}execmgr11/21/2016 8:55:02 AM2412 (0x096C)
MTC task with id: {18B051ED-62EC-4E68-A651-36DD9B9DB047} deleted successfully.execmgr11/21/2016 8:55:02 AM2412 (0x096C)
Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="BQR00097",ProgramID="Server update list", actionType 10l, value Result:FALSE, user NULL, session 4294967295l, level 0l, verbosity 30lexecmgr11/21/2016 8:55:02 AM2412 (0x096C)
Requesting MTC to delete task with id: {18B051ED-62EC-4E68-A651-36DD9B9DB047}execmgr11/21/2016 8:55:02 AM2412 (0x096C)
This execution request does not have a corresponding task in MTC.execmgr11/21/2016 8:55:02 AM2412 (0x096C)
Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="BQR00097",ProgramID="Server update list", actionType 1l, value , user NULL, session 4294967295l, level 0l, verbosity 30lexecmgr11/21/2016 8:55:02 AM2412 (0x096C)
Any help would be greatly appreciated.