Highlighted
shawniverson2 Absent Member.
Absent Member.
4121 views

Shutdown Problems and Workarounds

I am posting this information in the forum in hopes that it will provide good information for others trying to do the same thing and to provide feedback to Novell Zenworks Engineers for development.

Problem #1

Out of the box, Shutdown actions in Zenworks cause problems with Dynamic Local User Policies.

Steps to Reproduce.

1) Create a Bundle with a Shutdown action, allow user to cancel, and set the shutdown duration to a nonzero number (i.e 300 seconds).
2) Assign a scheduled time for the bundle to execute.
3) Leave the computer logged off during the scheduled time.
4) Attempt to log in during the "cancellation window" period when the shutdown prompt would normally appear.

DLU will stop working and a second login box for local login will appear.

Problem #2

Screensavers and standby modes interfere with the shutdown action.

Steps to reproduce.

Same as above, but allow the computer to go to sleep or screensaver to appear prior to the shutdown schedule.

Typically the computer stay in its current state until the mouse is wiggled or a key is pressed, then it will shutdown.

Problem #3

Computers will intermittently hang during shutdown when a Shutdown Action runs with no user logged in.

I am observing this phenomenon occurring at 3-10% of computers in my environment.

Not sure the cause here, but the computer will never actually completely shuts down and requires manual intervention.

My workaround for all three problems.

1) Download "Wake up on Standby" wosb.exe from Downloads - WakeupOnStandBy
2) Create two bundles, one for users logged in and one for users not logged in to run at the same time.

For the User Logged in Bundle

Copy down and execute the wosb.exe (also can be run from a network share, change actions accordingly)

Install Actions (Set option to Install Always)
1) Create Folder %systemdrive%\myzenfolder (Run as System, continue on failure checked)
2) Install Files wosb.exe to %systemdrive%\myzenfolder (Run as System, copy if does not exist)
3) Launch Executable (Run as Dynamic Administrator and wait when action is complete)

Command %systemdrive%\myzenfolder\wosb.exe
Parameters /run /screenon tm=+0:01
Working Directory %systemdrive%\myzenfolder
Return Codes 0,2

4) Run Script (Define your own script, leave all other fields default, set to wait when action is complete, Run as Dynamic Administrator)


REM Is an interactive user logged in?
set ucount=1
for /f "tokens=*" %%G in ('wmic ComputerSystem Get UserName ^| Find /c "\"') do (set ucount==%%G)

REM In case something goes wrong with above throw nonzero return code
IF %ERRORLEVEL% NEQ 0 exit 1

REM If no user logged in throw nonzero return code
if %ucount% == 0 exit 1


Success Return Code is set to 0 on Advanced tab

5) Set your Reboot/Shutdown Action Last with the option for the user to cancel and your defined countdown value.

Set your bundle to "install" on your defined schedule

For the Not Logged In User Bundle

Copy down and execute the wosb.exe (also can be run from a network share, change actions accordingly)

Install Actions (Set option to Install Always)
1) Create Folder %systemdrive%\myzenfolder (Run as System, continue on failure checked)
2) Install Files wosb.exe to %systemdrive%\myzenfolder (Run as System, copy if does not exist)
3) Launch Executable (Run as Dynamic Administrator and wait when action is complete)

Command %systemdrive%\myzenfolder\wosb.exe
Parameters /run /screenon tm=+0:01
Working Directory %systemdrive%\myzenfolder
Return Codes 0,2

4) Run Script (Define your own script, leave all other fields default, set to wait when action is complete, Run as Dynamic Administrator)


REM Is anyone logged in?
set ucount=1
for /f "tokens=*" %%G in ('wmic ComputerSystem Get UserName ^| Find /c "\"') do (set ucount==%%G)

REM Check for an error
IF %ERRORLEVEL% NEQ 0 exit 1

REM Use native shutdown command instead of shutdown action (more reliable when no one is logged in for some reason)
if %ucount% == 0 shutdown /s /f /t 0


Success Return Code set to 0 on Advanced tab

Set your bundle to "install" on your defined schedule.


As you can see, this was an awful lot of work to get automatic shutdown working consistently without problems here! Hopefully someone else (or even Novell) comes up with a more elegant solution for all.

If all is well, any computers not logged in will shutdown immediately, and any computers logged in will prompt whether to shutdown.

Problem #1 goes away because the not logged in bundle shuts them down immediately
Problem #2 goes away because of the use of wosb.exe
Problem #3 goes away because a Shutdown Action is not running when no one is logged in
Labels (2)
0 Likes
2 Replies
Anonymous_User Absent Member.
Absent Member.

Re: Shutdown Problems and Workarounds

shawniverson2,

It appears that in the past few days you have not received a response to your
posting. That concerns us, and has triggered this automated reply.

Has your problem been resolved? If not, you might try one of the following options:

- Visit http://support.novell.com and search the knowledgebase and/or check all
the other self support options and support programs available.
- You could also try posting your message again. Make sure it is posted in the
correct newsgroup. (http://forums.novell.com)

Be sure to read the forum FAQ about what to expect in the way of responses:
http://forums.novell.com/faq.php

If this is a reply to a duplicate posting, please ignore and accept our apologies
and rest assured we will issue a stern reprimand to our posting bot.

Good luck!

Your Novell Product Support Forums Team
http://forums.novell.com/

0 Likes
dholland Absent Member.
Absent Member.

Re: Shutdown Problems and Workarounds

I know this thread is getting very old, but is anyone else using this or another method.
I have tried this with limited success.

I have created two bundles
WOSB
WOSB - Not logged in

I have created them with the create folder and install files in the "Install" portion.
I then moved the Launch executable to the Launch section.
I have the assignment detailf for distribution to run on device refresh,
the launch schedule to run at a given time say "16:00"

For the most part it doesn't work. Many times the teacher will return the next day and once they log in the application then runs.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.