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.