Will this script works only on servers or computers or Both? Is there any way to provide AD group as (all staff) within our AD in domain controller instead of hostname?
Hello friend, how are you? I had two problems: 1 - For me to connect to the machine, the WinRM service should be enabled on the user's machine; I enabled the service and was able to reach her. 2 - I'm trying to uninstall WinRar, but the script doesn't find the package to uninstall. When testing with Adobe Acrobat, Java, it works perfectly, but with WinRar not. I put the script like this: $Servers = Get-content "C:\Scripts\livePCs.txt" Foreach ($Server in $Servers){ Invoke-Command -ComputerName $Server -Credential $cred -ScriptBlock { (Get-Package -Name "WinRAR*" | Uninstall-Package -ErrorAction SilentlyContinue) }} Can you help me? Thanks
Kindly watch below video to uninstall WinRAR software from remote computer silently and let me know if you are facing any issue. Get-Package have some limitation hence it wont detect software installed through EXE file. czcams.com/video/wJYvortUCxI/video.html
How can i run this script in Ubuntu machine remotely can you please share video on Ubuntu as well, we have 200+ machines and right now doing manual login and uninstall which is time consuming. so looking for script to run on multiple computers running windows and ubuntu.
What if I don't see the program I want to remove? f. ex. I can't see Foxit Reader uninstaller. I type: Foxit Reader, Foxit Software*, Foxit*, *Foxit* etc. Is there any different way to uninstall Foxit?
If you don't see the program you want to remove then either you have to use the default uninstaller for it as mentioned in the video below or find another way to do it. Please check the video below and let me know if this helps for Foxit or else let me know so I'll work on Foxit as well. czcams.com/video/wJYvortUCxI/video.html
When you use foreach command, it run entire script one by one on computers given it servers list. So first part variable is single entry taken from second variable which has multiple entry for server name. So we are asking foreach command to pick first computer name run the complete script and then pick second computer name and run complete script till it reaches last computer names.
You can use below script to perform the task. I have only added new veriable for password and that i user afer invoke command. Please let me know if you have any query on this. $Servers = Get-content "C:\Scripts\livePCs.txt" $cred = get-credential Foreach ($Server in $Servers){ Invoke-Command -ComputerName $Server -Credential $cred -ScriptBlock { (Get-Package -Name "adobe acrobat reader*" | Uninstall-Package -ErrorAction SilentlyContinue) , (Get-Package -Name "7-Zip*" | Uninstall-Package -ErrorAction SilentlyContinue) }}
Hi Anoop, I have almost a same situation, while uninstalling it requires user to key in admin credentials to remove the programme. Kindly let me know if you have followed this script and if worked or could you suggest me any other thing which you may have carried out?
You can use below script to perform the task. I have only added new variable for password and that I use after invoke command. Please let me know if you have any query on this. $Servers = Get-content "C:\Scripts\livePCs.txt" $cred = get-credential Foreach ($Server in $Servers){ Invoke-Command -ComputerName $Server -Credential $cred -ScriptBlock { (Get-Package -Name "adobe acrobat reader*" | Uninstall-Package -ErrorAction SilentlyContinue) , (Get-Package -Name "7-Zip*" | Uninstall-Package -ErrorAction SilentlyContinue) }}
Could you please post part 2 as well
Hi i try it but it doesn't work. in display i have not error message and if use verbose it reply to me "unistall completed" ...can you help me?
Will this script works only on servers or computers or Both? Is there any way to provide AD group as (all staff) within our AD in domain controller instead of hostname?
I want to uninstall all c++
How?
Hello friend, how are you?
I had two problems:
1 - For me to connect to the machine, the WinRM service should be enabled on the user's machine; I enabled the service and was able to reach her.
2 - I'm trying to uninstall WinRar, but the script doesn't find the package to uninstall. When testing with Adobe Acrobat, Java, it works perfectly, but with WinRar not. I put the script like this:
$Servers = Get-content "C:\Scripts\livePCs.txt"
Foreach ($Server in $Servers){
Invoke-Command -ComputerName $Server -Credential $cred -ScriptBlock {
(Get-Package -Name "WinRAR*" | Uninstall-Package -ErrorAction SilentlyContinue)
}}
Can you help me?
Thanks
Kindly watch below video to uninstall WinRAR software from remote computer silently and let me know if you are facing any issue. Get-Package have some limitation hence it wont detect software installed through EXE file.
czcams.com/video/wJYvortUCxI/video.html
How can i run this script in Ubuntu machine remotely can you please share video on Ubuntu as well, we have 200+ machines and right now doing manual login and uninstall which is time consuming. so looking for script to run on multiple computers running windows and ubuntu.
HI I want to uninstall Google Chrome on Multiple computers, can you help me with the required script
What if I don't see the program I want to remove? f. ex. I can't see Foxit Reader uninstaller. I type: Foxit Reader, Foxit Software*, Foxit*, *Foxit* etc. Is there any different way to uninstall Foxit?
If you don't see the program you want to remove then either you have to use the default uninstaller for it as mentioned in the video below or find another way to do it. Please check the video below and let me know if this helps for Foxit or else let me know so I'll work on Foxit as well.
czcams.com/video/wJYvortUCxI/video.html
This work for only one users profile in specific workstation. not for all users
Thank you for notifying to us, I’ll check on this and let you know.
hi sir, can you explain this command here please ?? foreach ($Server in $Servers)
When you use foreach command, it run entire script one by one on computers given it servers list. So first part variable is single entry taken from second variable which has multiple entry for server name. So we are asking foreach command to pick first computer name run the complete script and then pick second computer name and run complete script till it reaches last computer names.
I have to use such script on 700 computers for a specific program but issue with i need to add admin credentials. can you plz help me on that ?.
You can use below script to perform the task. I have only added new veriable for password and that i user afer invoke command. Please let me know if you have any query on this.
$Servers = Get-content "C:\Scripts\livePCs.txt"
$cred = get-credential
Foreach ($Server in $Servers){
Invoke-Command -ComputerName $Server -Credential $cred -ScriptBlock {
(Get-Package -Name "adobe acrobat reader*" | Uninstall-Package -ErrorAction SilentlyContinue) ,
(Get-Package -Name "7-Zip*" | Uninstall-Package -ErrorAction SilentlyContinue) }}
Hi Anoop, I have almost a same situation, while uninstalling it requires user to key in admin credentials to remove the programme. Kindly let me know if you have followed this script and if worked or could you suggest me any other thing which you may have carried out?
All PCs join the Domain ?
Yes all PCs are part of domain and script is run under domain admin account which have admin access on all the computers.
while uninstalling it requires a password how can I integrate that password within this script
You can mention the server read credentials so that while script running it will ask password at the time.
You can use below script to perform the task. I have only added new variable for password and that I use after invoke command. Please let me know if you have any query on this.
$Servers = Get-content "C:\Scripts\livePCs.txt"
$cred = get-credential
Foreach ($Server in $Servers){
Invoke-Command -ComputerName $Server -Credential $cred -ScriptBlock {
(Get-Package -Name "adobe acrobat reader*" | Uninstall-Package -ErrorAction SilentlyContinue) ,
(Get-Package -Name "7-Zip*" | Uninstall-Package -ErrorAction SilentlyContinue) }}