- Home
-
Store
- Browse All
- SHARED HOSTING
- VPS SERVER
- DEDICATED SERVER
- DATABSE HOSTING
- RESELLER HOSTING
- EMAIL HOSTING
- FTP HOSTING
- Hosting Addons
- SSL Certificates
- Weebly Website Builder
- SiteLock
- Email Spam Filtering
- CodeGuard
- Windows Server License
- SSL Certificates
- Website Builder
- Website Security
- E-mail Services
- Website Backup
- SEO Tools
- Site Builder
- VPN
- Professional Email
- XOVI NOW
- Register a New Domain
- Transfer Domains to Us
- Announcements
- Knowledgebase
- Network Status
- Contact Us
-
More
Categories
Categories
Tag Cloud
Powershell Script to remove the Default outlook Profile in user machines Print
- 0
$outlookApplication = New-Object -ComObject ‘Outlook.Application’
$profileName = $outlookApplication.Application.DefaultProfileName
$profileRoot16 = “HKCU:\Software\Microsoft\Office\16.0\Outlook\Profiles”
$profileRoot15 = “HKCU:\Software\Microsoft\Office\15.0\Outlook\Profiles”
if (Test-Path $profileRoot15){
$outlookProfile15 = Join-Path -Path $profileRoot15 -Childpath $profileName
}
if (Test-Path $profileRoot16){
$outlookProfile16 = Join-Path -Path $profileRoot16 -Childpath $profileName
}
if (-not(test-path $Env:USERPROFILE\outlookprofiledelete.log)){
if (test-path $profileRoot15){
Remove-Item “$outlookProfile15\*” -force -Recurse | Out-File $Env:USERPROFILE\outlookprofiledelete.log
}
if (test-path $profileRoot16){
Remove-Item “$outlookProfile16\*” -force -Recurse | Out-File $Env:USERPROFILE\outlookprofiledelete.log
}
}
Was this answer helpful?
Related Articles
Powered by WHMCompleteSolution