program execution with network output

Status
Not open for further replies.

Enigmaunbound

Ars Scholae Palatinae
1,374
Subscriptor
I would appreciate any assistance. I need to execute an .exe with Admin privilege on all domain joined computers and write the output to a central location. The clients are a mix of XP, Win7, Server 2003, and Server 2008. The program can take from a few minutes to 6 hours to complete. I don't have SCCM or like package management at my disposal. How do I best go about this?
 

Enigmaunbound

Ars Scholae Palatinae
1,374
Subscriptor
Yes, the account has write privelege. My problem is how do I get the program to execute. My rough though is to create a task dedicated account, run the program as that user with an elevated privilege, then write the results.

The best idea I have is to push a scheduled task via GPP that calls the executable via UNC and passes the output argument as a UNC. This isn't working but seems to hang together the best.

I've also looked at a Startup script. My problems here are the script runs as System context and cannot map a drive or UNC.

I've also looked into a User Logon Script but not every user has local admin privilege.

I'm considering taking the .exe, wraping it in a run as service config. Package as an MSI and deploy via GPO. This is messy, needs to learn new tricks, and I'd have cleanup concerns afterwards.
 

forky

Ars Tribunus Militum
2,263
Subscriptor++
Does that exe work when used interactively? If so, then I think you have two options:
1. use AT with /interactive switch (don't remember, but it's possible it was depreciated in later versions of Windows)
2. write a batch that your task is executing instead of that exe and use pushd with UNC location to run the actual exe. Maybe even use cmd /c
 

Enigmaunbound

Ars Scholae Palatinae
1,374
Subscriptor
That looks like what my script is doing.

REM Check Flag
IF EXIST c:\windows\temp\2015-fsflag GOTO :EXIT

REM Set Flag
break > c:\windows\temp\2015-fsflag

REM Set Network Path
pushd \\host.someplace.net\2015-fsflag\

#Execute
fsflag.exe -L -O output\

REM Close Network Path
popd

:EXIT
exit

My issue is that in testing Calling this from the Startup script I have the permission to run this as admin so it runs to completion. But pushd fails to open because it doesn't have a valid domain credential. Login Script has the oposite issue. The tool will error out because it doesn't have admin and can't prompt UAC. It can setup the file shares though. Setting up the schedule seemed my best bet but the GPP isn't creating the task.
 

forky

Ars Tribunus Militum
2,263
Subscriptor++
Batch was meant to run by a scheduled task using domain account that has modify permission in \\host.someplace.net\2015-fsflag\ (and obviously run task)
The output was meant to go to the same share.

If testing it on one computer works, then you have new problem - how to push schedule to all computers.

There is, however another problem. You will need to make sure each computer outputs to either different file or folder within that share. If output file name can be set in switches of that fsflag.exe then I'd go with "%computername%.ext" if it doesn't you will need to add lines that will create unique to each computer folders - md "%computername%" followed by cd "%computername%" before fsflag.exe line. BTW, that cmd /c would spawn additional process (cmd.exe) which will run your exe, so I'd use that if you insist on adding popd.

How often do you need to run this?
edit: corrected permissions
 
Status
Not open for further replies.