Archive

Archives pour 19/11/2010

Supprimer les anciens fichiers de logs.

Ce script supprime les fichiers de logs de plus de 30 jours.

?View Code POWERSHELL
$Now = Get-Date
$LastWrite = $Now.AddDays(-30)
$Files = get-childitem -Path ".\logs" -include *.log -recurse |Where {$_.LastWriteTime -le "$LastWrite"} 
foreach ($File in $Files){
if ($File) {
write-host "Deleting File '$File'"
Remove-Item $File | out-null
}
}
Categories: Windows Tags:

Exporter les statistiques de Enterprise Vault

Enterprise Vault
Voici comment j’exporte les statistiques d’archivage dans Symantec Enterprise Vault.

?View Code POWERSHELL
$Server = "server30"
$Database = "EVaultStoreArchive1"
$AttachmentPath = ".Export_EVEV_1_Stats.csv"
$SqlQuery = "SELECT [ArchiveName], ArchivedItems, CAST(ArchivedItemsSize AS decimal(20, 0)) AS ArchivedItemsSize From view_ListVaults INNER JOIN [EnterpriseVaultDirectory].[dbo].[ArchiveView] ON view_ListVaults.ArchivePointId = [EnterpriseVaultDirectory].[dbo].[ArchiveView].[VaultEntryId]"
$SqlConnection = New-Object System.Data.SqlClient.SqlConnection
$SqlConnection.ConnectionString = "Data Source=$Server;Initial Catalog=$Database;Integrated Security = True"
$SqlCmd = New-Object System.Data.SqlClient.SqlCommand
$SqlCmd.CommandText = $SqlQuery
$SqlCmd.Connection = $SqlConnection
$SqlAdapter = New-Object System.Data.SqlClient.SqlDataAdapter
$SqlAdapter.SelectCommand = $SqlCmd
$DataSet = New-Object System.Data.DataSet
$nRecs = $SqlAdapter.Fill($DataSet)
$nRecs | Out-Null
$objTable = $DataSet.Tables[0]
$objTable | Export-CSV $AttachmentPath
Write-Host "Export terminé."
$resfile = New-Item -ItemType file -Path ".Export_EVEV_1_Stats_Result.csv" -Force
Add-Content -Path $resfile -Value "FirstOU,Name,ArchivedItems,ArchivedItemsSize,VaultCache,OrganizationalUnit"
$evnom = "CN=EV_NOMADES,CN=Users,DC=domain,DC=local"
$InputFile = import-csv -Path $AttachmentPath
foreach ($Mailbox in $InputFile)
{
$user = Get-QADUser -Identity $Mailbox.ArchiveName
$user.Name
if ($user.NestedMemberOf -contains $evnom )
{$vaultchache = "True"}
Else
{$vaultchache = $null}
$FirstOU = $User.ParentContainer -split("/")
$FirstOU = $FirstOU[1]
Add-Content -Path $resfile -Value "$($FirstOU),$($Mailbox.ArchiveName),$($Mailbox.ArchivedItems),$($Mailbox.ArchivedItemsSize),$($vaultchache),$($user.ParentContainer)"

Déployer l’Agent EPO 4 McAfee par GPO.


Voici la procédure pour déployer l’Agent EPO 4.x par GPO.
Ça marche très bien, le seul soucis que j’ai est de reconfigurer les référentiel sur les poste où la version 4 est déjà installé.
Pour ce cas de figure, je continu à passer par ePolicy Orchestrator pour déployer l’agent.

Le lien: How to enable Group Policy deployment of McAfee Agent 4.x

Categories: McAfee Tags: , ,