# Fichero para crear usuarios en AD (Mis_Usuarios2.csv)
```
cn,sAMAccountname,FirstName,LastName,Password,Curso
asir1jesus1,asir1jesus1,asir1jesus1,asir1jesus1,retamar,asir1
```
# Crear un usuario en AD
```PowerShell
Import-Module ActiveDirectory
Import-Csv C:\Users\administrador.RETARED\Desktop\Crearusuarios\Mis_Usuarios2.csv |%{
$nombreco=$_.FirstName + " " + $_.LastName
$ru="OU=" + $_.Curso + ",OU=FP,OU=Alumnos,OU=Usuarios,DC=reta,DC=local"
$HomeDirectory="\\retamas\alumnos\fp\" + $_.Curso + "\" + $_.sAMAccountname
mkdir $HomeDirectory
$HomeDirectory
$HomeDrive=’Q:’
New-ADUser -Name $_.FirstName -SamAccountName $_.sAMAccountname -HomeDrive $HomeDrive –HomeDirectory $HomeDirectory -DisplayName $nombreco -Enabled $true -ChangePasswordAtLogon $false -AccountPassword (ConvertTo-SecureString $_.Password -AsPlainText -force) -PassThru -UserPrincipalName $_.sAMAccountname -Path $ru
$usereta="reta\" + $_.sAMAccountname + ":F"
$HomeDirectory + "-" + $usereta
cacls $HomeDirectory /G $usereta /E
Add-ADGroupMember -Identity "CN=alumnitos,CN=Builtin,DC=reta,DC=local" $_.sAMAccountname
}
```

---------------------

# Differences between /dev/sda and /dev/sda1
https://serverfault.com/questions/338937/differences-between-dev-sda-and-dev-sda1

# VHD Windows
This example creates a new 127GB VHD and then mounts, initializes, and formats it so the drive is ready to use.
```PowerShell
$vhdpath = "C:\VHDs\Test.vhdx"
$vhdsize = 127GB
New-VHD -Path $vhdpath -Dynamic -SizeBytes $vhdsize | Mount-VHD -Passthru |Initialize-Disk -Passthru |New-Partition -AssignDriveLetter -UseMaximumSize |Format-Volume -FileSystem NTFS -Confirm:$false -Force
```

# Virtual hard disk
- Boot to a virtual hard disk: Add a VHDX or VHD to the boot menu https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/boot-to-vhd--native-boot--add-a-virtual-hard-disk-to-the-boot-menu

# LVM (Logical Volume Management)
- LVM (Ubuntu wiki) https://wiki.ubuntu.com/Lvm
