Ir a contenido


MENSAJE DE BIENVENIDA Foro vínculado con Twitter, más info aquí.

“El secreto para progresar es empezar por algún lugar. El secreto para empezar por algún lugar es fragmentar tus complejas y abrumadoras tareas de tal manera que queden convertidas en pequeñas tareas que puedas realizar y entonces simplemente comenzar por la primera.” - Mark Twain

Alberto Dominguez

Registrado: 31 mar 2010
Offline Última actividad: jul 06 2020 08:36
-----

#1405 Resetar Password Masivo

Posted by Alberto Dominguez on 15 enero 2015 - 12:11

Crear archivo .bat con:

for /f "Tokens=1,2 Delims=;" %%a in (C:\temp\usuarios.csv) do dsmod user "%%a" -pwd %%b -mustchpwd no -canchpwd yes -pwdneverexpires no >> c:\temp\Log_usuarios_reseteados.txt



#1394 Cuellos de Botella en Netlogon

Posted by Alberto Dominguez on 17 julio 2014 - 10:24

Cuando se dan problemas de validación NTLM intermitentes es interesante tener en cuenta lo que se comenta en el siguiente link:

 

http://blogs.technet...currentapi.aspx

 

Además hay unos contadores de rendimiento en el servidor que tiene el problema:

 

Netlogon / Semaphore Holders

Netlogon / Semaphore Timeouts

Netlogon / Semaphore Waiters

Netlogon / Semaphore_hold_time

etc

 

Usar la formula: MaxConcurrentApi =(Semaphore_Acquires + Semaphore_Time-outs) * Average_semaphore_hold_time / Tiempo de Captura

 

http://support.microsoft.com/kb/928576

 

Que es intersante mirar eligiendo la instancia del DC contra el que se están validando...

 

Además hay una utilidad de powershell que proporciona información interesante:

 

http://gallery.techn...entApi-114547ad

 

Normalmente hay que ajustar el valor de la key del registro MaxConcurrentAPI del Servicio Netlogon:

 

http://support.micro...b/2688798/en-us

 

IMPORTANTE:  Tener en cuenta que los ajustes de la MaxConcurrentAPI deberán hacerse tanto en el server de aplicación (pe. CAS Exchange), como en el Domain Controller donde se valide.




#1391 Exportar Directamente a Excel

Posted by Alberto Dominguez on 22 mayo 2014 - 08:33

Dejo ejemplo de script:

$excel = New-Object -ComObject Excel.Application

$excel.Visible = $true

$workbook = $excel.Workbooks.Add()

$sheet = $workbook.ActiveSheet

$counter = 0

Get-Service |

ForEach-Object {

    $counter++

    $sheet.cells.Item($counter,1) = $_.Name

    $sheet.cells.Item($counter,2) = $_.DisplayName

    $sheet.cells.Item($counter,3) = $_.Status

}

Más info: http://blogs.technet...d-reliable.aspx




#1390 Query para obtener las alertas de la BBDD de DW de Espacio en Disco

Posted by Alberto Dominguez on 21 mayo 2014 - 13:46

SELECT
COUNT(vAlertDetail.AlertGuid) AS TotalAlerts,
Alert.vAlert.AlertName,
Alert.vAlert.Category,
AVG(Alert.vAlert.RepeatCount) AS AverageRepeatCount,
vManagedEntity.Path,
vManagedEntity.DisplayName,
vManagedEntity.ManagedEntityDefaultName,
vResolutionState.ResolutionStateName,
AVG(Alert.vAlertResolutionState.TimeFromRaisedSeconds) AS AverageOpenTimeSeconds
FROM Alert.vAlertDetail INNER JOIN
Alert.vAlert ON Alert.vAlertDetail.AlertGuid = Alert.vAlert.AlertGuid INNER JOIN
vManagedEntity ON Alert.vAlert.ManagedEntityRowId = vManagedEntity.ManagedEntityRowId INNER JOIN
Alert.vAlertResolutionState ON Alert.vAlert.AlertGuid = Alert.vAlertResolutionState.AlertGuid INNER JOIN
vResolutionState ON Alert.vAlertResolutionState.ResolutionState = vResolutionState.ResolutionStateId
WHERE
Alert.vAlert.RaisedDateTime BETWEEN getutcdate()-30 AND getutcdate()
AND Alert.vAlert.AlertName <> ''
AND Alert.vAlert.AlertName like '%logical disk Free Space%'
--AND vResolutionState.ResolutionStateName = 'New'GROUP BY
Alert.vAlert.AlertName,
Alert.vAlert.Category,
vManagedEntity.Path,
vManagedEntity.DisplayName,
vManagedEntity.ManagedEntityDefaultName,
vResolutionState.ResolutionStateName
ORDER BY COUNT(vAlertDetail.AlertGuid) DESC, AVG(Alert.vAlertResolutionState.TimeFromRaisedSeconds) DESC



#1389 Adjuntos de items listas con powershell

Posted by Alberto Dominguez on 09 mayo 2014 - 13:55

$web = Get-SPWeb -Identity http://sp2010:90
$list = $web.Lists["Resources"]
foreach ($item in $list.Items)
{
    $attachmentCollection = $item.Attachments
    $folder = $web.GetFolder($attachmentCollection.UrlPrefix);
    foreach ($file in $folder.Files)
    {
        Write-Host $item.Title
        Write-Host $file.Name
        Write-Host $file.Author
        Write-Host $file.TimeCreated
    }
}

Más info:  http://sharepointnad...ttachments.html




#1388 Extraer .wsp SP2010

Posted by Alberto Dominguez on 28 abril 2014 - 13:04

$granja= Get-SPFarm
$fichero = $granja.Solutions.Item("soluciontest.wsp").SolutionFile
$fichero.SaveAs("c:\temp\soluciontest.wsp")



#1387 SCCM Heartbeat Discovery

Posted by Alberto Dominguez on 22 abril 2014 - 11:34

http://blogs.technet...-discovery.aspx




#1384 Backup con Windows Server Backup

Posted by Alberto Dominguez on 07 abril 2014 - 19:55

Para realizar un backup del systemstate:

wbadmin start systemstatebackup -backupTarget:\\Servidor\BACKUPs\DCSP100

Para obtener las versiones que hay en un backup:

wbadmin get versions -backupTarget:\\Servidor\BACKUPs\DCSP100



#1377 Script Powershell para Unificar Lineas de varios Archivos de una Carpeta

Posted by Alberto Dominguez on 17 marzo 2014 - 15:17

$directorio="C:\temp\"
$cadenaBuscada="TextoBuscado"
$ficheroSalida=$directorio+"resultado.txt"

function procesaLinea($linea,$cadenaBuscada){
   
   $aux=$linea.SubString($linea.IndexOf($cadenaBuscada)+$cadenaBuscada.Length,$linea.LastIndexOf(":")-$linea.IndexOf($cadenaBuscada)-$cadenaBuscada.Length)
   return $aux 
}


$resultado=@()
foreach( $fichero in Get-ChildItem $directorio )
{
    $lineasArchivo=@()
    $dataFile = Get-Content $fichero.FullName
    write-host ('Numero de Objetos de Referencia: '+$dataFile.count)
    foreach ($linea in $dataFile)
    {
       if ($linea.contains($cadenaBuscada))
       {

         $aux = procesaLinea $linea $cadenaBuscada
         if ($lineasArchivo -NotContains $aux )
         {
             $lineasArchivo += $aux
             $aux2=$aux+";"+$fichero
             $resultado += $aux2
             write-host ($aux2)
         }
       }
    }
    
}

$resultado | Out-file $ficheroSalida



#1375 Convertir Certificado .pfx a .pem

Posted by Alberto Dominguez on 14 marzo 2014 - 13:53

Se puede realizar esta conversión desde windows con esta utilidad:

 

http://slproweb.com/...n32OpenSSL.html

 

 

Mediante el siguiente comando:

 

 

.pem con Key Privada Incluida:

openssl pkcs12 -in Certificado01.pfx -out Certificado01.pem 

.pem con Key Privada NO Incluida:

openssl pkcs12 -in Certificado01.pfx -out Certificado01.pem -nokeys



#1374 Obtener Listado de Actualizaciones

Posted by Alberto Dominguez on 10 marzo 2014 - 19:08

Dejo link:

 

http://lyncdup.com/2...icrosoftupdate/

# Gives a list of all Microsoft Updates sorted by KB number/HotfixID
# By Tom Arbuthnot. Lyncdup.com
 
$wu = new-object -com “Microsoft.Update.Searcher”
 
$totalupdates = $wu.GetTotalHistoryCount()
 
$all = $wu.QueryHistory(0,$totalupdates)
 
# Define a new array to gather output
 $OutputCollection=  @()
             
Foreach ($update in $all)
    {
    $string = $update.title
 
    $Regex = “KB\d*”
    $KB = $string | Select-String -Pattern $regex | Select-Object { $_.Matches }
 
     $output = New-Object -TypeName PSobject
     $output | add-member NoteProperty “HotFixID” -value $KB.‘ $_.Matches ‘.Value
     $output | add-member NoteProperty “Title” -value $string
     $OutputCollection += $output
 
    }
 
# Oupput the collection sorted and formatted:
$OutputCollection | Sort-Object HotFixID | Format-Table -AutoSize
Write-Host “$($OutputCollection.Count) Updates Found”
 
# If you want to output the collection as an object, just remove the two lines above and replace them with “$OutputCollection”
 
# credit/thanks:
# http://blogs.technet.com/b/tmintner/archive/2006/07/07/440729.aspx
# http://www.gfi.com/blog/windows-powershell-extracting-strings-using-regular-expressions/



#1366 Consultar la GAL con Powershell

Posted by Alberto Dominguez on 13 diciembre 2013 - 13:21

$filter = (Get-GlobalAddressList 'Default Global Address List').RecipientFilter

Get-Recipient -RecipientPreviewFilter $filter | Where-Object {$_.name -like '*Perico*'}



#1343 Aprende a utilizar Linkedin desde cero

Posted by Alberto Dominguez on 22 agosto 2013 - 20:47

Dejo link a curso de floqq:

 

Aprende a utilizar Linkedin desde cero

 

 

 




#1327 Recuperacion Passwords

Posted by Alberto Dominguez on 11 junio 2013 - 12:53

Hay un kit de utilidades en .iso que entre otras cosas sirve para recuperar password perdidos:

ERD Commander.iso


#1312 Tests de Rendimiento Web - Total Time vs Request Time

Posted by Alberto Dominguez on 26 abril 2013 - 08:53

Dejo link donde explica las diferencias:

http://msdn.microsof...y/dd997556.aspx