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
################################# | |
## Raúl Unzué - El Blog de Negu | |
## Script buscar Setting GPO | |
################################# | |
## NOMBRE DE LA SETTING | |
$Setting = "Enable search roaming" | |
## NOMBRE DEL DOMINIO | |
$Dominio = "negu.local" | |
## NOMBRE DEL CONTROLADOR |
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
########################################### | |
## Raúl Unzué - El Blog de Negu | |
## https://www.maquinasvirtuales.eu/ | |
## Reporte HTML de Ordenadores / Servidores | |
########################################### | |
#Definimos los códigos de estilos CSS | |
$header = @" | |
<style> | |
h1 { |
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
# PASAMOS CREDENCIALES EN BASE64 - USUARIO | |
$Usuario = 'ZQBsAGIAbABvAGcAZABlAG4AZQBnAHUA'; | |
$otroUsuario = [System.Text.Encoding]::Unicode.GetString([System.Convert]::FromBase64String($Usuario)) | |
# PASAMOS CREDENCIALES EN BASE64 - CONTRASEÑA | |
$Pw = 'ZQBsAGIAbABvAGcAZABlAG4AZQBnAHUA' | |
$otroUsuarioClave = [System.Text.Encoding]::Unicode.GetString([System.Convert]::FromBase64String($Pw)) | |
# NOMBRE DE SERVER | |
$hostname = c:\windows\system32\hostname.exe | |
# CONEXION CON CREDENCIALES ELEVADAS | |
$otroUsuarioClaveSS = $otroUsuarioClave | ConvertTo-SecureString -Force -AsPlainText |
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
# Script Raul Unzue - El Blog de Negu | |
# Revisa que al usuario le faltan menos de 7 días para caducar licencia outlook | |
# Le manda un correo para que introduzca sus datos para activarla nuevamente | |
#################### | |
# SABER EL USUARIO | |
#################### | |
$usuario=C:\windows\system32\whoami.exe | |
#################### | |
# ELIMINAR DOMINIO |
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
###################### | |
# FUNCION SABER LINEA | |
###################### | |
function linea | |
{ | |
$input | Select-String '.' | Select-Object -Property LineNumber, Line | |
} | |
############################### | |
# LISTAR DISCOS Y TAMAÑOS VHDX | |
############################### |
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
###################### | |
# FUNCION SABER LINEA | |
###################### | |
function linea | |
{ | |
$input | Select-String '.' | Select-Object -Property LineNumber, Line | |
} | |
############################### | |
# LISTAR DISCOS Y TAMAÑOS VHDX | |
############################### |
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
###################################### | |
# SCRIPT EL BLOG DE NEGU - RAUL UNZUE | |
##################################### | |
# Pasamos la ruta a nuestro PATH | |
$env:Path = $env:Path + ';C:\Program Files (x86)\Citrix\Licensing\LS\' | |
# Obtener licencias | |
$FilePath = "C:\Scripts\Citrix_Licence_Used.txt" | |
#$Exe = "C:\Program Files (x86)\Citrix\Licensing\LS" | |
#cd $Exe |
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
$emailSmtpServer = "smtp.elblogdenegu.com" | |
$emailSmtpServerPort = "587" | |
$emailSmtpUser = "maquinasvirtuales@elblogdenegu.com" | |
$emailSmtpPass = "xxxxxx" | |
$emailFrom = "maquinasvirtuales@elblogdenegu.com" | |
$emailTo = "prueba01@maquinasvirtuales.eu" | |
$emailcc="prueba02@maquinasvirtuales.eu" | |
$emailMessage = New-Object System.Net.Mail.MailMessage($emailFrom , $emailTo ) | |
$emailMessage.cc.add($emailcc) | |
$emailMessage.Subject = "TEST" |
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
# Configuramos Variables | |
$Total = 0 | |
$Usadas = 0 | |
$PorcentajeUso = 0 | |
$ReturnString = 0 | |
$ReturnValor = 0 | |
# Obtendremos los datos mediante WMI | |
$licensePool = gwmi -class "Citrix_GT_License_Pool" -Namespace "ROOT\CitrixLicensing" -comp SRVLICENCIAS |
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
########################################### | |
######### RAUL UNZUE - ELBLOGDENEGU ####### | |
########################################### | |
#Script limpiar users para Citrix FSLOGIX # | |
########################################### | |
# EMPEZAMOS LOG: | |
Start-Transcript ("c:\scripts\logs\OWNER-ScriptLog{0:yyyyMMdd-HHmm}.txt" -f (Get-Date)) | |
# CARPETA PERFILES |