ste78564 Posted November 5, 2015 Posted November 5, 2015 I have been testing Windows 10 and struggling to, once captured the image to get the propmt to enter a computer name before the PC joining the domain. Sysprep completes and the PC boots and starts but the machine is given a random name. I have tried adding %computername% to the unattend.xml, using Mysyprep and Mysysprep2 and also removing the computer name string so far. I need to be able to name the PC as it did in XP and Win7 to deploy and name the machines around the site. Has anyone managed to achieve this? Many Thanks
Oaktech Posted November 5, 2015 Posted November 5, 2015 What are you using to deploy? You can add a task sequence in SCCM for this, and you can do it in MDT.
supawat1 Posted November 5, 2015 Posted November 5, 2015 If you deploy the image using SCCM, then you want to use OSDComputerName Variable, here is the guide from windows-noob How can I easily prompt for a computer name in Configuration Manager 2012 - Configuration Manager 2012 - www.windows-noob.com If you deploy the image using MDT then you may want to use UDI Designer, here is a guide from technet MDT 2012 Update 1: UDI “Build Your Own Pages†- Michael Niehaus' Windows and Office deployment ramblings - Site Home - TechNet Blogs I hope this help
ste78564 Posted November 5, 2015 Author Posted November 5, 2015 I'm using a very old version of Ghost (7.5!) which seemed to work ok to deploy Windows 7 to 500 pcs. Ive got it to a point of only thing left to do is to get the machine to prompt for a computer name
supawat1 Posted November 5, 2015 Posted November 5, 2015 You are probably run into software compatibility issue here, because you know that it worked with Windows 7, but not Windows 10. Cant you just upgrade your OS deployment environment as Ghost 7.5 is kind of 15 years old technology. 1
Davit2005 Posted November 5, 2015 Posted November 5, 2015 (edited) I think we used to leave the computer name blank in the sysprep XML if I'm not mistaken. Look at MDT I'd suggest. If you use MDT you can have a working imaging solution for not much more than the cost of a Server OS license. With Ghost you should have a license for each machine you use on it for unless they have changed the licensing. I used to use Ghost a lot before we used MDT and it is such a different improved way to work. We get the task sequence to install the OS and all applications in a VM and capture afterwards completely automatically just leaving us to add the drivers for any new workstations at the point of image deployment. Edited November 5, 2015 by Davit2005
sted Posted November 5, 2015 Posted November 5, 2015 i believe with windows 8+ (possibly even 7) if it auto domain joins you cant set the name as iirc it joins the domain before naming the pc
john Posted November 5, 2015 Posted November 5, 2015 With MDT in use here as part of the initial steps of selecting what image you want it gives a box saying to enter the machine name and select the OU for it,.
Michael Posted November 5, 2015 Posted November 5, 2015 Unfortunately you can't use MySysprep2 and you don't need MDT or SCCM either. So how do I do it? In your answer file, if you specify a prefix within the field - this is what all your computers will start with. For example School- The field needs to be left blank. The field needs to contain your Active Directory structure, starting with a nominated OU, followed by your FQDN. When starting up, your devices will be given a unique computer name based on your prefix, followed by random numbers/letters, and will join the domain within the OU you specify, which unlike the default computers container, you can't create/link GPOs. It's as simple as that. I've deployed hundreds of computers using this method. It's actually quicker/easier to allow the answer file to generate the name. You're better off having clearly labelled OUs instead, which takes minutes to do Hope this helps!
MarcBeaudoin Posted April 19, 2016 Posted April 19, 2016 The field needs to be left blank. I'm trying to put the computer's serial number here instead of an auto-generated computer name. Do you have any idea how to do that? I have a working solution for Windows 7 but it does not work with Windows 10.
Localtechie Posted April 22, 2016 Posted April 22, 2016 As far as I know the computer name has been removed from the OOBE (out of the box experience) so they way around it would be a powershell script once you have logged in on a local account which changes the computer name. Another useful removal which is included in Windows 10. 1
Michael Posted April 25, 2016 Posted April 25, 2016 I'm trying to put the computer's serial number here instead of an auto-generated computer name. Do you have any idea how to do that? I have a working solution for Windows 7 but it does not work with Windows 10. Unfortunately no, probably not without something third party. The easiest solution is to look at a different naming format. 1
5HoleDangler Posted July 7, 2017 Posted July 7, 2017 (edited) You've probably resolved this - but here is what I do here. "# Get the ID and security principal of the current user account$myWindowsID=[system.Security.Principal.WindowsIdentity]::GetCurrent()$myWindowsPrincipal=new-object System.Security.Principal.WindowsPrincipal($myWindowsID) # Get the security principal for the Administrator role$adminRole=[system.Security.Principal.WindowsBuiltInRole]::Administrator # Check to see if we are currently running "as Administrator"if ($myWindowsPrincipal.IsInRole($adminRole)) { # We are running "as Administrator" - so change the title and background color to indicate this $Host.UI.RawUI.WindowTitle = $myInvocation.MyCommand.Definition + "(Elevated)" $Host.UI.RawUI.BackgroundColor = "DarkBlue" clear-host }else { # We are not running "as Administrator" - so relaunch as administrator # Create a new process object that starts PowerShell $newProcess = new-object System.Diagnostics.ProcessStartInfo "PowerShell"; # Specify the current script path and name as a parameter $newProcess.Arguments = $myInvocation.MyCommand.Definition; # Indicate that the process should be elevated $newProcess.Verb = "runas"; # Start the new process [system.Diagnostics.Process]::Start($newProcess); # Exit from the current, unelevated, process exit } # Run your code that needs to be elevated here#rename Computer to Lab+S/NWrite-Host "Renaming PC"$computername = Get-Content env:computername$servicetag = Get-WmiObject win32_bios | Select-Object -ExpandProperty SerialNumberIf ($computername -ne $servicetag) { Write-Host "Renaming computer to Lab-$servicetag..." Rename-Computer -NewName "Lab-$servicetag" }Else { Write-Host "Done Renaming PC" }#Place script2.ps1 in Run once for rebootWrite-Host "Setting Registry Commands for Next Reboot..."Set-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce -Name final -Value "C:\WINDOWS\SYSTEM32\WindowsPowershell\v1.0\powershell.exe C:\SETUP\script2.ps1"Write-Host "Script2 added!"#Read-Host 'Please press ENTER' | Out-NullRestart-Computer #Join PC to DomainWrite-Host "Joining Domain"$cred = New-Object System.Management.Automation.PsCredential("*YouRDomainHere*\*YourDomainLoginIdHere*", (ConvertTo-SecureString "Domainloginpasswordhere" -AsPlainText -Force))Add-Computer -DomainName "EnteryourDomainhere" -Credential $credWrite-Host "Computer added to domain"#Activate WindowsWrite-Host "Activating Windows"cscript.exe //B c:\windows\system32\slmgr.vbs /ipk xxxxx-cxxxx--xxxxx-xxx-(enter your key here)cscript.exe //B c:\windows\system32\slmgr.vbs /atoWrite-Host "Windows is now activated"#Activating office productscscript "C:\Program Files (x86)\Microsoft Office\Office16\ospp.vbs" /actWrite-Host "Office Products are now activated"Start-Sleep -s 5# Install the Semantic Antivirus agent -- do not update on install and reboot now.Write-Host "Installing SEP"Start-Process "C:\setup\Sep\Sep64.msi" /QN -Wait#Wait for the install to completeWrite-Host "Done installing Symantec Endpoint Protection!! Will reboot shortly"Start-Sleep -s 10# Deactivating Administrator account net user administrator /active:no# Now rebootWrite-Host "Rebooting..."#Read-Host 'Please press ENTER' | Out-NullRestart-Computer Edited July 7, 2017 by 5HoleDangler 1
Blue_Cookeh Posted July 9, 2017 Posted July 9, 2017 FWIW I agree with others, even if you don't want to spend any money look at WDS and MDT. You can do all this stuff (and plenty more) using Task Sequences. Sysprepping machines is so buggy and old, I'm surprised MS haven't deprecated it yet.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now