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
# Define your info into variables | |
$hostpoolName = "General" | |
$resourceGroup = "AVD-RG" | |
$hostpool = Get-AzWvdHostPool | Where-Object { $_.Name -eq $hostpoolName } | |
$sessionHosts = Get-AzWvdSessionHost -ResourceGroupName $resourceGroup -HostPoolName $hostpool.name | |
$existingHostName = $sessionHosts[-1].Id.Split("/")[-1] | |
$adDomain = $sessionHosts[-1].Id.Split("/")[-1].split(".", 2)[1] | |
$currentVmInfo = Get-AzVM -Name $existingHostName.Split(".")[0] | |
$imageReference = ($currentVmInfo.storageprofile.ImageReference).id |
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
{ | |
"final_space": true, | |
"console_title": true, | |
"console_title_style": "folder", | |
"blocks": [ | |
{ | |
"type": "prompt", | |
"alignment": "left", | |
"horizontal_offset": 0, | |
"vertical_offset": 0, |
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
#Cargo los Assemblies (necesario para definir el form) | |
[void][reflection.assembly]::loadwithpartialname("System.Windows.Forms") | |
[void][reflection.assembly]::loadwithpartialname("System.Drawing") | |
#Creo el objeto Form | |
$Form = New-Object System.Windows.Forms.Form | |
#Defino el tamaño del formulario | |
$Form.Size = New-Object Drawing.Size(400,200) | |
#Defino la posición inicial | |
$Form.StartPosition = "CenterScreen" | |
#Defino el titulo del formulario |
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
--- | |
layout: null | |
permalink: /entries.json | |
sitemap: false | |
--- | |
{ | |
"title": "{{ site.title}}", | |
"url": "{{ site.url }}", | |
"posts": [ |
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
$files = Get-Content C:\users\vmsil\Desktop\Files.txt | |
[System.Collections.ArrayList]$hashDB = @() | |
foreach ($file in $files) { | |
$hash = (Get-FileHash -Path $file -Algorithm MD5).Hash | |
$elemento = New-Object PSObject | |
$elemento | Add-Member -type NoteProperty -Name 'Hash' -Value $hash | |
$elemento | Add-Member -type NoteProperty -Name 'FilePath' -Value $file | |
$hashDB.Add($elemento) | Out-Null | |
} |
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 Hyper-V | |
$ExchangeServer = "afasrv09.afinidad.interno" | |
$VmReplication = Get-VMReplication -ComputerName afahv1,afahv2,surasrvhv01,surasrvhv02 ` | |
| Select-Object @{Name="Maquinas Virtuales";Expression={($_.Name)}}, | |
@{Name="Estado de la replica";Expression={($_.State)}}, | |
@{Name="Estado";Expression={($_.Health)}}, | |
@{Name="Host";Expression={($_.PrimaryServer)}} | ConvertTo-HTML -fragment | |
$Body = @" | |
<!doctype html> | |
<html lang="es"> |
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
#region Virtual Network | |
## Creamos la subred: | |
$subnetConfig = New-AzureRmVirtualNetworkSubnetConfig -Name SubnetTest -AddressPrefix 192.168.1.0/24 | |
## Creamos la red virtual con la subred y el resource group anterior: | |
$vnet = New-AzureRmVirtualNetwork -ResourceGroupName ResourceGroupTest ` | |
-Location "South Central US" ` | |
-Name VnetTest ` | |
-AddressPrefix 192.168.0.0/16 ` |
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 to use when reinstall Windows (personal) ### | |
##### Version history: | |
# 0.1 - 23/03/2017 - Add Chocolatey and basic software | |
# 0.2 - 17/10/2017 - Add new software | |
# 0.3 - 13/04/2018 - Remove visio and spotify | |
##### | |
If (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole(` | |
[Security.Principal.WindowsBuiltInRole] “Administrator”)) { | |
Write-Host “You do not have Administrator rights to run this script!`nPlease re-run this script as an Administrator!” |
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
#URL y nombre del servidor | |
$PsPath = 'MACHINE/WEBROOT/APPHOST' | |
$URL = "sip.dominio.com" | |
$Server = "PoolSfB.dominio.local" | |
#Farm nuevo (usando el nombre de la URL) | |
Add-WebConfigurationProperty -pspath $PsPath -filter "webFarms" -name "." -value @{name="$($URL)"} | |
Add-WebConfigurationProperty -pspath $PsPath -filter "webFarms/webFarm[@name='$($URL)']" -name "." -value @{address="$($Server)"} | |
#Puertos | |
Set-WebConfigurationProperty -pspath $PsPath -filter "webFarms/webFarm[@name='$($URL)']/server[@address='$($Server)']/applicationRequestRouting" -name "httpPort" -value 8081 | |
Set-WebConfigurationProperty -pspath $PsPath -filter "webFarms/webFarm[@name='$($URL)']/server[@address='$($Server)']/applicationRequestRouting" -name "httpsPort" -value 8443 |
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
#URL y nombre del servidor | |
$PsPath = 'MACHINE/WEBROOT/APPHOST' | |
$URL = "office.dominio.com" | |
$Server = "OWA.dominio.local" | |
#Farm nuevo (usando el nombre de la URL) | |
Add-WebConfigurationProperty -pspath $PsPath -filter "webFarms" -name "." -value @{name="$($URL)"} | |
Add-WebConfigurationProperty -pspath $PsPath -filter "webFarms/webFarm[@name='$($URL)']" -name "." -value @{address="$($Server)"} | |
#Cache | |
Set-WebConfigurationProperty -pspath $PsPath -filter "webFarms/webFarm[@name='$($URL)']/applicationRequestRouting/protocol/cache" -name "enabled" -value "False" | |
#Timeout |
NewerOlder