Guest User

Untitled

a guest
May 27th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. # Remove signures from users when you dont have centralized server
  2.  
  3. $MSLocation = $env:USERPROFILE.ToString() + "\AppData\Roaming\Microsoft\"
  4. $SignaturesLocation = $MSLocation + "Signatures"
  5.  
  6. Try {
  7.  
  8. "User profile location - " + $SignaturesLocation
  9. cd $SignaturesLocation
  10. Get-ChildItem *.txt | Rename-Item -NewName { $_.name -Replace '\.txt$','.txt.bkp' }
  11. Get-ChildItem *.htm | Rename-Item -NewName { $_.name -Replace '\.htm$','.htm.bkp' }
  12. Get-ChildItem *.rtf | Rename-Item -NewName { $_.name -Replace '\.rtf$','.rtf.bkp' }
  13.  
  14. }
  15. Catch [System.Exception] {
  16.  
  17. Write-Host -ForegroundColor Red "Signature removal failed"
  18. Write-Host -ForegroundColor Green "This script only supports Windows Vista,Windows 7, Windows 8, Windows 8.1, or Windows 10"
  19. Write-Host -ForegroundColor Red "Your version of Windows is" ([System.Environment]::OSVersion.Version).ToString()
  20. Write-Host -ForegroundColor Red "Description of errror : "
  21. $error[0].ToString() + $error[0].InvocationInfo.PositionMessage
  22.  
  23. }
Add Comment
Please, Sign In to add comment