Winbatch /RunElevated not elevated?

Benutzeravatar
Antarion
Beiträge: 25
Registriert: 10 Jan 2017, 09:52

Winbatch /RunElevated not elevated?

Beitragvon Antarion » 15 Feb 2018, 14:23

Hi,

I'm running this command in a Winbatch section :


Code: Alles auswählen

comment "Uninstall program found, starting uninstall"
Winbatch_uninstall /RunElevated
set $tmpExit$ = getLastExitCode
sub_check_exitcode
[Winbatch_uninstall]
wmic /OUTPUT:c:\tmp\wmic.log product where name="IBM Content Navigator for Microsoft Office" call uninstall


And 2 things happen:
It get a error code 0 even though wmic exit with a code 1603
    wmic log

    Code: Alles auswählen

    Executing (\\LAP-0966\ROOT\CIMV2:Win32_Product.IdentifyingNumber="{A3A27FE7-626C-4B49-B620-10C4324554B3}",Name="IBM Content Navigator for Microsoft Office",Version="2.0.3.4")->Uninstall()
    Method execution successful.
    Out Parameters:
    instance of __PARAMETERS
    {
       ReturnValue = 1603;
    };


    opsi log

    Code: Alles auswählen

    Call "wmic /OUTPUT:c:\tmp\wmic.log product where name="IBM Content Navigator for Microsoft Office" call uninstall"
    Waiting until the called process is finished
    Start process elevated
    ExitCode 0Executed process "wmic /OUTPUT:c:\tmp\wmic.log product where name="IBM Content Navigator for Microsoft Office" call uninstall"
    Set$tmpExit$ = getLastExitCode
    The value of the variable "$tmpExit$" is now: "0"

But more importantly, the exit code 1603 means that the command isn't run with elevated privilege. If i run it manually i got the code 1603, if i run it manually in a elevated cmd, it works.


OS is windows 10 1607 LTSB (build 14393.0)
opsi agent 4.0.7.24-2
opsi version

Code: Alles auswählen

opsi-atftp                     0.7.dfsg-7   advanced TFTP client
opsi-atftpd                    0.7.dfsg-7   advanced TFTP server - opsi version with pcre, fifo and max-blksize patches
opsi-configed                  4.0.7.5.22-2   OPSI config editor
opsi-depotserver               4.0.7.3-2      opsi depotserver configuration package
opsi-linux-bootimage           20170720-1   opsi bootimage for netboot tasks.
opsi-utils                     4.0.7.18-7     utilites for working with opsi.
opsiconfd                      4.0.7.14-1     opsi configuration service
opsipxeconfd                   4.0.7.9-1      opsi pxe configuration daemon
python-opsi                    4.0.7.52-1     opsi python library

Benutzeravatar
Antarion
Beiträge: 25
Registriert: 10 Jan 2017, 09:52

Re: Winbatch /RunElevated not elevated?

Beitragvon Antarion » 16 Feb 2018, 09:19

I tested on a Windows 10 Enterprise non LTSB 1607 Build 14393.187 and it didn't work either.

Benutzeravatar
n.wenselowski
uib-Team
Beiträge: 3195
Registriert: 04 Apr 2013, 12:15

Re: Winbatch /RunElevated not elevated?

Beitragvon n.wenselowski » 19 Feb 2018, 15:30

Hi,

is there an easy way for us to reproduce the behaviour to determine weather this is a bug?
For some programs the elevated rights are not enough and they require an real administrator.

What version of opsi-winst are you using?


Bye

Niko

Code: Alles auswählen

import OPSI

Benutzeravatar
Antarion
Beiträge: 25
Registriert: 10 Jan 2017, 09:52

Re: Winbatch /RunElevated not elevated?

Beitragvon Antarion » 20 Feb 2018, 09:01

Hi,

winst 4.12.0.12-1

the command is a wmic call uninstall

Code: Alles auswählen

wmic /OUTPUT:c:\tmp\wmic.log product where name="IBM Content Navigator for Microsoft Office" call uninstall


Thanks for your time

uncle_scrooge
Beiträge: 625
Registriert: 21 Feb 2012, 12:03
Wohnort: Mainz

Re: Winbatch /RunElevated not elevated?

Beitragvon uncle_scrooge » 20 Feb 2018, 09:21

Would go with msiexec directly. See https://www.ibm.com/support/knowledgece ... cco050.htm
If you want to stick with wmic, have you tried /nointeractive ?
E.g.

Code: Alles auswählen

wmic /OUTPUT:c:\tmp\wmic.log product where name="IBM Content Navigator for Microsoft Office" call uninstall /nointeractive

Benutzeravatar
Antarion
Beiträge: 25
Registriert: 10 Jan 2017, 09:52

Re: Winbatch /RunElevated not elevated?

Beitragvon Antarion » 23 Feb 2018, 10:19

Thanks for the help scrooge.

Unfortunately it doesn't work either.

and my install part doesn't work anymore too :


Winbatch_install /RunElevated
[Winbatch_install]
msiexec /package c:\tmp\$msiinstall$ /passive $msi_argument$


error 1603 :(

uncle_scrooge
Beiträge: 625
Registriert: 21 Feb 2012, 12:03
Wohnort: Mainz

Re: Winbatch /RunElevated not elevated?

Beitragvon uncle_scrooge » 23 Feb 2018, 14:53

Mother IBM is notorious for writing terrible installers.

Try a msiexec install/uninstall with a log output.
Check the logs.
There must be a hint where and why it's failing.

I assume/fear that the installer is trying to write to the callers profile. And the system account doesn't have a 'real' one.

Benutzeravatar
Antarion
Beiträge: 25
Registriert: 10 Jan 2017, 09:52

Re: Winbatch /RunElevated not elevated?

Beitragvon Antarion » 23 Feb 2018, 15:09

The thing is that it has wroked for 2 years prior that problem.

thanks for your help Scrooge.

uncle_scrooge
Beiträge: 625
Registriert: 21 Feb 2012, 12:03
Wohnort: Mainz

Re: Winbatch /RunElevated not elevated?

Beitragvon uncle_scrooge » 23 Feb 2018, 16:02

Ha. Like it when information comes in in small pieces. Keeps me busy and mentally healthy.

Ok, it had worked for two years. Fine.
What happenend between 'working' and 'not working anymore'?
Updates for OPSI? Updates for client's OS? Updates for the IBM product? Bad weather in the outer rims of Alpha Centauri?

And my suggestion - get the MSI-logs and read them - still applies.

Don't have a Win10 1607 at hand, nor this IBM Content Navigator. So I can't reproduce anything here.

Benutzeravatar
Antarion
Beiträge: 25
Registriert: 10 Jan 2017, 09:52

Re: Winbatch /RunElevated not elevated?

Beitragvon Antarion » 26 Feb 2018, 10:27

Yeah I thought i had mentioned it. Sorry I've been in this problem for quite some time now.
This package is not used often so i really don't know what changed since the last time it was used.


Thank you anyway.