Ajout dela structure MDT dans Infra-LAB

This commit is contained in:
2026-05-24 16:21:20 +02:00
parent fed8d42171
commit 049b03b4d4
522 changed files with 105109 additions and 0 deletions
@@ -0,0 +1,15 @@
#powershell -noprofile -command "Set-ExecutionPolicy bypass LocalMachine"
# On met l'adresse du client en variable
$IP = ((Test-Connection $env:COMPUTERNAME -Count 1).IPV4Address).ipaddresstostring
# Nslookup sur $IP
$nomfqdn = (nslookup $IP | Select-String "$IP" -Context 1,0).Context.precontext.substring(9)
# Retrait du groupe et du domain
$nonpc = $nomfqdn.Substring(0,$nomfqdn.IndexOf("."))
# Renommage du PC
Rename-Computer -NewName "$nonpc"
#restart-computer