Guest User

Untitled

a guest
May 27th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 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. $BackupFolder = $MSLocation + "Signatures Backup"
  6.  
  7.  
  8. Try {
  9.  
  10. "User profile location" + $SignaturesLocation
  11. cd $SignaturesLocation
  12. #New-Item -ItemType directory -Path $BackupFolder
  13. #Get-ChildItem -Path $SignaturesLocation + "\*.*" -Recurse | Move-Item -Destination @BackupFolder
  14. Get-ChildItem *.txt | Rename-Item -NewName { $_.name -Replace '\.txt$','.txt.bkp' }
  15. Get-ChildItem *.htm | Rename-Item -NewName { $_.name -Replace '\.htm$','.htm.bkp' }
  16. Get-ChildItem *.rtf | Rename-Item -NewName { $_.name -Replace '\.rtf$','.rtf.bkp' }
  17.  
  18. }
  19. Catch [System.Exception] {
  20.  
  21. Write-Host -ForegroundColor Red "Signature removal failed"
  22. Write-Host -ForegroundColor Green "This script only supports Windows Vista,Windows 7, Windows 8, Windows 8.1, or Windows 10"
  23. Write-Host -ForegroundColor Red "Your version of Windows is" ([System.Environment]::OSVersion.Version).ToString()
  24. $error[0].ToString() + $error[0].InvocationInfo.PositionMessage
  25.  
  26. }
Add Comment
Please, Sign In to add comment