Search Exchange mailbox for a particular folder

Connect to 365 via powershell $UserCredential = Get-Credential $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection Import-PSSession $Session -DisableNameChecking. Get-MailboxFolderstatistics -Identity mailboxname | Where {$_.Name -Match "foldername"} For instance to search my mailbox name Matt for a folder that contains alerts the command looks like this: PS C:\WINDOWS\system32> Get-MailboxFolderstatistics -Identity matt | Where {$_.Name -Match "alerts"} Although this give the output below, If you have multiple folders that contain your search criteria it can be difficulty to read To get a better idea of where the folder is located use the identity to filter PS C:\WINDOWS\system32> Get-MailboxFolderstatistics -Identity matt | Where {$_.Name -Match "alerts"} | select identity Identity -------- matt\LanSweeperAlerts Another example is a folder called backups that is within my inbox folder PS C:\WINDOWS\system32> Get-MailboxFolderstatistics -Identity matt | Where {$_.Name -Match "backups"} | select identity Identity -------- matt\Inbox\Backups Once you have finished disconnect your exchange powershell session Remove-PSSession $Session...
Read More

hyper-v Enable processor compatibility

Enabling this feature manually on each vm, via settings processor > expand > Compatibility > tick Migrate to a physical computer with a different processor version   View current status of all vm's on a host. PS C:\WINDOWS\system32> Get-VM | get-VMProcessor VMName Count CompatibilityForMigrationEnabled CompatibilityForOlderOperatingSystemsEnabled ------ ----- -------------------------------- -------------------------------------------- Activation-Test 1 False False AzureADConnect2 1 False False AzureBackup1 2 False False exchange 4 False False Proxy1 1 False False RDSHost (rdvh1) 1 False False SCCM (WSUS) 2 False False Steam-Cache 2 False False SYSDeploy 2 False False TesVMG1 1 False False TesVMG2 1 True False vd1-H0 1 False False vd1-H1 1 True False w10IotE 1 False False Windows10-vdi-m 1 False False Windows10-vdi-v1 1 False False Update all vm's on host (only updates vms that are powered off.) PS C:\WINDOWS\system32> Get-VM | set-VMProcessor -CompatibilityForMigrationEnabled $true   After (only updates VMs that are powered off) PS C:\WINDOWS\system32> Get-VM | get-VMProcessor VMName Count CompatibilityForMigrationEnabled CompatibilityForOlderOperatingSystemsEnabled ------ ----- -------------------------------- -------------------------------------------- Activation-Test 1 True False AzureADConnect2 1 False False AzureBackup1 2 False False exchange 4 True False Proxy1 1 True False RDSHost (rdvh1) 1 False False SCCM (WSUS) 2 False False Steam-Cache 2 True False SYSDeploy 2 True False TesVMG1 1 True False TesVMG2...
Read More

Unpin all items from windows 10 start menu

WARNING - This will removal all items from the start menu. You will need to re-pin any that you would like back. This is Recommend if you are logging in to the first time. Open Powershell ISE And do a new script and enter the following: (New-Object -Com Shell.Application). NameSpace('shell:::{4234d49b-0245-4df3-b780-3893943456e1}'). Items() | %{ $_.Verbs() } | ?{$_.Name -match 'Un.*pin from Start'} | %{$_.DoIt()}   Then run the script (press F5)  ...
Read More

VM kept a recovery checkpoint

Not sure why this occurred however I was planning to add a new drive to a vm, however could not add the new drive. Thinking back to an issue with a VM at work, on my VM exchange I tried to edit an existing drive on the VM and it mentions checkpoints exist. In poweshell I did get-vmsnapshot Exchange it mentioned it was a recovery checkpoint The command I used to remove it was get-vmsnapshot exchange | remove-vmsnapshot Below is a screenshot of the CMD/Powershell window ...
Read More