MoveMailbox.ps1$UserFile = "users.txt"
$MyData = Import-Csv $UserFile -Delimiter ;
ForEach ($item in $MyData){
$UserIdentity = $($item.UserIdentity)
$TargetDatabase = $($item.TargetDatabase)
$BadTolerance = $($item.BadTolerance)
if ($UserIdentity -match "^*[a-z0-1]@domain.cz$") {
New-MoveRequest -Identity $UserIdentity -TargetDatabase $TargetDatabase -BadItemLimit $BadTolerance
} else {
Write-Host "Bad user login $UserIdentity!" -foregroundcolor "red"
}
}
users.txtUserIdentity;TargetDatabase;BadTolerance
user@domain.cz;exch10_db_1;10
Command to schedule:powershell -command ". 'C:\Program Files\Microsoft\Exchange Server\V14\bin\RemoteExchange.ps1'; Connect-ExchangeServer -auto; C:\Scripts\MoveMailbox.ps1"
Local machine
wmic path Win32_PerfFormattedData_PerfProc_Process get IDProcess,Name,PercentProcessorTime
Remote machine
wmic /node:"server1" path Win32_PerfFormattedData_PerfProc_Process get IDProcess,Name,PercentProcessorTime
Convert a NT system time (Integer8), in (10^-7)s intervals from 0h 1-Jan 1601, into a readable format. (pwdLastSet, lastLogon, etc)
w32tm /ntte %time%
Convert an NTP time, in (2^-32)s intervals from 0h 1-Jan 1900, into a readable format. (whenChanged, etc)
w32tm /ntpte %time%
Convert a datetime value to a NT system time (Opposite)
http://www.petri.co.il/software/datetointeger8.zip