1) Download the Script. Change the file extension from txt to ps1 and save it to networkshare. The GUI is created with Sapien Powershell Studio
2) Create a package in sccm but do not create a program. Distribute the package to DP.
3) Edit your Task Sequence and add ”Run Powershell Script”. Browse for the package you just create and write the name of the script in ”Script Name” section. Change execution policy to ”bypass”.
4) Deploy you TS.

OSDpopup

DO NOT forget to update your boot image to support .Net and Powershell.

1) Save the following script as OSDComputerName.ps1 on a networkshare.

I use Hyper-v in my labb and Hyper-v virtual machin gives you over 30 digits of serialnumber and here in this script i want only the four first of them. This is because NetBios computer names can handle a maximum lenght of 15 characters.

$SerialNumber = (Get-WmiObject -Class Win32_BIOS | Select-Object SerialNumber).SerialNumber
$ShortSerialNumber = $SerialNumber.Substring(0,4)
$OSDComputerName = “LABB-” + $ShortSerialNumber
$TSEnv = New-Object -COMObject Microsoft.SMS.TSEnvironment
$TSEnv.Value(“OSDComputerName”) = “$OSDComputerName”

2) Create a package in sccm but do not create a program. Distribute the package to DP.

3) Edit your TS and create a ”Group” before ”Apply Windows/Nework Settings” and name it OSDComputerName.

4) Add a ”Run Command Line” with the name ”Set PowerShell Execution Policy” and paste the following:

powershell.exe -noprofile -command "Set-ExecutionPolicy Bypass LocalMachine" -force

5) Add a ”Run command Line” with the name ”OSDComputerName.ps1” and paste the following:

powershell.exe -noprofile -file OSDcomputername.ps1

In ”Package” section browse for the script we created and saved in a networkshare.

6) Add a ”Run command Line” with the name ”Revert Powershell Execution Policy” and paste the following:

powershell.exe -noprofile -command "Set-ExecutionPolicy RemoteSigned LocalMachine" -force

Save the TS and test in your test environament.

During SQL 2012 SP1 installation on a Windows 2012 Server i got the following Error.

sql_error

The installation finished with some error.

sql_error2

To fix this, first I need to install .Net Framwork 3.5 and then mount my windows 2012 media as D:\ and run the follwoing command as administrator.

Dism /online /enable-feature /featurename:NetFx3 /All /Source:D:\sources\sxs

sql_error3

I rerun the SQL setup and successfully installed it.

sql_error4

During the installation of the new System Center Configuration Manager 2012 with Microsoft SQL Server 2012 I got the following error and the installtion couldn´t continue.

ERROR: Failed to get SID for user (NT Service\MSSQLSERVER)
ERROR: Failed to get the buffer size for LookupAccountName. Error= 1722

 

To fix it: I creat a domain account that has administrative right on the server and change the service account that the SQL services are running with to it and ran the setup again. This time it finished with no errors.

TZUtil or Windows Time Zone Utility can be used to display current time zone ID or set the system timezone to specified time zone ID, with support to disable Daylight Saving Time adjustments (if applicable) for the time zone with _dstoff suffix.

For example if you want to change the current Time Zone for the clients through GPO to W. Europe Standard Time. Save the following command as cmd file and deploy it as log on script.

tzutil /S "W. Europe Standard Time"