Uživatelské nástroje

Nástroje pro tento web


private:zakaznici:skolaveltrusy:clonenb

Klonování notebooků

V rámci distanční výuky jsou notebooky půjčovány žákům. Po vrácení NB je potřeba provést novou čistou instalaci - uvést NB do definovaného stavu

poznamka k PowerShellu

$mac.gettype()

PS C:\Windows\system32> $mac.gettype()
IsPublic IsSerial Name                                     BaseType
-------- -------- ----                                     --------
True     True     Object[]                                 System.Array

PS C:\Windows\system32> $mac.count
1



$mac = @(Get-CimInstance win32_networkadapterconfiguration | select description, macaddress | where {$_.MACAddress -ne $null } | where {$_.Description -match "PCIe" })
$mac[0].macaddress -replace ":"

Přejmenovaní notebooků po provedení instalace z image

V naplanovaných úlohách je nastavena akce „Po spuštění“ - skript - C:\Users\zak\startup.cmd

startup.cmd
if not exist C:\Users\zak\renameOK.txt (
PowerShell -Command "Set-ExecutionPolicy Unrestricted -Force"
PowerShell C:\Users\zak\rename.ps1
PowerShell -Command "Set-ExecutionPolicy Restricted"
dir > C:\Users\zak\renameOK.txt
)
rename.ps1
# NB Fujitsu
$arrmac = @(Get-CimInstance win32_networkadapterconfiguration | select description, macaddress | where {$_.MACAddress -ne $null } | where {$_.Description -match "PCIe" })
# NB Acer
# $arrmac = @(Get-CimInstance win32_networkadapterconfiguration | select description, macaddress | where {$_.MACAddress -ne $null } | where {$_.Description -match "Ethernet" })
$mac = $arrmac[0].macaddress -replace ":"
$computername = "NB-" + $mac
Rename-Computer -NewName $computername
private/zakaznici/skolaveltrusy/clonenb.txt · Poslední úprava: autor: snemec

DokuWiki Appliance - Powered by TurnKey Linux