none
MDT 2013 U1 Custom Powershell Script RRS feed

  • Question

  • Hello gents.

    I am in need of assistance.

    I intend to run this powershell script at the end of an MDT OS installation cycle:

    ----------------------------------------------------------------------------------

    Write-host -ForegroundColor Red "Domain join Script V.1"

    Write-host "##############################################" 

    $domain = Read-Host -Prompt "Enter domain name to join $domain"
    $user = Read-Host -Prompt "Enter username $user" 
    $password = Read-Host -Prompt "Enter password for $user" -AsSecureString 
    $username = "$domain\$user" 
    $credential = New-Object System.Management.Automation.PSCredential($username,$password) 
    Add-Computer -DomainName $domain -Credential $credential
    ------------------------------------------------------------------------------------------------------------------

    I will not be using the build-in function "Recover from domain" since we have 4-5 domains, so instead of making an image for all of the domains, i intend to just make one master image and join the whatever domain we choose as input in the PS script.

    However, i am  not sure where to put the "Run powershell script" sequence.

    Right now we have placed the script in the last chain of the MDT cycle (After imaging) with these inputs:



    %SCRIPTROOT%\Domainjoin.ps1 (Scripted is placed in MDT\Scripts folder.)

    MDT should handle the execution policy, so will this script prompt the "user" at the end?

    In advance, thanks.





    Wednesday, November 25, 2015 1:16 PM

Answers

  • Why would you not just expose the Wizard page at the beginning of the Task Sequence rather than re-inventing the wheel?

    The MDT process is designed to collect all the needed information at the beginning, and use it as needed throughout. This allows you to walk away, and come back to a fully deployed machine.

    Wednesday, November 25, 2015 1:59 PM

All replies

  • Why would you not just expose the Wizard page at the beginning of the Task Sequence rather than re-inventing the wheel?

    The MDT process is designed to collect all the needed information at the beginning, and use it as needed throughout. This allows you to walk away, and come back to a fully deployed machine.

    Wednesday, November 25, 2015 1:59 PM
  • That my friend, is a good question. I completely forgot about that pretty little window.

    If i want this wizard to show up, which setting am i suppose to add or delete in the MDT rules?

    My best guess would be "SkipDomainMembership=NO"

    Wednesday, November 25, 2015 2:05 PM
  • Andrew Barne's blog post on skipping pages

    You can apply the same logic to not skip pages also.


    Logs are very important. https://keithga.wordpress.com/2014/10/24/video-mdt-2013-log-files-basics-bdd-log-and-smsts-log/ Mention any customizations you have made.

    Wednesday, November 25, 2015 8:43 PM
    Moderator