Category Archives: Windows

Exchange New-MailboxImportRequest – Import PST files

New-MailboxImportRequest -Name “Import1” -Mailbox “Test User” -FilePath \\ServerName\SharedFolder\Imported.pst -TargetRootFolder “Inbox/Imported” The above command will create a subfolder under the Inbox called “Imported” and all PST data will be imported into that subfolder. Get-MailboxImportRequest -Status Completed | Remove-MailboxImportRequest -Confirm:$all ( delete … Continue reading

Posted in Exchange | Leave a comment

Reduce KVM Windows qcow2 file size

Clean up the virtual drive (remove temps files, etc) Defrag with the open source UltraDefrag software with “full optimisation” Run “sdelete -z c:“ Run “qemu-img convert -p -f qcow2 -O qcow2 Win7.qcow2  /newpath/Win7.qcow2“ For Linux Guest: dd if=/dev/zero of=/mytempfile # … Continue reading

Posted in Linux, Windows | Tagged | Leave a comment

Exchange – remove address from all groups and hide it from GAL

Filename:  script.ps1 $email = (read-host “email”) $GG = Get-DistributionGroup $RG = $GG  | where {(Get-DistributionGroupMember $_ | foreach {$_.PrimarySmtpAddress}) -contains “$email”} foreach( $dg in $RG ){ Remove-DistributionGroupMember $dg -Member $email } get-mailbox -Identity $email | Set-Mailbox -HiddenFromAddressListsEnabled $true  

Posted in Exchange | Leave a comment

Convert URL text to clickable hyperlink in Excel

1. Select the range of url text that you want to convert to clickable hyperlinks. 2. Hold down the ALT + F11 keys to open the Microsoft Visual Basic for Applications window. 3. Click Insert > Module, and paste the … Continue reading

Posted in Windows | Tagged | Leave a comment

Exchange – Add mailbox permissions to Domain Admins

Add-MailboxPermission -Identity alice.cooper -User “Domain Admins” -AccessRights Fullaccess -InheritanceType all

Posted in Exchange | Leave a comment

Exchange – Check Email forwarding using Powershell

Get-Mailbox -Filter {ForwardingAddress -ne $null} | ft Name,ForwardingAddress,DeliverToMailboxAndForward -Autosize | Export-CSV e:\Email_forwarding_output.csv

Posted in Exchange | Leave a comment

Reset password in Active Directory using PowerShell

  You must have the cmdlets ( part of the ActiveDirectory module for PowerShell v2 ) For Windows 7, you need to install the latest RSAT (Remote Server Admin Tools) and then add the Windows Feature for the PowerShell AD … Continue reading

Posted in Exchange | Leave a comment

Automatically Map Network Drive Batch File

Create the file ( .bat ) and let NET pick a free drive letter, then use NET to find out what letter it assigned: net use * “\\server\share” for /f “tokens=2” %%i in (‘net use ^| find “\\server\share”‘) do set … Continue reading

Posted in Windows | Leave a comment

Exchange 2010 View Disconnected Mailboxes

Get-Mailbox -Filter “exchangeuseraccountcontrol -eq ‘accountdisabled’”  | Get-MailboxStatistics | Sort-Object TotalItemSize -Descending | ft Displayname,TotalItemSize,Database

Posted in Exchange, Windows | Leave a comment

Exchange 2010 – Mailbox Traffic Report

View received e-mails for period: get-messagetrackinglog -ResultSize Unlimited -Recipient user@domain.com -Start “09/01/2014 12:00:00 AM” -End “09/30/2011 11:59:00 PM” | select timestamp, messageid, messagesubject, sender, {$_.recipients}, totalbytes, recipientcount | export-csv c:\somefolder\user-incoming.csv Add | measure-object to count the results; For sent e-mails … Continue reading

Posted in Exchange | Leave a comment