# 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