notas:windows:scripts_varios_de_powershell
Diferencias
Muestra las diferencias entre dos versiones de la página.
Ambos lados, revisión anteriorRevisión previaPróxima revisión | Revisión previa | ||
notas:windows:scripts_varios_de_powershell [2016/01/22 13:06] – cayu | notas:windows:scripts_varios_de_powershell [Fecha desconocida] (actual) – borrado - editor externo (Fecha desconocida) 127.0.0.1 | ||
---|---|---|---|
Línea 1: | Línea 1: | ||
- | ====== Scripts varios de PowerShell ====== | ||
- | ==== Exchange ==== | ||
- | Get-MailboxFolderStatistics USUARIO | Select-Object Name | ||
- | |||
- | Get-MailboxFolderPermission USUARIO: | ||
- | |||
- | === Listar tamaños de los Mailbox de Exchange === | ||
- | <code powershell> | ||
- | Get-MailboxDatabase “Mailbox Database 1” | Get-MailboxStatistics | Sort totalitemsize -desc | ft displayname, | ||
- | </ | ||
- | === Listar Usuario/ | ||
- | <code powershell> | ||
- | Get-Recipient -ResultSize Unlimited | | ||
- | ? {$_.RecipientType -eq " | ||
- | Select DisplayName, | ||
- | Export-Csv report.csv -NTI | ||
- | </ | ||
- | ==== Varios ==== | ||
- | === Export en CSV de Datos de Active Directory === | ||
- | <code powershell> | ||
- | Get-ADUser -Filter * -SearchBase ' | ||
- | Displayname, | ||
- | </ | ||
- | === Ver WWN De las placas de fibra === | ||
- | **Find HBA and WWN Information on Windows using WMI (Updated Feb 2015)** | ||
- | <code powershell> | ||
- | function Get-HBAWin { | ||
- | param( | ||
- | [String[]]$ComputerName = $ENV: | ||
- | [Switch]$LogOffline | ||
- | ) | ||
- | |||
- | $ComputerName | ForEach-Object { | ||
- | try { | ||
- | $Computer = $_ | ||
- | |||
- | $Params = @{ | ||
- | Namespace | ||
- | class | ||
- | ComputerName = $Computer | ||
- | ErrorAction | ||
- | } | ||
- | |||
- | Get-WmiObject @Params | ||
- | $hash=@{ | ||
- | ComputerName | ||
- | NodeWWN | ||
- | Active | ||
- | DriverName | ||
- | DriverVersion | ||
- | FirmwareVersion | ||
- | Model | ||
- | ModelDescription = $_.ModelDescription | ||
- | } | ||
- | New-Object psobject -Property $hash | ||
- | }# | ||
- | }#try | ||
- | catch { | ||
- | Write-Warning -Message " | ||
- | if ($LogOffline) | ||
- | { | ||
- | " | ||
- | } | ||
- | } | ||
- | |||
- | }# | ||
- | |||
- | }# | ||
- | </ |
notas/windows/scripts_varios_de_powershell.1453468000.txt.gz · Última modificación: 2016/01/22 13:06 por cayu