also Get-WmiObject -class win32_product -ComputerName “localhost” does not even list the package. Very frustrating, programs and features removes it just fine, you’d think this would be fairly straight forward in powershell. Need to do this across multiple computers, why I am trying to figure it out on powershell. Sure its got to be more complicated then this, any help would be appreciated.
Usually you find the uninstall strings in the registry and you can invoke this to uninstall applications just like the “programs and features” does it.
You should search for 64 bit applications in HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall and for 32 bit applications in HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall.
… and there are already scripts / tools for this, that is if you don’t want to write them yourself.
Windows 10 Store Apps Uninstaller (PowerShell/WinForms)
If you no longer need an app, then you could use Windows 10 Store Apps Uninstaller to remove it and free up space on the drive.
https://gallery.technet.microsoft.com/scriptcenter/Windows-10-Store-Apps-5f60b9e3/view/Discussions
Remove Windows Store apps in Windows 8, Windows 8.1 and Windows 10
This script can be used to remove multiple Windows Store apps from a user account in Windows 8, Windows 8.1 and Windows 10. It provides a list of installed Windows Store apps. You can specify the application IDs, and remove them all at
Otherwise the registry uninstall location pointed to by Olaf and avoid using win32_product at all costs. It does some unwanted things, several articles on the web about that as well.
Thanks for the help, I have it figured out. Running into a new problem, I have created a .bat file to install my new AV. I have created the domain policy’s to enter-pssession and that works fine. However once I’m on the remote computer and I try it execute the .bat I get permission denied. I have also tried to use invoke-command on the remote pc with the same error. cmdlt I am trying to run is (start-process -computername -filepath) with and without -credentials. I am a domain admin in the network.
There is unfortunately little to no chance for us to help you without seeing your code. If you post code please format it as code. Thanks.
You can edit your post to include the code if you want.
[quote quote=119751]Are you admin on the remote computer? Is remote powershell enabled (can be a not easy task)?
[/quote]
It is domain joined so yes I am an admin on the computer. Not sure what you mean by remote powershell, I have my GP set to “allow remote server management through WinRM”, appropriate firewall ports opened and WinRM server starting automatically on pc’s.
[quote quote=119772]Is the batch file or AV installer you’re trying to run on different remote system? Sounds like you’re running into the double-hop problem.
[/quote]
Yes, the .bat file resides on a server share, I have heard of this issue but not sure what it means?
[d1]: ps c:>start-process -filepath “\dc-server1\softwaredeploy\install.bat” -credentials (access denied after entering local and domain credentials)
This is the classic double hop problem Neemobeer mentioned. You’re remoting from one machine to d1 (1st hop) all okay here. Then your trying to get to \dc-server1 (2nd hop) no go I’m afraid as you have not set d1 to be able to delegate your credentials to DC-server1. Check out this by Ashley Mcglone on how to get this to work.
I appreciate all the help, that article explained what I was doing wrong. I put the following script together, and it’s working. Hope maybe this helps someone else out.