Jump to content


  • 0
anyweb

The CM12 BitLocker FrontEnd HTA

Question

Introduction

 

I guess this could be called version 3.0 of the original windows-noob FrontEnd HTA, and this time it has evolved to support System Center 2012 Configuration Manager. I've been meaning to migrate this to Configuration Manager 2012 for quite a while now but time was not on my side between work and family. This works on both Configuration Manager 2012 RTM and Configuration Manager 2012 SP1 so that you can deploy Windows 7 or Windows 8 depending on the version (of Configuration Manager) you are currently running.

 

Before starting, please make sure you can fulfill the requirements otherwise some or all of the features may not work.

 

The HTA requires the following:

 

* Patience

* Configuration Manager 2012

* MDT 2012 Update 1 integrated with Configuration Manager 2012

* Language packs for the Appropriate Operating System

* Dell CCTK files and Lenovo SMBIOS/SMBUS files

* Maik Kosters Web Services (version 7.3) [optional but recommended]

* MBAM Server to store and manage the BitLocker encryption recovery keys, if you are planning on deploying Windows 8 with BitLocker use the Microsoft BitLocker Administration and Monitoring (MBAM) 2 0 Beta Refresh Release [required for the REFRESH action unless you suspend the disc in Windows first]

* Michael Niehaus' Webservice for RIS like autonaming [optional]

 

What does it do ?

The HTA allows you to PXE boot into WinPE and use an easy interface for migrating your computers to Windows 7 or Windows 8 using Configuration Manager 2012 Service Pack 1 with MDT 2012 Update 1 integrated.

 

Not only does this HTA now work with Configuration Manager 2012 but it has additional functionality added such as being able to choose the BitLocker Encryption Algorithm, install the System Center 2012 Endpoint Protection client and the ability to install Multi Language options.

 

On the left we have Backup, in the middle it's Reinstall and to the right it's New Computer as denoted by the cool unopened box.

 

The CM12 BitLocker FrontEnd HTA.png

 

In the lower left corner you'll notice two new lines of information, one is the Task Sequence name (handy when you are changing versions) and the other is the current USMT ruleset version (it points to a text file which you maintain, and you can use it to keep track of your internal changes to any custom XML files contained in your USMT ruleset, the name of the file is usmt_rulesets_version.txt and a sample is included, this helps you keep track of changes you make to your migration ruleset and is useful for troubleshooting failed migrations with helpdesks using USB or Standalone media which may be out of date...).

 

lower left corner.png

 

clicking on the Info button in the lower left corner brings up even more details about the deployment, the following new items have been added to the Deployment Information window

  • Make
  • Memory
  • Is on Battery
  • Is UEFI
  • Is VM
  • Virtual Platform
  • AssetTag

some of the above are new data gathered via the enhanced Gathering ability from MDT 2012 Update 1.

 

the Info button.png

 

and clicking on the CMTrace button will open the current SMSTS.log file in CMTrace so that you can monitor the deployment

 

cmtrace.png

 

A closer look at the functionality

 

There are three main choices in the HTA, and they are detailed below:

Backup old computer

 

backup.png

 

Backup old computer allows you to backup your data in WinPE either locally or to a network share using a mixture (or combination) of ZTIbackup.wsf (for full WIM backups) or scanstate.exe (for file backups). Lastly, you can choose to run a CHKDSK on the disk to check for file corruption. It's all automated, all you have to do is to decide how you want the backup to take place from the options below:-

 

  • full WIM backup locally
  • full wim backup to network
  • chkdsk
  • offline scanstate to Network folder

Once a backup is complete you'll get a popup message notifying you and clicking ok will shutdown the computer.

 

backup is complete.png

 

Reinstall computer

 

reinstall.png

 

This option reinstalls Windows 7 or Windows 8 (and retains the users data using hardlinking) on Windows XP or Windows 7 computers and supports the following BitLocker specific scenarios, in the table below anywhere it mentioned 7 you can do the same with Windows 8 if that is the OS you are deploying:-

 

Note: BL=BitLockered and UBL=Not BitLockered, the reinstallation (keep users data, wipe Windows, reinstall Windows, restore data) of already BitLockered computers requires a MBAM backend in order to provide the needed key.

  • XP>7 BL
  • XP>7 UBL
  • 7 BL>7 UBL
  • 7 UBL>7 BL
  • 7 BL>7 BL
  • 7 UBL>7 UBL

In addition to the above, you can do the following:-

  • full WIM backup locally
  • full wim backup to network
  • chkdsk
  • Auto Computername
  • Enable (or disable) BitLocker (if the computer has a TPM detected, if not the option is greyed out)
  • Enter a Username (get's added to the Local Administrators group)

 

New Computer

 

New Computer.png

 

This option allows you to perform a new installation of Windows 7 or Windows 8 with or without BitLocker full disc encryption enabled, in addition you can select the type of Advanced Encryption Standard algorithm you want via a drop down menu.

 

Note: The Diffuser option is no longer available to be added to the Advanced Encryption Standard (AES) encryption algorithm for Windows 8.

 

select encryption algorithm.png

 

You can also select to Enable SCEP which will install the System Center 2012 Endpoint Protection client during the task sequence so that you are protected and ready to do business.

 

enable SCEP.png

 

In addition to the above, you can do the following:-

 

multi-language in Windows 8.png

  • specify Regional settings for one or more countries
  • specify Language settings for one or more countries
  • change the computername, or choose to use Auto Computername
  • Enable (or disable) BitLocker (if the computer has a TPM detected, if not the option is greyed out)
  • Restore from a previous backup to network, or State Migration Point
  • Enter a Username (this user get's defined as the User Device Affinity user and get's added to the Local Administrators group, if you don't want them being a local admin simply disable that group in the task sequence.)

OSD Defined.png

 

What else does it do ?

 

In addition to the above the HTA has the following functionality:-

  • detects if the hardware is Lenovo or Dell (you have to add the driver package steps)
  • detects and interrogates the TPM/Bios on Dell and Lenovo hardware to prepare it for BitLocker
  • if no TPM is found it disables the BitLocker capability in the HTA
  • if virtual hardware detected, it disables BitLocker capability (however you can enable this just for testing)
  • allows you to Notify the end user if the task sequence was successful or unsuccessful
  • creates a REG key upon successful task sequence completion and adds it to the registry
  • creates a text file in c:\ with the DATE and TIME to demonstrate successful task sequence
  • copies CMTrace.exe to the Windows\ of the OS drive.

The task sequence will check if the computer is connected to power, and if not it will inform the user via a popup, this is done via the new IsOnBattery variable.

 

warning no power supply detected.png

 

Once you launch Backup, Reinstall or New Computer, the computername is automatically checked and if it matches MININT- then you'll be prompted to change it manually.

 

prompt for computername if MININT.png

 

In addition there are some debug steps in the task sequence (they are disabled, simply enable them to see the functionality) to allow for things like pausing the task sequence, this is great for troubleshooting.

 

pause task sequence.png

 

Recommended Reading

 

  1. The BitLocker FrontEnd HTA - http://www.windows-noob.com/forums/index.php?/topic/4811-introducing-the-bitlocker-frontend-hta
  2. The windows-noob.com FrontEnd HTA - http://www.windows-noob.com/forums/index.php?/topic/3476-introducing-the-windows-noobcom-frontend-hta-ver-10/
  3. How can I create a boot image with HTA support using MDT - http://www.windows-noob.com/forums/index.php?/topic/1995-how-can-i-create-a-boot-image-with-hta-support-using-mdt/
  4. Introduction to Web Services - http://www.windows-noob.com/forums/index.php?/topic/3247-introduction-to-web-services/
  5. How can I install a Web Service - http://www.windows-noob.com/forums/index.php?/topic/3249-how-can-i-install-a-web-service/
  6. Deploying Language packs offline using MDT - http://www.windows-noob.com/forums/index.php?/topic/3251-customising-windows-7-deployments-part-4/
  7. Deploying Multiple Language Packs offline using MDT - http://www.windows-noob.com/forums/index.php?/topic/5155-customising-windows-7-deployments-part-6-adding-multiple-keyboard-layouts-and-multiple-languages/
  8. Advanced Encryption Standard - http://en.wikipedia.org/wiki/Advanced_Encryption_Standard
  9. Operating System Deployment and Endpoint Protection - http://blogs.technet.com/b/configmgrteam/archive/2012/04/12/operating-system-deployment-and-endpoint-protection-client-installation.aspx
  10. How to change the default BitLocker encryption method and cipher strength when using the Enable BitLocker task - http://blogs.technet.com/b/configurationmgr/archive/2010/08/10/how-to-change-the-default-bitlocker-encryption-method-and-cipher-strength-when-using-the-enable-bitlocker-task-in-configmgr-2007.aspx
  11. MBAM Beta 2.0 - http://windowsteamblog.com/windows/b/springboard/archive/2012/06/12/introducing-microsoft-bitlocker-administration-2-0-beta.aspx
  12. Configuring UDA during OSD - http://blogs.technet.com/b/inside_osd/archive/2011/06/20/configuration-manager-2012-user-device-affinity-and-os-deployment.aspx
  13. MBAM 2 Setup - http://msandbu.wordpress.com/2012/06/13/mbam-microsoft-bit-locker-administration-and-monitoring-beta-2-0/
  14. BitLocker Overview in Windows 8 - Removed or deprecated functionality - http://technet.microsoft.com/en-us/library/hh831713.aspx

Coming Soon

  • Pre-Provision BitLocker ability, currently disabled
  • UEFI ability not added yet

 

Known Issues

 

Stuff that's Fixed:

 

The following issues have been identified and fixed since the last release of the code, if your deployment has any of these problems then download the task sequence and associated files again (files last updated 2013/3/8).

 

  • included in the ZIP file below, are three custom XML files used in the scanstate/loadstate actions, unless you modify those actions to point to your own XML's you might get some errors like below
  1. 'scanstate failed because the printer is out of paper
    (Error: 0000001C; Source: Windows)' error message. simply copy these XML files to the root of your amd64\x86 USMT directories and redistribute your USMT packages to your dp's.
  2. As Above you might get a Loadstate Error 27 which is directly related to not finding the XML files above, make sure to copy them to your USMT folders as specified above.
  • Offline scanstate to network (when disc is BitLockered) fails with return code :11, basically there is a typo in the runscanstate-offline_no_hardlinking.bat file, locate the folllowing section and change

    /offlinewindir:%~2:\windows
     
    to

    /offlinewindir:%~2\windows
     

 

  • State Restore (Network) doesn't restore anything due to an option mis-configuration, change Deploymenttype Equals Refresh to DeploymentType Not Equals Refresh

not equals.png

 

  • State Restore (Network) doesn't restore anything due to a missing file and the file it was pointing to had a /hardlink option in, it shouldn't have !

 

 

Stuff that needs to be Fixed:

 

The following Issues have been identified and the resolution is shown below however they have not been fixed in the code downloaded above, which means you have to make the corrections.:-

 

1.

 

in deploymenu.js line 476 change

 arr[arr.length] = "USMTdropdown: " + usmtvalue;

to

  arr[arr.length] = "Uddir: " + usmtvalue;

2. Change the options tab for the State Restore SMP to task sequence variable Uddir (was USMTDropdown) as per the screenshot below

 

options tab state restore SMP.png

 

3. Change the options tab for the State Restore Network to task sequence variable UDDIR not equals SMP as per the screenshot below

 

uddir not equals smp.png

 

4. The dump variables for debugging has a typo change the command line to:-

cscript.exe "%ScriptRoot%\wnb\DumpVars.wsf"

5. Local admin accounts are not migrated in network state store, add /lac:Password to the command line in runloadstatex64_no_hardlinking.bat like below

"%~2\USMTbits\amd64\loadstate.exe" "%~1" /c /lac:Password /i:%~2\USMTbits\amd64\miguser.xml /i:%~2\USMTbits\amd64\migapp.xml /i:%~2\USMTbits\amd64\wallpaper.xml /i:%~2\USMTbits\amd64\printers.xml /nocompress /v:5 /l:%~2\Windows\CCM\logs\SMSTSLog\loadstate.log

6. Resolution is not set in WinPE

change the Set Screen Resolution step to

cmd /c "%scriptroot%\wnb\SETRES" h1024 v768 b32

The backup to network (full wim and scanstate) need some additional changes

 

Add the Connect to Network step in RED in the below two places

 

connect to network if z doesnt exist.png

 

set the options like so

 

connect to network if z doesnt exist options.png

 

and add an MD to the following line

 

create backup scanstate folder.png

 

Download the Files

 

In this ZIP you have an exported copy of the System Center 2012 Configuration Manager SP1 task sequence and associated files.

 

Note: If you downloaded the ZIP before March 8th 2013, please download it again again as I've added some bugfixes in the scripts and task sequences.

 

The CM12 BitLocker FrontEnd HTA.zip

 

well that's it, please try this out and tell me what you think of it, I hope you like my efforts :-).

 

Installation Instructions

 

To use the downloaded files see the below instructions, if you need further clarification then please ask.

Share this post


Link to post
Share on other sites

Recommended Posts

  • 0
Hi,
First off, I'd like to thank and commend you for creating such a great tool :)
I'm getting desperate now as I'm so close to having this implemented at my workplace. As we are looking to name our computers according to a number of parameters (specifically depending on the office location and the department), I decided to extend Niehaus' RIS Naming webservice. In short I simply modified it to take two new parameters, department and office.
The WebService by itself works absolutely fine, i.e. triggering through a SOAP action (e.g. .NET WEbService Studio) or directly from a browser, it returns a correct value:
Y3ybiB7.png
5dYR4W7.png
As you can see, the actual webservice appears to be working correctly. However, when I try to connect it using the mdt scripts, with the following settings, I get a 500 Internal error response:
[ChangeComputerName]
WebService=http://sesccm01/risnaming/risnaming.asmx?op=GenerateName
Parameters=dnsDomain,prefix,uuid,dptValue,officeValue
<![LOG[CHECKING the [ChangeComputerName] section]LOG]!><time="14:45:25.000+000" date="03-06-2015" component="changecomputername" context="" type="1" thread="" file="changecomputername">
<![LOG[No value specified for parameter 'PREFIX', web service results could be unpredictable.]LOG]!><time="14:45:25.000+000" date="03-06-2015" component="changecomputername" context="" type="1" thread="" file="changecomputername">
<![LOG[Unexpected response from web service: 500 Internal Server Error
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><soap:Code><soap:Value>soap:Receiver</soap:Value></soap:Code><soap:Reason><soap:Text xml:lang="en">Server was unable to process request. ---> Data at the root level is invalid. Line 1, position 1.</soap:Text></soap:Reason><soap:Detail /></soap:Fault></soap:Body></soap:Envelope>]LOG]!><time="14:45:25.000+000" date="03-06-2015" component="changecomputername" context="" type="3" thread="" file="changecomputername">
<![LOG[Unable to call ChangeComputername WebService.]LOG]!><time="14:45:25.000+000" date="03-06-2015" component="changecomputername" context="" type="2" thread="" file="changecomputername">

The above is from a virtual machine. this is what I get from a desktop:

<![LOG[CHECKING the [ChangeComputerName] section]LOG]!><time="14:39:32.000+000" date="03-06-2015" component="changecomputername" context="" type="1" thread="" file="changecomputername">
<![LOG[Unexpected response from web service: 500 Internal Server Error
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><soap:Code><soap:Value>soap:Receiver</soap:Value></soap:Code><soap:Reason><soap:Text xml:lang="en">Server was unable to process request. ---> Data at the root level is invalid. Line 1, position 1.</soap:Text></soap:Reason><soap:Detail /></soap:Fault></soap:Body></soap:Envelope>]LOG]!><time="14:39:32.000+000" date="03-06-2015" component="changecomputername" context="" type="3" thread="" file="changecomputername">
<![LOG[Unable to call ChangeComputername WebService.]LOG]!><time="14:39:32.000+000" date="03-06-2015" component="changecomputername" context="" type="2" thread="" file="changecomputername">

The Prefix, interestingly enough, should be set during the TS (this is unchanged from when I imported it), but since we're seeing the 500 error regardless I doubt it's the problem:

PFrq6UP.png

(Options > Conditions is still set to e.g. IsDesktop equals "True")

 

I've added dptValue and officeValue info gathering to the HTA, and the values are populated, e.g:

dptValue = dptDrop.options[dptDrop.selectedIndex].value;
officeValue = offDrop.options[offDrop.selectedIndex].value;

jOKKhep.png

Can anyone help me figure out what is going wrong?
(I should probably mention that I also added some logging functionality to the WebService, should it fail for some reason e.g. exceptions, but nothing is logged)

Share this post


Link to post
Share on other sites

  • 0

open a cmd prompt at the HTA and cd to the folder where the scripts for contacting the webserver are located

 

then, execute the cmdline to run the ChangeComputerName.wsf script to do the computernaming, the first time you try it don't include any parameters, what output do you see ?

 

next time you run it include the parameters it expects, what output do you see ?

to add more logging in cmtrace (make sure it's open with the ChangeComputerName.log in view) then execute the script in debug mode like so

 

ChangeComputerName.wsf /debug:true

 

this should reveal the source of your issues but for a pointer, from you error above it's not finding the prefix as you are either calling the wrong URL or the parameters speficied are not correct, which could be true as the webservice you show in your screenshot has different parameter names to the one in your customsettings.ini

Share this post


Link to post
Share on other sites

  • 0

Hi anyweb,

 

Thanks for replying, really appreciate it!

 

I think you may be onto something. In the webService, I had defined the input variables as "office" and "department" respectively, so my first idea was to change those from:

[WebMethod]
        public String GenerateName(String dnsDomain, String prefix, String uuid, String department, String office)

to

[WebMethod]
        public String GenerateName(String dnsDomain, String prefix, String uuid, String dptValue, String officeValue)

To match those that are configured in CustomSettings.ini:

[ChangeComputerName]
WebService=http://sesccm01/risnaming/risnaming.asmx?op=GenerateName
Parameters=dnsDomain,prefix,uuid,dptValue,officeValue

This didn't help, unfortunately.

 

The Prefix is only acting up on the virtual machine (which is odd, the TS step is skipping because as IsVirtual is considered false). On the desktop, however, we can see all the values being pulled through:

<![LOG['debug' parameter was specified.]LOG]!><time="09:49:40.000+000" date="03-09-2015" component="changecomputername" context="" type="1" thread="" file="changecomputername">
<![LOG[Property debug is now = TRUE]LOG]!><time="09:49:40.000+000" date="03-09-2015" component="changecomputername" context="" type="1" thread="" file="changecomputername">
<![LOG[Microsoft Deployment Toolkit version: 6.1.2373.0]LOG]!><time="09:49:40.000+000" date="03-09-2015" component="changecomputername" context="" type="1" thread="" file="changecomputername">
<![LOG[The task sequencer log is located at X:\WINDOWS\TEMP\SMSTSLog\SMSTS.LOG.  For task sequence failures, please consult this log.]LOG]!><time="09:49:40.000+000" date="03-09-2015" component="changecomputername" context="" type="1" thread="" file="changecomputername">
<![LOG[Using specified INI file = C:\_SMSTaskSequence\WDPackage\CustomSettings.ini]LOG]!><time="09:49:40.000+000" date="03-09-2015" component="changecomputername" context="" type="1" thread="" file="changecomputername">
<![LOG[CHECKING the [ChangeComputerName] section]LOG]!><time="09:49:40.000+000" date="03-09-2015" component="changecomputername" context="" type="1" thread="" file="changecomputername">
<![LOG[About to execute web service call using method POST to http://sesccm01/risnaming/risnaming.asmx?op=GenerateName: dnsDomain=euse&prefix=DT&uuid=4C4C4544-0038-5810-8053-B2C04F563432&dptValue=DEV&officeValue=SE]LOG]!><time="09:49:40.000+000" date="03-09-2015" component="changecomputername" context="" type="1" thread="" file="changecomputername">
<![LOG[Unexpected response from web service: 500 Internal Server Error
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><soap:Code><soap:Value>soap:Receiver</soap:Value></soap:Code><soap:Reason><soap:Text xml:lang="en">Server was unable to process request. ---> Data at the root level is invalid. Line 1, position 1.</soap:Text></soap:Reason><soap:Detail /></soap:Fault></soap:Body></soap:Envelope>]LOG]!><time="09:49:40.000+000" date="03-09-2015" component="changecomputername" context="" type="3" thread="" file="changecomputername">
<![LOG[Unable to call ChangeComputername WebService.]LOG]!><time="09:49:40.000+000" date="03-09-2015" component="changecomputername" context="" type="2" thread="" file="changecomputername">

It might be worth mentioning that the boot image I'm using is x64, although that shouldn't matter. We can clearly see that it's POSTing the correct values, yet it appears as if the VBScript can't invoke the WebService properly.

 

EDIT:

I noted the following in the IIS log, which shows us that it might be something with the WebService afterall:

172.16.20.12 POST /risnaming/risnaming.asmx op=GenerateName 80 - 172.16.7.138 Mozilla/4.0+(compatible;+Win32;+WinHttp.WinHttpRequest.5) - 500 0 0 759 53

I'm digging through the error codes and hopefully I can nail down the issue. Any other ideas?

Share this post


Link to post
Share on other sites

  • 0

So, I decided to try a workaround, using PowerShell instead, as I think something is happening with how the VBScript calls the webservice.

 

I got the PowerShell script to run successfully in the TS environment, but when triggering it through the TS it fails:

XXSJk3q.png

 

2qOheFD.png

 

 

So I decided to try to invoke the PowerShell command in a few different ways, but all of them fail.

 

ev6ANY1.png

 

cythch4.png

 

RG0vWjR.png

 

So neither package or calling the script through MDT works:

oZYBZHe.png

 

The script itself isn't exactly rocket-science, but in this case it appears to be failing because it fails to start the PS host shell?

# Script to call WebService to change computername
Import-Module %scriptroot%\wnb\ZTIUtility.psm1
#$env:PSExecutionPolicyPreference  = "Unrestricted"

# Determine where to do the logging 
$TSENV = New-Object -COMObject Microsoft.SMS.TSENVironment 
$logPath = $TSENV:LogPath
$logFile = "$logPath\GenerateComputerName.log"
 
# Start the logging 
Start-Transcript $logFile
Write-Output "Logging to $logFile"

#Get TSENV stuff:
$dnsDomain = $TSENV:dnsDomain
$prefix = $TSENV:prefix
$uuid = $TSENV:UUID
$dptValue = $TSENV:dptValue
$officeValue = $TSENV:officeValue

# Load up the WebService, and call the function
Try
{
	$ADWebS = New-WebServiceProxy -Uri http://sesccm01/risnaming/risnaming.asmx?WSDL
	$ComputerName = $ADWebS.GenerateName($dnsDomain, $prefix, $uuid, $dptValue, $officeValue)

	$TSENV:OSDCOMPUTERNAME = "$ComputerName"
	Write-Output "INFO: Set ComputerName to $ComputerName" 
}
Catch
{
	Write-Output "ERROR: $ErrorMessage"
}

Stop-Transcript

Ideas why the PowerShell would fail?

Share this post


Link to post
Share on other sites

  • 0

Finally got this to work! :D

(It wasn't the boot wim that was the issue)

I'll post it here if anyone else runs into the same issue, they can do the following:

  • Replace the "Call ChangeComputerName webservice" step in the Task Sequence with the following:
    • A Run Command Line step with the following:
    • powershell.exe -ExecutionPolicy Bypass -file "%SCRIPTROOT%\wnb\GenerateComputerName.ps1"
    • 5IOjPg8.png
  • In the wnb folder (where the old "changecomputername.wsf" resides), create a new file named "GenerateComputerName.ps1". It should contain the following (change as you deem necessary):
  • # Script to call WebService to change computername
    
    $scriptPath = split-path -parent $MyInvocation.MyCommand.Definition
    
    $toolsPath = ($scriptPath | Split-Path | Split-Path) + "\Tools\Modules\ZTIUtility"
    
    Import-Module "$toolsPath\ZTIUtility.psm1"
    #$env:PSExecutionPolicyPreference  = "Unrestricted"
    
    # Determine where to do the logging 
    $TSENV = New-Object -COMObject Microsoft.SMS.TSENVironment 
    $logPath = $TSENV:LogPath
    $logFile = "$logPath\GenerateComputerName.log"
     
    # Start the logging 
    Start-Transcript $logFile
    Write-Output "Logging to $logFile"
    
    #Get TSENV stuff:
    $dnsDomain = $TSENV:dnsDomain
    $prefix = $TSENV:prefix
    $uuid = $TSENV:UUID
    
    # Load up the WebService, and call the function
    Try
    {
    	$ADWebS = New-WebServiceProxy -Uri http://SCCMSERVER/risnaming/risnaming.asmx?WSDL
    	$ComputerName = $ADWebS.GenerateName($dnsDomain, $prefix, $uuid)
    
    	$TSENV:OSDCOMPUTERNAME = "$ComputerName"
    	Write-Output "INFO: Set ComputerName to $ComputerName" 
    }
    Catch
    {
    	Write-Output "ERROR: $ErrorMessage"
    }
    
    Stop-Transcript
    
  • Example; in my case, I also have variables for office and departments. I added the and modified the following:
$dptValue = $TSENV:dptValue
$officeValue = $TSENV:officeValue

# Change $ComputerName = $ADWebS.GenerateName($dnsDomain, $prefix, $uuid) to:
$ComputerName = $ADWebS.GenerateName($dnsDomain, $prefix, $uuid, $dptValue, $officeValue)

Cheers!

  • Like 1

Share this post


Link to post
Share on other sites

  • 0

glad you got it working,

 

(It wasn't the boot wim that was the issue)

 

 

what was the issue then seeing as others may also have that issue,

 

the UEFI version handles refreshes to UEFI as well as legacy hardware, so it's more future resiliant, plus it has the new HTA design..

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.