Ce script créé par mes soins permet d'automatiser la création de machines virtuelles sur le vCenter à l'aide d'un fichier XML qui contient l’ensemble de la configuration des VMs à déployer.
Fonctionnalités :
- Créer des VMs (informations stockées dans un fichier XML) en masse sur le vCenter
- Création d'un fichier de logs horodatés (Create-VM)
Prérequis :
- Afin de pouvoir exécuter le script, il faut avoir les droits suivants :
- Admins du domaine (Pour pouvoir intégrer les VMs au domaine et pour la création des groupes AD : ADM et TSE)
- Admin de la plateforme VMware (Pour pouvoir créer des VMs et les modifier)
- Il faut également installer les outils suivants :
- Module Active Directory pour Windows PowerShell (Présent dans les [RSAT] : Outils d’administration de serveur distant pour Windows 7 et Windows 10)
- VMware PowerCLI
Utilisation :
- Compléter les variables suivantes dans le script :
- $TargetOU = "OU=AdministrationGroups,DC=test,DC=local" (Chemin de l'OU pour la création des groupes AD)
- $Connection = Connect-VIServer -Server vCenterServerName (Définir le nom de votre vCenter)
- $OSCustSpec = New-OSCustomizationSpec -Name $VMName -NamingScheme Fixed -NamingPrefix $VMName -OSType Windows -FullName Name -OrgName "OrgName" -ChangeSid -Domain "DomainName" -DomainUsername $Login -DomainPassword $Password -AdminPassword $AdminPassword -TimeZone 105 (Définir le nom complet, le nom de l'organisation et votre domaine AD)
Exemple du fichier VM-Configuration.xml
avec les informations de configuration des VMs :
<CreateVM>
<VM>
<VMName>VMName</VMName>
<Template>TemplateName</Template>
<Datacenter>DCName</Datacenter>
<Cluster>ClusterName</Cluster>
<ESX>ESXName</ESX>
<Datastore>DatastoreName</Datastore>
<Drive>40</Drive>
<Drive2>20</Drive2>
<Drive3>4</Drive3>
<CPU>2</CPU>
<MemoryGB>4</MemoryGB>
<VLAN>VLANName</VLAN>
<IP>192.XXX.XXX.XXX</IP>
<Mask>255.255.255.0</Mask>
<Gateway>192.XXX.XXX.XXX</Gateway>
<DNS>8.8.8.8 8.8.4.4</DNS>
<Description>Server Description</Description>
</VM>
</CreateVM>
Screenshot :
Code du script :
<#
.SYNOPSIS
VMs creation.
.DESCRIPTION
Create multiple VMs on the vCenter.
.NOTES
File name : Create-VM.ps1
Author : Pierre JACQUOT
Date : 20/06/2017
Version : 1.0
.LINK
Website : https://www.pierrejacquot.yo.fr
Reference : https://www.pierrejacquot.yo.fr/index.php/scripts/42-script-create-vm
#>
Clear-Host
## Log files creation ##
Function Write-Log([string]$Output, [string]$Message) {
Write-Verbose $Message
((Get-Date -UFormat "[%d-%m-%Y %H:%M:%S] ") + $Message) | Out-File -FilePath $Output -Append -Force
}
## List of variables ##
$StartTime = Get-Date
$Hostname = [Environment]::MachineName
$FullLogin = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name
$Login = [Environment]::UserName
$Workfolder = Split-Path $script:MyInvocation.MyCommand.Path
$Date = Get-Date -UFormat "%Y-%m-%d"
$LogFile = $Workfolder + "\Logs\$Date-Create-VMs.log"
$TargetOU = "Path of your OU. Example : OU=Servers,DC=test,DC=local"
## Collect information from XML ##
$xml = [xml](Get-Content -Path ".\XML\VM-Configuration.xml")
$Node = $xml.selectnodes("//CreateVM/VM")
$VMNumber = $Node.Count
## Title of the script ##
Write-Host "############################################################################"
Write-Host "# Script : Create-VM | Version : 1.0 | Date : $Date #"
Write-Host "############################################################################"
Write-Host "`r"
## Importing Active Directory module for Windows PowerShell ##
$Module = Get-Module -List ActiveDirectory
Import-Module ActiveDirectory -ErrorAction SilentlyContinue
If (!$Module) {
Write-Host "[ERROR] Unable to locate Active Directory module for Windows PowerShell" -ForegroundColor Red
Write-Log -Output $LogFile -Message "[ERROR] Unable to locate Active Directory module for Windows PowerShell"
Exit
}
Write-Host "Launching the creation of [$VMNumber] Virtual Machine(s)." -ForegroundColor Cyan
Write-Log -Output $LogFile -Message "Launching the creation of $VMNumber Virtual Machine(s)"
Write-Host "`r"
## Connect to the vCenter ##
Try {
Write-Host "Trying to connect on VMware Server..."
Write-Host "`r"
Write-Log -Output $LogFile -Message "Trying to connect on VMware Server..."
$Connection = Connect-VIServer -Server vCenterServerName
}
Catch {
Write-Host "[ERROR] Unable to connect on VMware Server" -ForegroundColor Red
Write-Log -Output $LogFile -Message "[ERROR] Unable to connect on VMware Server"
Write-Host "`r"
"`r" | Out-File -FilePath $LogFile -Append -Force
Exit
}
Write-Host "Connected on the vCenter [$Connection] :" -ForegroundColor Green
Write-Host "- From [$Hostname]" -ForegroundColor Green
Write-Host "- With [$FullLogin]" -ForegroundColor Green
Write-Host "`r"
Write-Log -Output $LogFile -Message "Connected on the vCenter $Connection :"
Write-Log -Output $LogFile -Message "- From : $Hostname"
Write-Log -Output $LogFile -Message "- With : $FullLogin"
## Ask your password to add the VM(s) in Active Directory ##
Write-Log -Output $LogFile -Message "Ask your admin password to add the VM(s) in Active Directory"
Write-Host "- Set your admin password to add the VM(s) in Active Directory :" -ForegroundColor Cyan
Write-Host "`r"
Do {
$Pass = Read-Host "- Set your admin password [$FullLogin] " -AsSecureString
$Password = [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($Pass))
If ($Password -eq "") {
Write-Host " Password is mandatory !" -ForegroundColor Red
Write-Host "`r"
}
} Until ($Password -ne "")
Write-Host "`r"
## Process the XML file ##
ForEach ($vm in $xml.CreateVM.VM) {
$VMName = $vm.VMName
$Template = $vm.Template
$Datacenter = $vm.Datacenter
$Cluster = $vm.Cluster
$ESX = $vm.ESX
$Datastore = $vm.Datastore
$Drive = $vm.Drive
$Drive2 = $vm.Drive2
$Drive3 = $vm.Drive3
$DiskStorageFormat = "Thick"
$CPU = $vm.CPU
$Memory = $vm.MemoryGB
$VLAN = $vm.VLAN
$IP = $vm.IP
$Mask = $vm.Mask
$Gateway = $vm.Gateway
$DNS = $($vm.DNS).split(" ")
$Description = $vm.Description
$TSEADGroup = "GRP_"+$VMName+"_TSE"
$ADMADGroup = "GRP_"+$VMName+"_ADM"
$TSEADGroupDescription = "Groupe des utilisateurs ayant des droits d'accès à distance sur $VMName"
$ADMADGroupDescription = "Groupe des administrateurs locaux de $VMName"
Try {
## Collect information of the XML file ##
Write-Log -Output $LogFile -Message "Creation of the log file :"
Write-Log -Output $LogFile -Message "- Path : $Workfolder\Logs"
Write-Log -Output $LogFile -Message "- File name : $Date-Create-VMs.log"
Write-Log -Output $LogFile -Message "Configuration of the XML file :"
Write-Log -Output $LogFile -Message "#############################################"
Write-Log -Output $LogFile -Message "- Hostname : $VMName"
Write-Log -Output $LogFile -Message "- Template : $Template"
Write-Log -Output $LogFile -Message "- Datacenter : $Datacenter"
Write-Log -Output $LogFile -Message "- Cluster : $Cluster"
Write-Log -Output $LogFile -Message "- ESX : $ESX"
Write-Log -Output $LogFile -Message "- Datastore : $Datastore"
Write-Log -Output $LogFile -Message "- Drive (GB) : $Drive"
Write-Log -Output $LogFile -Message "- Drive2 (GB) : $Drive2"
Write-Log -Output $LogFile -Message "- Drive3 (GB) : $Drive3"
Write-Log -Output $LogFile -Message "- CPU : $CPU"
Write-Log -Output $LogFile -Message "- Memory (GB) : $Memory"
Write-Log -Output $LogFile -Message "- VLAN : $VLAN"
Write-Log -Output $LogFile -Message "- IP : $IP"
Write-Log -Output $LogFile -Message "- Mask : $Mask"
Write-Log -Output $LogFile -Message "- Gateway : $Gateway"
Write-Log -Output $LogFile -Message "- DNS : $DNS"
Write-Log -Output $LogFile -Message "- VM Description : $Description"
Write-Log -Output $LogFile -Message "#############################################"
Write-Host "- Creation of the VM [$VMName] started :" -ForegroundColor Green
Write-Log -Output $LogFile -Message "Creation of the VM $VMName started :"
## Collect information of the datastore ##
$Datastores = Get-Datastore $Datastore
$Spacefree = [Math]::round($Datastores[0].FreeSpaceMB / 1024)
$DatastoreName = $Datastores[0].Name
Write-Host " Datastore [$DatastoreName] selected -> [$Spacefree GB] free space" -ForegroundColor Cyan
Write-Log -Output $LogFile -Message "- Datastore $DatastoreName selected -> $Spacefree (GB) free space"
$TotalDriveNeeded = ([int]$Drive + [int]$Drive2 + [int]$Drive3)
Write-Host " Space needed for the VM creation : [$TotalDriveNeeded GB]" -ForegroundColor Cyan
Write-Log -Output $LogFile -Message "- Space needed for the VM creation : $TotalDriveNeeded (GB)"
If ($TotalDriveNeeded -ge $Spacefree) {
Write-Host " Not enough space on [$Datastore]. Please free up some space or create another Datastore !" -ForegroundColor Red
Write-Log -Output $LogFile -Message "- [ERROR] Not enough space on $DatastoreName datastore !"
"`r" | Out-File -FilePath $LogFile -Append -Force
Write-Host "`r"
Exit
}
## Ask the local admin password of the VM ##
Write-Log -Output $LogFile -Message "- Ask the local admin password on $VMName"
Write-Host " Set the local admin password on [$VMName]" -ForegroundColor Cyan
Write-Host "`r"
Do {
$AdminPass = Read-Host "- Set the local admin password on [$VMName] " -AsSecureString
$AdminPassword = [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($AdminPass))
If ($AdminPassword -eq "") {
Write-Host " Password is mandatory !" -ForegroundColor Red
Write-Host "`r"
}
} Until ($AdminPassword -ne "")
Write-Host "`r"
## Select the right template ##
$Template = Get-Template -Location $Datacenter | ? { $_.Name -like $Template }
Write-Host " Using [$Template] template" -ForegroundColor Cyan
Write-Log -Output $LogFile -Message "- Using $Template template"
## Cloning the template ##
$ResourcePool = Get-Cluster -Location $Datacenter -Name $Cluster
Try {
Write-Host " Cloning [$Template] template" -ForegroundColor Green
New-VM -VMHost $ESX -Name $VMName -Template $Template -Datastore $Datastore -ResourcePool $ResourcePool -Description $Description -ErrorAction Stop | Out-Null
Write-Log -Output $LogFile -Message "- Cloning $Template template"
}
Catch {
$ErrorMessage = $_.Exception.Message
Write-Host " [ERROR] Unable to clone [$Template] : $ErrorMessage" -ForegroundColor Red
Write-Log -Output $LogFile -Message "- [ERROR] Unable to clone $Template : $ErrorMessage"
"`r" | Out-File -FilePath $LogFile -Append -Force
Continue
}
## Setting the VM (Hostname, CPU, RAM) ##
Try {
Write-Host " Setting Hostname, CPU and RAM on [$VMName]" -ForegroundColor Green
Set-VM -VM $VMName -Name $VMName -NumCpu $CPU -MemoryGB $Memory -Confirm:$false -ErrorAction Stop | Out-Null
Write-Log -Output $LogFile -Message "- Setting Hostname, CPU and RAM on $VMName"
}
Catch {
$ErrorMessage = $_.Exception.Message
Write-Host " [ERROR] Unable to configure [$VMName] : $ErrorMessage" -ForegroundColor Red
Write-Log -Output $LogFile -Message "- [ERROR] Unable to configure $VMName : $ErrorMessage"
"`r" | Out-File -FilePath $LogFile -Append -Force
Continue
}
## Setting up disk(s) space ##
$vmToChange = Get-VM -Name $VMName
If ($Drive -gt 40) {
Try {
Get-HardDisk -VM $vmToChange | ? {$_.CapacityGB -like "40"} | Set-HardDisk -CapacityGB $Drive -Confirm:$false -ErrorAction Stop | Out-Null
Write-Host " Extend done on the first virtual disk. Please extend the disk in Windows !" -ForegroundColor Yellow
Write-Log -Output $LogFile -Message "- Setting first virtual disk size to $Drive (GB)"
}
Catch {
$ErrorMessage = $_.Exception.Message
Write-Host " [ERROR] Unable to resize the first virtual disk on [$VMName] : $ErrorMessage" -ForegroundColor Red
Write-Log -Output $LogFile -Message "- [ERROR] Unable to resize the first virtual disk on $VMName : $ErrorMessage"
"`r" | Out-File -FilePath $LogFile -Append -Force
Continue
}
}
If ($Drive2 -gt 10) {
Try {
Get-HardDisk -VM $vmToChange | ? {$_.CapacityGB -like "10"} | Set-HardDisk -CapacityGB $Drive2 -Confirm:$false -ErrorAction Stop | Out-Null
Write-Host " Extend done on the second virtual disk. Please extend the disk in Windows !" -ForegroundColor Yellow
Write-Log -Output $LogFile -Message "- Setting second virtual disk size to $Drive2 (GB)"
}
Catch {
$ErrorMessage = $_.Exception.Message
Write-Host " [ERROR] Unable to resize the second virtual disk on [$VMName] : $ErrorMessage" -ForegroundColor Red
Write-Log -Output $LogFile -Message "- [ERROR] Unable to resize the second virtual disk on $VMName : $ErrorMessage"
"`r" | Out-File -FilePath $LogFile -Append -Force
Continue
}
}
## Add a third virtual disk ##
If ($Drive3 -gt 0) {
Try {
$vmToChange | New-HardDisk -CapacityGB $Drive3 -StorageFormat $DiskStorageFormat -Confirm:$false -ErrorAction Stop | Out-Null
Write-Host " Third virtual disk with [$Drive3 GB] added. Please initialize the disk in Windows !" -ForegroundColor Yellow
Write-Log -Output $LogFile -Message "- Third virtual disk with $Drive3 (GB) added. Please initialize the disk in Windows !"
}
Catch {
$ErrorMessage = $_.Exception.Message
Write-Host " [ERROR] Unable to add the third virtual disk on [$VMname] : $ErrorMessage" -ForegroundColor Red
Write-Log -Output $LogFile -Message "- [ERROR] Unable to add the third virtual disk on $VMname : $ErrorMessage"
"`r" | Out-File -FilePath $LogFile -Append -Force
Continue
}
}
## Setting the VM (VLAN) ##
Try {
Write-Host " Setting the VM [$VMName] on VLAN [$VLAN]" -ForegroundColor Green
Get-VM -Name $VMName | Get-NetworkAdapter | Set-NetworkAdapter -Type "Vmxnet3" -NetworkName $VLAN -StartConnected:$true -Confirm:$false –ErrorAction Stop | Out-Null
Write-Log -Output $LogFile -Message "- Setting the VM $VMName on VLAN $VLAN"
}
Catch {
$ErrorMessage = $_.Exception.Message
Write-Host " [ERROR] Unable to set network card : $ErrorMessage" -ForegroundColor Red
Write-Log -Output $LogFile -Message "- [ERROR] Unable to set network card : $ErrorMessage"
"`r" | Out-File -FilePath $LogFile -Append -Force
Continue
}
## Customizing VM ##
Try {
$OSCustSpec = New-OSCustomizationSpec -Name $VMName -NamingScheme Fixed -NamingPrefix $VMName -OSType Windows -FullName Name -OrgName "OrgName" -ChangeSid -Domain "DomainName" -DomainUsername $Login -DomainPassword $Password -AdminPassword $AdminPassword -TimeZone 105
Write-Host " Applying customization on [$VMName]" -ForegroundColor Green
$OSCustSpec | Get-OSCustomizationNicMapping | Set-OSCustomizationNicMapping -IpMode UseStaticIp -IpAddress $IP -SubnetMask $Mask -DefaultGateway $Gateway -DNS $DNS | Out-null
Set-VM -VM $VMName -OSCustomizationSpec $OSCustSpec -Confirm:$false | Out-Null
Get-OSCustomizationSpec -Name $VMName | Remove-OSCustomizationSpec -Confirm:$false | Out-null
Write-Log -Output $LogFile -Message "- Applying customization on $VMName"
}
Catch {
$ErrorMessage = $_.Exception.Message
Write-Host " [ERROR] Unable to apply customization on [$VMName] : $ErrorMessage" -ForegroundColor Red
Write-Log -Output $LogFile -Message "- [ERROR] Unable to apply customization on $VMName : $ErrorMessage"
"`r" | Out-File -FilePath $LogFile -Append -Force
Continue
}
## Power ON the VM ##
Try {
Write-Host "`r"
Write-Host "- Power ON the VM [$VMName]" -ForegroundColor Green
Start-VM -VM $VMname –ErrorAction Stop | Out-Null
Write-Log -Output $LogFile -Message "Power ON the VM $VMName"
Write-Host "`r"
Write-Host "After starting, the VM will be restarted several times in order to finalize customization. Please don't touch the VM until everything is done." -ForegroundColor Red -BackgroundColor Yellow
}
Catch {
$ErrorMessage = $_.Exception.Message
Write-Host "- [ERROR] Unable to start the VM [$VMName] : $ErrorMessage" -ForegroundColor Red
Write-Log -Output $LogFile -Message "- [ERROR] Unable to start the VM $VMName : $ErrorMessage"
"`r" | Out-File -FilePath $LogFile -Append -Force
Continue
}
## Creation of AD groups (TSE, ADM) ##
Write-Host "`r"
Write-Host "- Creation of AD groups started :" -ForegroundColor Green
Write-Log -Output $LogFile -Message "Creation of AD groups :"
## AD group creation (TSE) ##
Try {
New-ADGroup -Name $TSEADGroup -GroupScope Global -Description $TSEADGroupDescription -Path $TargetOU
Write-Host " AD group [$TSEADGroup] created" -ForegroundColor Green
Write-Log -Output $LogFile -Message "- AD group $TSEADGroup created - Groupe des utilisateurs ayant des droits d'accès à distance sur $VMName"
}
Catch {
$ErrorMessage = $_.Exception.Message
Write-Host " [ERROR] Unable to create the group $TSEADGroup on AD : $ErrorMessage" -ForegroundColor Red
Write-Log -Output $LogFile -Message "- [ERROR] Unable to create the group $TSEADGroup on AD : $ErrorMessage"
"`r" | Out-File -FilePath $LogFile -Append -Force
}
## AD group creation (ADM) ##
Try {
New-ADGroup -Name $ADMADGroup -GroupScope Global -Description $ADMADGroupDescription -Path $TargetOU
Write-Host " AD group [$ADMADGroup] created" -ForegroundColor Green
Write-Log -Output $LogFile -Message "- AD group $ADMADGroup created - Groupe des administrateurs locaux de $VMName"
"`r" | Out-File -FilePath $LogFile -Append -Force
}
Catch {
$ErrorMessage = $_.Exception.Message
Write-Host " [ERROR] Unable to create the group $ADMADGroup on AD : $ErrorMessage" -ForegroundColor Red
Write-Log -Output $LogFile -Message "- [ERROR] Unable to create the group $ADMADGroup on AD : $ErrorMessage"
"`r" | Out-File -FilePath $LogFile -Append -Force
}
Write-Host "`r"
Write-Host "Please move the server to the right folder/OU !" -ForegroundColor Yellow
Write-Host "Please add AD groups (TSE & ADM) in the VM !" -ForegroundColor Yellow
Write-Host "`r"
}
Catch {
$ErrorMessage = $_.Exception.Message
Write-Host "$ErrorMessage" -ForegroundColor Red
Write-Log -Output "$LogFile" -Message "$ErrorMessage"
"`r" | Out-File -FilePath $LogFile -Append -Force
}
}
Write-Host "`r"
Disconnect-VIServer -Server * -Force -Confirm:$false
Write-Host "Disconnecting of VMware Server" -ForegroundColor Green
Write-Host "`r"
$EndTime = Get-Date
$Duration = [math]::Round((New-TimeSpan -Start $StartTime -End $EndTime).TotalMinutes,2)
Write-Host "`r"
Write-Host "Script launched from : " -NoNewline; Write-Host $Hostname -ForegroundColor Red
Write-Host "By : " -NoNewline; Write-Host $FullLogin -ForegroundColor Red
Write-Host "Path : " -NoNewline; Write-Host $Workfolder -ForegroundColor Red
Write-Host "Start time : " -NoNewline; Write-Host $StartTime -ForegroundColor Red
Write-Host "End time : " -NoNewline; Write-Host $EndTime -ForegroundColor Red
Write-Host "Duration : " -NoNewline; Write-Host $Duration -ForegroundColor Red -nonewline; Write-Host " minutes"
Write-Host "`r"
Exemple du fichier Create-VM.log
créé automatiquement avec la configuration complète des VMs :
[21-06-2017 10:41:47] Launching the creation of 1 Virtual Machine(s) [21-06-2017 10:41:47] Trying to connect on VMware Server... [21-06-2017 10:41:49] Connected on the vCenter SRVVCENTER : [21-06-2017 10:41:49] - From : LAPTOP-P0L4K [21-06-2017 10:41:49] - With : laptop-p0l4k\Pierre [21-06-2017 10:41:49] Ask your admin password to add the VM(s) in Active Directory [21-06-2017 10:44:55] Creation of the log file : [21-06-2017 10:44:55] - Path : E:\Scripts\Create-VM\Logs [21-06-2017 10:44:55] - File name : 2017-06-21-Create-VMs.log [21-06-2017 10:44:55] Configuration of the XML file : [21-06-2017 10:44:55] ############################################# [21-06-2017 10:44:55] - Hostname : DEVPARADM01 [21-06-2017 10:44:55] - Template : Modèle 2012 R2 [21-06-2017 10:44:55] - Datacenter : DCName [21-06-2017 10:44:55] - Cluster : DEV [21-06-2017 10:44:55] - ESX : ESXName [21-06-2017 10:44:55] - Datastore : TEST_AUTO_VM_DC1_C2 [21-06-2017 10:44:55] - Drive (GB) : 40 [21-06-2017 10:44:55] - Drive2 (GB) : 20 [21-06-2017 10:44:55] - Drive3 (GB) : 0 [21-06-2017 10:44:55] - CPU : 2 [21-06-2017 10:44:55] - Memory (GB) : 4 [21-06-2017 10:44:55] - VLAN : LAN_Dev [21-06-2017 10:44:55] - IP : 192.XXX.XXX.XXX [21-06-2017 10:44:55] - Mask : 255.255.255.0 [21-06-2017 10:44:55] - Gateway : 192.XXX.XXX.XXX [21-06-2017 10:44:55] - DNS : 8.8.8.8 8.8.4.4 [21-06-2017 10:44:55] - VM Description : ADM Server 01 on DEV [21-06-2017 10:44:55] ############################################# [21-06-2017 10:44:55] Creation of the VM DEVPARADM01 started : [21-06-2017 10:44:55] - Datastore TEST_AUTO_VM_DC1_C2 selected -> 199 (GB) free space [21-06-2017 10:44:55] - Space needed for the VM creation : 60 (GB) [21-06-2017 10:44:55] - Ask the local admin password on DEVPARADM01 [21-06-2017 10:48:42] - Using Modèle 2012 R2 template [21-06-2017 10:51:19] - Cloning Modèle 2012 R2 template [21-06-2017 10:51:23] - Setting Hostname, CPU and RAM on DEVPARADM01 [21-06-2017 10:51:29] - Setting second virtual disk size to 20 (GB) [21-06-2017 10:51:32] - Setting the VM DEVPARADM01 on VLAN LAN_Dev [21-06-2017 10:51:44] - Applying customization on DEVPARADM01 [21-06-2017 10:51:47] Power ON the VM DEVPARADM01 [21-06-2017 10:51:47] Creation of AD groups : [21-06-2017 10:51:47] - AD group GRP_DEVPARADM01_TSE created - Groupe des utilisateurs ayant des droits d'accès à distance sur DEVPARADM01 [21-06-2017 10:51:47] - AD group GRP_DEVPARADM01_ADM created - Groupe des administrateurs locaux de DEVPARADM01
Cliquer ici pour télécharger le script.