none
DNS Suffix Search Order - LTI RRS feed

  • Question

  • I can't find anything in the Toolkit Reference.docx relating to DNS Suffix Search Order (for LTI - MDT 2013)

    On this site - http://www.hayesjupe.com/sccm-and-mdt-list-of-variables/ it mentions OSDDNSSuffixSearchOrder for SCCM (ZTI). Is there something we can use for MDT? This is mainly when I'm deploying Server OS and need to assign this information manually rather than getting it from a Domain Group Policy. I am configuring this of course in Bootstrap.ini.


    • Edited by edgar_davids Thursday, May 28, 2015 2:15 AM extra information
    Thursday, May 28, 2015 2:14 AM

Answers

  • Hello,

    By design there isn't any MDT variable giving you the ability to update DNS Search order on computers.

    However you can update your MDT deployment share to fit your needs :

    Create a custom Variable in CustomSettings.INI named "DNSSuffixSearchOrderList" and add values to DNSSuffixSearchOrderList separated by commas :

     

    Create a file named "UpdateDNSSuffixSearchOrder.ps1" inside Sript Folder in your MDT Deployment Share

    Copy and paste the foloowing code in "UpdateDNSSuffixSearchOrder.ps1" :

    # Invoke Microsoft.SMS.TSEnvironment ComObject to b able to retrieve MDT task Sequence Variables 
    $TSEnvironment = New-Object -COMObject Microsoft.SMS.TSEnvironment 
    
    # Retrieve Value of DNSSuffixSearchOrderList from Task Sequence
    $DNSSearchOrderListVariable = $TSEnvironment.Value("DNSSuffixSearchOrderList");
    $DNSSearchOrderListArray = @();
    foreach ($item in $DNSSearchOrderListVariable.Split(','))
    {
        $DNSSearchOrderListArray += $item;
    }
    $DNSSearchOrderListArray.GetType().ToString() | Out-File -FilePath "C:\temp\type.txt" -Force;
    
    $DNSSearchOrderListArray | Out-File -FilePath "C:\temp\out.txt" -Force;
    
    invoke-wmimethod -Class win32_networkadapterconfiguration -Name setDNSSuffixSearchOrder -ArgumentList @($DNSSearchOrderListArray), $null

    Update Task Sequence deploying Server OS by adding execution of "UpdateDNSSuffixSearchOrder.ps1" in "State Restore" Group :

    Regards,


    Régis Lainé | My Blog | My contributions
    Please mark as helpful/answer if this resolved your post

    • Proposed as answer by Régis Lainé Thursday, May 28, 2015 10:15 AM
    • Marked as answer by edgar_davids Monday, June 1, 2015 2:32 AM
    Thursday, May 28, 2015 10:14 AM

All replies

  • Hello,

    By design there isn't any MDT variable giving you the ability to update DNS Search order on computers.

    However you can update your MDT deployment share to fit your needs :

    Create a custom Variable in CustomSettings.INI named "DNSSuffixSearchOrderList" and add values to DNSSuffixSearchOrderList separated by commas :

     

    Create a file named "UpdateDNSSuffixSearchOrder.ps1" inside Sript Folder in your MDT Deployment Share

    Copy and paste the foloowing code in "UpdateDNSSuffixSearchOrder.ps1" :

    # Invoke Microsoft.SMS.TSEnvironment ComObject to b able to retrieve MDT task Sequence Variables 
    $TSEnvironment = New-Object -COMObject Microsoft.SMS.TSEnvironment 
    
    # Retrieve Value of DNSSuffixSearchOrderList from Task Sequence
    $DNSSearchOrderListVariable = $TSEnvironment.Value("DNSSuffixSearchOrderList");
    $DNSSearchOrderListArray = @();
    foreach ($item in $DNSSearchOrderListVariable.Split(','))
    {
        $DNSSearchOrderListArray += $item;
    }
    $DNSSearchOrderListArray.GetType().ToString() | Out-File -FilePath "C:\temp\type.txt" -Force;
    
    $DNSSearchOrderListArray | Out-File -FilePath "C:\temp\out.txt" -Force;
    
    invoke-wmimethod -Class win32_networkadapterconfiguration -Name setDNSSuffixSearchOrder -ArgumentList @($DNSSearchOrderListArray), $null

    Update Task Sequence deploying Server OS by adding execution of "UpdateDNSSuffixSearchOrder.ps1" in "State Restore" Group :

    Regards,


    Régis Lainé | My Blog | My contributions
    Please mark as helpful/answer if this resolved your post

    • Proposed as answer by Régis Lainé Thursday, May 28, 2015 10:15 AM
    • Marked as answer by edgar_davids Monday, June 1, 2015 2:32 AM
    Thursday, May 28, 2015 10:14 AM
  • It's not working for me. Here are my settings (I blanked out my DNS Suffixes, but I seperated them by commas).

    $TSEnvironment = New-Object -COMObject Microsoft.SMS.TSEnvironment 
    
    # Retrieve Value of DNSSuffixSearchOrderList from Task Sequence
    $DNSSearchOrderListVariable = $TSEnvironment.Value("DNSSuffixSearchOrderList");
    $DNSSearchOrderListArray = @();
    foreach ($item in $DNSSearchOrderListVariable.Split(','))
    {
        $DNSSearchOrderListArray += $item;
    }
    $DNSSearchOrderListArray.GetType().ToString() | Out-File -FilePath "C:\type.txt" -Force;
    
    $DNSSearchOrderListArray | Out-File -FilePath "C:\out.txt" -Force;
    
    invoke-wmimethod -Class win32_networkadapterconfiguration -Name setDNSSuffixSearchOrder -ArgumentList @($DNSSearchOrderListArray), $null
    The powershell code that I placed in the Scripts folder. I had to change C:\temp to C:\


    • Edited by edgar_davids Friday, May 29, 2015 12:24 AM changed
    Friday, May 29, 2015 12:22 AM
  • Hi,

    In the "Rule" Pane, you must replace the point before "DNSSuffixSearchOrderList" by a comma in "Property" :

    Which Version of Windows Server are you installing ?

    Regards,


    Régis Lainé | My Blog | My contributions
    Please mark as helpful/answer if this resolved your post


    Friday, May 29, 2015 6:40 AM
  • OK, all working.

    Also, I would like to remove out.txt and type.txt from the root of C:\


    • Edited by edgar_davids Monday, June 1, 2015 2:30 AM updated info
    Sunday, May 31, 2015 10:51 PM