Hello all
for automation purposes I try to write a Python script wich uses fcconfig.exe to safe/load a FortiClient configuration. If I call fcconfig.exe from the command window with runas, it works. I can safe and load the configuration of the installed FortiClient.
If I try to do this trough Python, it doesen't work. Any Python pro's here who can help maybe?
This is my script:
import ctypes, sys
fcconfig_file = 'fcconfig.exe' fcclient_path = "C:\\Program Files\\Fortinet\\FortiClient\\"
fcclient_output_path = 'c:\\temp\\' fcclient_output_file = 'settings.xml' fcclient_arguments = ' -f ' + fcclient_output_path + fcclient_output_file
ret = ctypes.windll.shell32.ShellExecuteW(None, "runas", fcconfig_file, fcclient_arguments, fcclient_path, 1)
The script starts, and the UAC asks for permission. But fcconfig.exe does not write out anything.
Any ideas? Thanks for your help.
Nominating a forum post submits a request to create a new Knowledge Article based on the forum post topic. Please ensure your nomination includes a solution within the reply.
Turn off UAC?
Bob - self proclaimed posting junkie!
See my Fortigate related scripts at: http://fortigate.camerabob.com
dumbest idea ever! Not really helpful.
Look, you said it hangs on UAC. I suggested turning it off. Sorry if you felt my answer was the dumbest ever. Sometimes folks look at the minutia and cannot see the forest for the trees. I went out and made a suggestion. I will no longer do that for you.
Good luck
Bob - self proclaimed posting junkie!
See my Fortigate related scripts at: http://fortigate.camerabob.com
Look, we're here in a forum of a security specialized company. You really think disabling UAC in a productive enviorement is a good advice? I'm not looking for a way around, I'm looking for a solution.
I have no idea of the scope of this project. If it is on a secure server, a user workstation, a road warrior. If this is an occasional use item, daily... I just offered a suggestion. If it doesn't suit your needs, fine. We don't use UAC to block things here. Group policy effectively locks out users from installing things, so UAC is not necessary, so for my environment, that would have been a viable solution.
Bob - self proclaimed posting junkie!
See my Fortigate related scripts at: http://fortigate.camerabob.com
Select Forum Responses to become Knowledge Articles!
Select the “Nominate to Knowledge Base” button to recommend a forum post to become a knowledge article.
User | Count |
---|---|
1732 | |
1106 | |
752 | |
447 | |
240 |
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2024 Fortinet, Inc. All Rights Reserved.