Here is a litle script i’ve build by digging through differents article to match what i needed :

#Extracting the date
$day = get-date -Format dd
$month = get-date -format MM
$year = get-date -format yy
$hour = get-date -Format hh
$min = get-date -Format mm
$today = $day+$month+$year+"-"+$hour+$min
$myFile = "c:\DATA\stats" + $today + ".txt"

#Getting stats from each zone and send all to the text file
Get-DnsServerZone | select zonename | Get-DnsServerStatistics > $myFile

#Sending stats file per email
$PSEmailServer = "email server IP"
Send-MailMessage -From "" -To "who need the" -Subject $Today" DNS Stats" -Attachments $myFile

First save that into a .ps1 file and then run that through a schedule task with that batch file

PowerShell.exe -Command "& ‘getstats.ps1’"

Tagged with:  

$job = Get-VBRJob -name "NameOfTheJob"
$job.GetObjectsInJob() | foreach { $_.Location }

reference :

Tagged with:  

In exchange powershell :

# Configure Virtual Directories for the “Default Web Site”

Set-WebServicesVirtualDirectory -Identity Exch2007\"EWS (Default Web Site)" -InternalUrl -ExternalUrl
Set-OabVirtualDirectory -Identity Exch2007\"OAB (Default Web Site)" -InternalUrl -ExternalUrl -RequireSSL:$True
Set-UMVirtualDirectory -Identity Exch2007\"UnifiedMessaging (Default Web Site)" -InternalUrl -ExternalUrl
Set-OWAVirtualDirectory -Identity Exch2007\"OWA (Default Web Site)" -InternalURL -ExternalUrl -LogonFormat username -DefaultDomain
# Set URL for AutoDiscover
Set-ClientAccessServer -Identity Exch2007 -AutodiscoverServiceInternalURI -AutodiscoverSiteScope:$null
Set-AutoDiscoverVirtualDirectory -identity Exch2007\"Autodiscover (Default Web Site)" -InternalUrl -ExternalUrl
# Reset IIS

Ref :
Tagged with:  
  • Get-MoveRequest -movestatus completed | remove-moverequest
Tagged with:  
  • The minimum result size is 1000, so if you have more user then we need to add the switch -resultsize
Get-Mailbox -resultsize unlimited | select name,database | export-csv "c:\mailboxperdatabase2.csv"
Tagged with:  

Sorry, this entry is only available in Français.

Tagged with:  

Do to so, we need to combine 2 commands and here we go !

get-MoveRequest | get-MoveRequestStatistics


Tagged with:  

1. In powershell :

Add-ADPermission -InheritedObjectType User -InheritanceType Descendents -ExtendedRights Send-As -User “BESAdmin” -Identity “DC=MonDomaine,DC=COM”

2. To validate that the command worked :

Get-Mailbox -Identity “Affichage du nom d’usager” | Get-ADPermission | where { ($_.ExtendedRights -like”*Send-As*”) -and -not ($_.User -like “NT AUTHORITY\SELF”) } | select Identity, User, ExtendedRights, IsInherited | FT -Wrap

Tagged with:  

Get-Mailbox -ResultSize Unlimited |Select-Object DisplayName,PrimarySmtpAddress, @{Name=”EmailA

ddresses”;Expression={$_.EmailAddresses |Where-Object {$_.PrefixString -ceq “smtp”} | ForEach-Object {$_.SmtpAddress}}}

| export-csv c:\mail.csv

  1. get-mailbox -Organisation MyOrganisation = Affiche une liste de toute les boites de courriels de l’organisation spécifié
  2. get-mailboxdatabase = Affiche la liste complète de toutes les bases de données sur le serveur
  3. get-mailbox -Database MyDatabase = Affiche la liste de toutes les boites de courriels dans une base de données spécifique
  4. New-MoveRequest -Identity MyEmailAdress -TargetDatabase MyDatabase = Déplacement d’une boite de courriels dans une autre base de données
  5. Get-Mailbox -database MyDatabase | New-MoveRequest -TargetDatabase MyOtherDatabase -BatchName “MyDataBase to MyOtherDatabase” = Déplacement de tout les boites de courriels d’une base de données vers une autre
  6. Get-Mailbox -Database MyDatabase | select DisplayName, Alias, Database, PrimarySmtpAddress = Rajouter des valeurs dans la requête pour avoir plus d’information
  7. get-mailbox -Organization MonOrganisation -Identity MaBoite | Set-Mailbox -ForwardingAddress = Rajouter une redirection de courriel sur une boite de votre organisation
  8. Search-MessageTrackingReport -Identity “Frederick Lamontagne” -sender “” -BypassDelegateChecking -DoNotResolve = Sort tout les messages recu pour cet usager provenant de
Tagged with: