This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function show-progressbar([int]$actual,[int]$completo,[string]$status,[string]$Activity) | |
{ | |
$porcentaje=($actual/$completo)*100 | |
if (!$status){ | |
$status="Buscando datos $actual de $completo" | |
} | |
if (!$Activity){ | |
$Activity="Obteniendo Resultados" | |
} | |
Write-Progress -Activity $Activity -status $status -percentComplete $porcentaje |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Agregar el modulo de Active Directory. | |
import-module activedirectory | |
$Final=@() | |
## Apunta a la ruta donde esta el archivo | |
$ruta="c:\datos" | |
## Apunta al archivo | |
$archivo="lista de usuarios.txt" | |
## Obtiene una lista de todos los usuarios que esten habiliados. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import-module activedirectory | |
$ruta=get-location | |
$prueba=@() | |
$completo=0 | |
## la subred que se quiere buscar | |
$mascara="172.16.*" | |
cd "AD:\" | |
$equipos= Get-ADComputer -Filter {OperatingSystem -like "*server*"} -Properties ipv4address, CanonicalName, operatingsystem | Where-Object {$_.ipv4address -like $mascara} | |
$total=$equipos.count |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ips=(Get-ReceiveConnector "SERVIDORBASE\RC-A-COPIAR").remoteipranges |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
New-ReceiveConnector -Server SERVIDORTARGET -name "Relay SERVIDORTARGET" -Usage custom -AuthMechanism externalauthoritative -PermissionGroups ExchangeServers -Bindings 0.0.0.0:25 -TransportRole FrontEndTransport -RemoteIPRanges $ips |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-ReceiveConnector | where {$_.name -like "*relay*"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-ReceiveConnector | where {$_.name -like "relay*"} | Set-ReceiveConnector -RemoteIPRanges $ips |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-ReceiveConnector | where {$_.name -like "relay*"} | select name, @{Expression={$_.remoteipranges.count};Label="cantidad"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function show-progressbar([int]$actual,[int]$completo,[string]$status,[string]$Activity) | |
{ | |
$porcentaje=($actual/$completo)*100 | |
# Si no le pasamos un parametro $Status, pone uno generico | |
if (!$status){ | |
$status="Buscando datos $actual de $completo" | |
} | |
# Si no le pasamos un parametro $Activity, pone uno generico | |
if (!$Activity){ | |
$Activity="Obteniendo Resultados" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
echo Este ejecutable te devuelve todo lo que tenias en el pendrive. | |
echo Acordate de borrar todos los accesos directos y los .EXE que estan aca. | |
attrib /d /s -r -h -s *.* | |
echo. | |
echo. | |
echo Listo! | |
echo. | |
echo. | |
echo. |
OlderNewer