Problem with database and powershell connectivity RRS feed

  • Question

  • So if i understand it correctly MDT does by default NOT register deployment to the database, so i've found a powershell script that i've been trying to incorporate to the task sequence.

    Using windows server 2016 and MDT build 8443.

    It works fine when doing it manually like this:

    (i have to manually map something so it takes the credentians, like net use i: \\server\deploymentshare$)

    Import-Module –name MDTDB.psm1 (this works fine)

    new-mdtcomputer -macAddress '%MACADDRESS001%' -settings @{OSInstall='Yes'; OSDComputerName='testcomp' ; SkipComputerName='Yes' ; SkipSummary='Yes' ; SkipFinalSummary='Yes' ; TaskSequenceID='W10EDU' ; SkipTaskSequence='Yes' ; SkipWizard='Yes' ; SkipCapture='Yes' ; JoinWorkgroup='WORKGROUP' ; SkipDomainMembership='Yes' ;  }

    (trying to make a zero touch install when the computer is found, and when the computer is found in db at deployment it works just fine, it's the insertion that is troublesome.)

    The error i get in the logs is something like this, loosely translated from swedish.

    Exception calling "Open" with "0" argument(s): "Ett nätverksrelaterat eller instansspecifikt fel uppstod när en anslutning skulle upprättas till SQL Server. Servern hittades inte eller var inte tillgänglig. Kontrollera att instansnamnet är korrekt och att SQL Server är konfigurerad till att tillÃ¥ta fjärranslutningar. (provider: Named Pipes Provider, error: 40 - Det gick inte att öppna en anslutning till SQL Server)"    TaskSequencePSHost    2017-11-03 10:07:01    0 (0x0000)
    At C:\MININT\Modules\MDTDB\MDTDB.psm1:153 char:5
    +     $global:mdtSQLConnection.Open()
    +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    TaskSequencePSHost    2017-11-03 10:07:01    0 (0x0000)
    NotSpecified: (:) [], MethodInvocationException    TaskSequencePSHost    2017-11-03 10:07:01    0 (0x0000)

    translated to that there is a problem with the network or instance name when connecting to the server.

    As i wrote before, this exact script does work AFTER i manually connect a letter to the share, i was assuming that it would work since at deployment time i do authenticate to the share.

    Somewhat at loss here since my powershell skills are a little sub-par i'm afraid :)

    I guess i could try something different like this, but i rather use powershell.

    Tuesday, November 7, 2017 11:04 AM

All replies