Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Powershell script to remove Windows Sidebar folder and its contents from Windows 7 machines if present

$
0
0

I am very new to powershell, I just need a method to remove the Windows Sidebar from over 100 Windows 7 machines.  I am using domain admin privaleges. This is what I have so far:

_____________

# List of Computers

$name = Get-ADComputer -Filter * -Properties * | foreach-object {$_.name}

# folder to delete

$Cfolder = Get-ChildItem "C\Program Files\Windows Sidebar\" -Force -Recurse

$name Remove-Item $Cfolder -Force -Recurse

________________

With variations of the above I get Acces to the path is denied.

Even trying to log in locally and use:

Remove-Item -Path "C\Program files\Windows Sidebar\" -Force -Recurse

I get access to the path is denied. Using the Set-Owner command does not work.


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>