Koldov Posted June 16, 2022 Posted June 16, 2022 (edited) Long shot, but as the title says, I need to run (without any other 3rd part software if possible): Dism /Online /Add-Capability /CapabilityName:XXXXXXXXXX /Source:\\SERVER\SHARE /LimitAccess What would be the best way to achieve this? It needs admin or system priv and should work in either CMD or PS, but I've found out that I can't get it to run properly as a start-up script as seems DISM might not have loaded (online/dependencies). Also it needs a restart (prompt y/n)... EDIT: I had the 'Remove-Capability' set as a start-up .bat script which ran, but: a) Didn't remove the capability b) Removed the line for it in the 'turn Windows features on or off' c) Now fails to remove the capability even if run manually, as it fails to find it (app still runs though) So now I have to add it back to remove it! Edited June 16, 2022 by Koldov
KevinB Posted June 20, 2022 Posted June 20, 2022 I know you want to avoid 3rd party tools, but PSExec is designed for just this sort of thing, is simple to use and most importantly is free: https://docs.microsoft.com/en-us/sysinternals/downloads/psexec 1
jr_ Posted June 28, 2022 Posted June 28, 2022 You'll need it running under administrator on the remote machine. Do you have Impero? Theres a handy command line tool on that which runs commands as SYSTEM account on remote PCs 1
Koldov Posted June 28, 2022 Author Posted June 28, 2022 Thanks, unfortunately I don't have anything like that, it was just easier in the end to remote into all the computers (doing it in batches per day) and run it. Lesson learnt... Everyday is a school day... Test, test, test.... etc.
Koldov Posted June 28, 2022 Author Posted June 28, 2022 (edited) Long story.... But essentially I wanted to remove IE11 from all the computers on site (not having the ADMX to disable it as a standalone browser in GPO)... So I messed with the remove in DISM as a start-up script, but it didn't actually remove IE11 from the computers (you could still use it fine), however it did remove it from 'Turn Windows Features On Or Off' and then any further attempts to remove it manually via PS or CMD failed as it it couldn't find it anymore! But I found I could add it back in and then remove it manually... So, I wanted to do the add-in to them all at once, but didn't want to make it worse as the remove start-up script went so badly... probably because I didn't do it correctly due to it not being the way it should be done and the correct services not being loaded on start-up. Edited June 28, 2022 by Koldov
jr_ Posted June 28, 2022 Posted June 28, 2022 (edited) Your best off using powershell instead of DISM. I've written you a quick script https://pastebin.com/gci508KJ https://4sysops.com/wiki/enable-powershell-remoting/ Edited June 28, 2022 by jr_ 1
Koldov Posted June 28, 2022 Author Posted June 28, 2022 Many thanks, I will give this a go (but might wait until the summer holidays now).
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now