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
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
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.
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
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
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
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")
Posted by Alberto Dominguez on 22 abril 2014 - 11:34
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
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
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
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/
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*'}
Posted by Alberto Dominguez on 22 agosto 2013 - 20:47
Posted by Alberto Dominguez on 11 junio 2013 - 12:53
Posted by Alberto Dominguez on 26 abril 2013 - 08:53