Monthly Archives: October 2012

Copy all file to a specific directory

If you need to make a copy off all files from a folders and it sub-folders to another folder can use this PowerShell Script:
Get-ChildItem <Source Folder> -Recurse | where {!$_.PsIsContainer} | Copy-Item -Destination <Target Folder>

This script copy all the files in the folder (and it subfolders) <Source Folder> on the <Target Folder>

Delete X400 adress when migrate Exchnage to 2010

This is the powershell script who I have used for remove the X400 address from AD when end the migration to Exchange 2010.

$MbxList = Get-Mailbox -ResultSize unlimited;
foreach ($mbx in $MbxList)
{
$ea = $mbx.EmailAddresses | ? {(($_.PrefixString -ne “X400”) -or ($_.PrefixString -ne “x400”))};
Set-Mailbox $mbx -EmailAddresses $ea -WhatIf
}