Herramientas de usuario

Herramientas del sitio


notas:windows:scripts_varios_de_powershell

Diferencias

Muestra las diferencias entre dos versiones de la página.

Enlace a la vista de comparación

Ambos lados, revisión anteriorRevisión previa
notas:windows:scripts_varios_de_powershell [2016/01/26 14:57] cayunotas: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:\Carpeta 
- 
-=== Listar tamaños de los Mailbox de Exchange === 
-<code powershell> 
-Get-MailboxDatabase “Mailbox Database 1” | Get-MailboxStatistics | Sort totalitemsize -desc | ft displayname, totalitemsize, itemcount  
-</code> 
-=== Listar Usuario/Primary SMTP Address/Alias === 
-<code powershell> 
-Get-Recipient -ResultSize Unlimited |  
-? {$_.RecipientType -eq "MailContact" -or $_.RecipientType -eq "UserMailbox" -and $_.PrimarySmtpAddress } | 
-Select DisplayName,PrimarySmtpAddress,Alias | 
-Export-Csv report.csv -NTI 
-</code> 
-==== Varios ==== 
-=== Sesiones de escritorio remoto === 
-Ver sesiones activas 
-<code powershell> 
-query session /server:servidor.cayu.com.ar 
-</code> 
-Cancelar sesion activa 
-<code powershell> 
-rwisnta numero_sesion /server:servidor.cayu.com.ar 
-</code> 
-=== Export en CSV de Datos de Active Directory === 
-<code powershell> 
-Get-ADUser -Filter * -SearchBase 'OU=Varela, DC=CAYU, DC=COM' -Properties CanonicalName, Displayname, EmailAddress, Department, extensionAttribute12, extensionAttribute13 | select CanonicalName, 
-Displayname, EmailAddress, Department, extensionAttribute12, extensionAttribute13 | Export-CSV "C:\Varela.csv" 
-</code> 
-=== 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:ComputerName, 
-[Switch]$LogOffline  
- 
-  
-$ComputerName | ForEach-Object {  
-try { 
- $Computer = $_ 
-  
- $Params = @{ 
- Namespace    = 'root\WMI' 
- class        = 'MSFC_FCAdapterHBAAttributes' 
- ComputerName = $Computer  
- ErrorAction  = 'Stop' 
- } 
-  
- Get-WmiObject @Params  | ForEach-Object {  
- $hash=@{  
- ComputerName     = $_.__SERVER  
- NodeWWN          = (($_.NodeWWN) | ForEach-Object {"{0:X2}" -f $_}) -join ":"  
- Active           = $_.Active  
- DriverName       = $_.DriverName  
- DriverVersion    = $_.DriverVersion  
- FirmwareVersion  = $_.FirmwareVersion  
- Model            = $_.Model  
- ModelDescription = $_.ModelDescription  
- 
- New-Object psobject -Property $hash  
- }#Foreach-Object(Adapter)  
-}#try 
-catch { 
- Write-Warning -Message "$Computer is offline or not supported" 
- if ($LogOffline) 
- { 
- "$Computer is offline or not supported" >> "$home\desktop\Offline.txt" 
- } 
-} 
- 
-}#Foreach-Object(Computer)  
-  
-}#Get-HBAWin 
-</code> 
notas/windows/scripts_varios_de_powershell.1453820260.txt.gz · Última modificación: 2016/01/26 14:57 por cayu