Add-Type -AssemblyName System.Speech; (New-Object System.Speech.Synthesis.SpeechSynthesizer).Speak("About three things I was absolutely positive: First, Edward was a vampire. Second, there was a part of him-and I didn't know how dominant that part might be-that thirsted for my blood. And third, I was unconditionally and irrevocably in love with him") Add-Type -AssemblyName System.Speech; (New-Object System.Speech.Synthesis.SpeechSynthesizer).Speak("Never Gonna give you up. Never gonna let you down. Never gonna run around and desert you") Import-module ActiveDirectory #FSMO Migration # 0 - PDCEmulator # 1 - RIDMaster # 2 - InfrastructureMaster # 3 - SchemaMaster # 4 - DomainNamingMaster Move-ADDirectoryServerOperationMasterRole -Identity "Target-DC" -OperationMasterRole 0,1,2,3,4 netdom query fsmo #Replace Network Printer after migration $printer = get-printer "\\oldserver\printersharename" if ($printer.name -ne $null) { Remove-Printer "\\oldserver\printersharename" Add-Printer -ConnectionName "\\newserver\printersharename" } #Powershell Delete files last written over 30 days ago $limit = (Get-Date).AddDays(-30) #Date is for 30 days old Get-ChildItem -Path "C:\program files\microsoft\exchange server\v15\logging" -Include "*.log" -Recurse -Force | Where-Object { !$_.PSIsContainer -and $_.LastWriteTime -lt $limit } | Remove-Item -Force Get-ChildItem -Path "C:\inetpub\logs" -Include "*.log" -Recurse -Force | Where-Object { !$_.PSIsContainer -and $_.LastWriteTime -lt $limit } | Remove-Item -Force Get-ChildItem -Path "C:\program files\microsoft\exchange server\v15\transportroles\data\temp" -Recurse -Force | Where-Object { !$_.PSIsContainer -and $_.LastWriteTime -lt $limit } | Remove-Item -Force Get-ChildItem -Path "C:\Windows\System32\LogFiles\HTTPERR" -Include "*.log" -Recurse -Force | Where-Object { !$_.PSIsContainer -and $_.LastWriteTime -lt $limit } | Remove-Item -Force #Replace Drive mapping when letters are inconsistent $driveletter = (Get-PSDrive | where {$_.DisplayRoot -eq "\\oldserver\share"}).root #Remove-PSDrive $driveletter.SubString(0,1) net use $driveletter.SubString(0,2) /d /y # Remove-psdrive doesn't function properly... bug in powershell New-PSDrive -name $driveletter.SubString(0,1) -psprovider FileSystem -root "\\newserver\share" #Windows 7,8,10, Server 2008, 2012, 2016 Profile setup $key = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced' Set-ItemProperty $key Hidden 1 Set-ItemProperty $key HideFileExt 0 Set-ItemProperty $key ShowSuperHidden 1 Stop-Process -processname explorer Add-VpnConnection -AllUserConnection -Name "VPN Name" -ServerAddress vpn.domain.com -TunnelType pptp -EncryptionLevel required -AuthenticationMethod MsChapv2 -UseWinlogoncredential -SplitTunneling -RememberCredential