Link to home
Start Free TrialLog in
Avatar of motioneye
motioneyeFlag for Singapore

asked on

Using powershell to remove drive and scheduler Task in windows

I have a PS script below which I'm using to find the sql service information, how do I modify this scripts so that it can be only use to delete folder in C:\data\wsus  and delete the scheduler after ?

$resultsFile = "f:\Powershell\result.txt"
$Instances = get-content "f:\powershell\allservers.txt"
out-file $resultsFile
foreach ($server in $instances)
{
"checking $server.."
$sqlservice = gwmi win32_service -filter "name like 'mssql%'" -computername $server | select name,systemname,startname
"$server `n ------ "| out-file -append  $resultsFile
$sqlService | ft | out-file -append  $resultsFile
}
ASKER CERTIFIED SOLUTION
Avatar of Mauro Cazabonnet
Mauro Cazabonnet
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial