Posted on 07-25-2024 07:19 AM
Hey y'all! I'm currently mass uninstalling an antivirus program within our environment. I got the script to run as I need it to but with one problem: to complete the uninstall, it prompts for a local admin password to remove the system extension.
How do I get around this without going to almost 200+ computers to input local admin information?
Posted on 07-25-2024 07:53 AM
assuming, the script, just asking for a 'password:' prompt, you could get around this by using the expect command. The same can be said for a simple Y/n prompt.
Here is an example of how to use expect with the passwd command,
#!/usr/bin/expect set USER [lindex $argv 0] set PASS [lindex $argv 1] set timeout 1 spawn passwd $USER expect -exact "Enter new UNIX password: " send -- "$PASS\r" expect -exact "Retype new UNIX password: " send -- "$PASS\r" expect eof
echo could also be helpful to overcome stuff like this. hope that helps.
07-25-2024 08:36 AM - edited 07-25-2024 08:37 AM
You need to mark the mark the System Extension as removable in your SysExt profile. if you didn't mark it as removal when first created the profile, create a second profile with the sane extension and mark it as removable.
FYI, you can apply this in addition to your original SysExt profile. Both profiles will stack.
Posted on 07-25-2024 08:41 AM
I will try this and report back! Thank you for the insight!