Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <#
- run remote against a list of computers to clean all computers in the list
- file.txt contents:
- pcname1
- pcname2
- pcname3
- #>
- $computerList = "\\path\to\file.txt"
- $workstations = (get-content $computerList)
- #rename profile folder
- foreach ($computer in $workstations){
- write-output "-working on $computer"
- $folders = get-childitem "\\$computer\c$\users"
- foreach ($folder in $folders){
- $currentLoc = $folder.fullname
- write-output "-- working in $currentLoc on $computer"
- if (test-path \\$computer\c$\users\$folder\Appdata\Roaming\Imagenow){
- rename-item -path "\\$computer\c$\users\$folder\Appdata\Roaming\Imagenow" -newname "\\$computer\c$\users\$folder\Appdata\Roaming\Imagenow67"
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement