I need help with powershell

Anonymous
2024-07-08T14:43:56+00:00

I need help with powershell

***Move from Outlook / Windows / New Outlook for Windows / For home***

Windows for business | Windows Server | User experience | PowerShell

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question. To protect privacy, user profiles for migrated questions are anonymized.

0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2024-07-08T14:44:08+00:00

    Stop-Process -Name "WinWord","Excel","PowerPnt","OneNote","MsPub","MSAccess","InfoPath","Groove","OutLook","Lync","OfficeClickToRun","OfficeOnDemand","OfficeC2rClient","AppvshNotify","FirstRun","Setup","IntegratedOffIce","Integrator","Communicator","MSOSync","OneNoteM","IExplore","Mavinject32","Werfault","PerfBoost","RoamingOffice","MSIExec","OSE" -CO:$False -EA SI -F

    Move-Item "$env:LocalAppData\Microsoft\Outlook" C:\ -FO -EA SI -EV ProcessError;

    If ($ProcessError) { CMD /C START /MAX "" "$env:LocalAppData\Microsoft" }

    $RegKey = "\SOFTWARE\Microsoft\Office"

    Reg Export "HKEY_LOCAL_MACHINE$RegKey" "C:\Office.reg"

    Remove-Item "HKCU:$RegKey" -CO:$False -FO -R -EA SI -EV ProcessError;

    If ($ProcessError) { Set-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit" "LastKey" Computer\HKEY_CURRENT_USER\Software\Microsoft | regedit.exe -m }

    Set-ExecutionPolicy RemoteSigned -CO:$False

    Invoke-RestMethod -Uri "https://download.microsoft.com/download/e/1/b/e1bbdc16-fad4-4aa2-a309-2ba3cae8d424/OLicenseCleanup.zip" -OutFile "OLC.zip"

    Invoke-RestMethod -Uri "https://download.microsoft.com/download/f/8/7/f8745d3b-49ad-4eac-b49a-2fa60b929e7d/signoutofwamaccounts.zip" -OutFile "WAM.zip"

    Invoke-RestMethod -Uri "https://download.microsoft.com/download/8/e/f/8ef13ae0-6aa8-48a2-8697-5b1711134730/WPJCleanUp.zip" -OutFile "WPJ.zip"

    Expand-Archive OLC.zip -DestinationPath OLC -F

    Expand-Archive WAM.zip -DestinationPath OLC\WAM -F

    Expand-Archive WPJ.zip -DestinationPath OLC\WAM\WPJ -F

    CD OLC\OLicenseCleanup

    Start-Process "OLicenseCleanup.VBS" -Wait

    CD..

    CD WAM

    .\signoutofwamaccounts.ps1 -Wait

    CD WPJ\WPJCleanUp\WPJCleanUp

    .\WPJCleanUp.cmd -Wait

    Cmd /c "for /F "tokens=1,2 delims= " %G in ('cmdkey /list ^| findstr Target') do  cmdkey /delete %H"

    Control /name Microsoft.CredentialManager

    Start Outlook.exe /cleanroamedprefs

    0 comments No comments