Returning and reporting on multiple return codes in SCCM package - sccm

I have a utility that detects pending restarts and prompts the user to restart. It also forces a restart on Sunday at 2AM if needed. I'd like to be able to report on who did what:
Ignored restart prompt (automatically goes away after 2 hours)
Clicked the "Later" button
Clicked the "Restart now" button
Computer Auto-restarted
I can send the different return codes from my Powershell script, but I don't know how I would setup the package to accept multiple return codes and report on it. I've found some documentation on MIF files, but it all seems to apply to older versions of SCCM - I'm running ConfigMgr 1910 and I'm good at SQL reporting, just need to get the data into a table somewhere.

Maybe this git project can help you to send the information via custom status messages:
https://github.com/MattiasC85/Send-CMMessage

Related

Task scheduler runs console app task only for the first time

I created console app in .Net technology. App works fine when I trigger it by click on exe setup (console shows up for about 5-6 min and that's how it should work), so I put it into Task Scheduler(Windows Server 2022) as a Task with settings:
1.General: Administrator, Run only when user is logged on.
2.Triggers: one time at xxx after trigerred repeat every 15 min, enabled.
3.Actions: Start a program with start in optional parameter (where exe file is).
4.Conditions: none checked.
5.Settings: allow on demand, do not start a new instance.
When I run it from windows explorer task runs properly for the first time. On the next start it stops running. Nothing happens. No errors/unusual results in history. Status changes to Running for 2-3 sec and get back to Ready. if I run it again from the explorer level, task runs properly again, but only for the first time.
What I've tried:
1.Change user (system, local service, network service, administrator).
2.Run logged in and not logged in.
3.Highest priviliges on/off.
4.Every kind of trigger time option.
5.With and without optional start in.
6.Different locations(desktop, C:/, other).
7.Run as Admin in .exe properties.
8.Every checkbox on/off in settings.
Anyone faced this issue? Thanks in advance.

2016 Task Scheduler Only Runs the first action in the list

I have a simple Task Schedule job that runs a program 6 times, sending to it a different Argument each time.
This has been working well for some years, but on 2016 Server it only runs the first action and then it stops.
Any ideas of a fix? I have looked on google for all fixes etc, but they haven't worked and seem to be for 2017 and back
Based on my past experience, this behavior could caused by one of the following:
If your task targets a batch file of an executable file, try to check Windows Task Manager for that file running under "Processes" tab. Select each of your target batch/exe then End Process button. This may have caused by a seemed-to-stuck process but still on "Running" status.
On Task Scheduler, check for your task's "Last Run Result". This could be having code other than 0x0 (which is the successful run). If so, check for details under "History" tab below this pane.

VS 2015 showing status bar message "Completing the operation you requested..."

Just upgraded from VS 2012 to 2015.
Builds on complex solutions take a while to get started, with a new status message showing in the status bar that says "Completing the operation you requested..." for 20 - 30 seconds before a build actually starts. This is different than the old dialog windows saying "Waiting for Background Operation to Complete". I am unable to tell what is going on and why this message is shown, and how I can avoid it as it seems to be indicating unnecessary work.
Completing the operation you requested takes much time with a screen as below :
First of all inspect the process with process monitor tools so that
you can catch the process that results in system hang.
If you have installed Nuget Package, then try uninstall them
Secondly , disable add - ins if any
There are times when your operation gets caught by anti virus
programs , have an eye on trying to disable and check the process
again
IF the above steps dont have affect , you must install a new release
of VS

How to run rollback custom action in Wise Installer Editor?

I'm making an installer that uses certain custom actions. I want to create a rollback action that undoes this changes when the installation is cancelled or unsuccessful.
What I've tried so far is what the documentation tells you to do, which is call the CA in deferred-mode and set "rollback only" in the In-Script Options. if you cancel the installation, the moment the installer tries to call the CA, the installation fails, it doesn't matter what the content of the CA is, it always fails the moment the installer tries to call it.
It says the installer couldn't execute a find a program necessary for the installation (the CA), even though the CA is called with "Run WiseScript From Installation", so the CA SHOULD be there.
It sounds like the setup is hitting an error inside your rollback custom action. The first thing I would do to prevent the setup from bombing out would be to mark the rollback custom action with "don't check exit code".
I haven't used Wise in a while and don't know exactly where you find this in the GUI, but it shouldn't be that difficult. It is probably a flag you can set when you insert the custom action into the InstallExecuteSequence.
Secondly you would need to start debugging the actual content inside the custom action to determine where it crashes and obviously resolve the root of the problem before the rollback action will work properly. Sometimes it is sufficient to just use numbered message boxes to track the progress of the code in the custom action at runtime, but at other times you need to use the debugger feature to step through each line in the custom action code.

VS2005 Setup project - program asks for installation media when started for the first time by another user

I have a very simple VS2005 deployment project that aims to install for all users on a PC.
All the application files are written to %Program Files%\MyProg. A shortcut is created in the start menu and the startup folder. No registry settings or anything else are created. I have set
'InstallAllUsers' to true.
The created MSI runs fine and installs the software. It works without any problems when running under the user account from which it was installed.
When logging in as another user, the start menu and startup icons are present. It attempts to launch the application however an installation window pops up and states that 'the feature you are trying to use is on a network resource that is unavailable.' The installer will only proceed if pointed to the original MSI file.
Why does this happen? I want my application to be installed completely for all users when it is installed by a single user.
edit: Solution
I was getting similar event log messages as shown on this page. In my case it turned out to be as simple as ensuring that the User's Program Menu had its 'AlwaysCreate' attribute turned to false. If it was true, windows would try and recreate the folder when a new user logged in. This somehow required the invocation of the installer and thus resulted in the 'please insert the installation media' prompts.
It is actually kind of hard to say without some more information. I would recommend checking on the rights in the installed folder (seeing if only the one who installed it has rights) and also checking the file list for the directory (to make sure VS didn't automatically place some files in the user profile). Let me know what comes out from those two steps and we can try to keep digging if that didn't shed any light on it.
Keep in mind chances are this is most def not specific to Visual Studio, look at this MS support article here where the same message is coming back for office.
I know this is an old post but I thought I'd add another cause and solution in case the above didn't work for you.
There is a bug in VS Setup and Deployment Projects which results in registry values being entered into HKCU instead of HKLM irrespective of the InstallAllUsers property being set to true.
You must use Orca msi editor to change the registry root for "DesktopFolder" and "ProgramMenuFolder" from either 1 or 2 to -1. The issue cannot be resolved via VS.
http://www.qa.downappz.com/questions/vs-2010-deploys-per-user-features-during-install-which-require-access-to-install-media.html

Resources