Je travaille sur un laboratoire DSC construit sur un seul serveur. J'ai un fichier mof pour un serveur (vhdx
) que je copie à c:\windows\system32\configuraiton\pending.mof
. L'idée étant qu'au démarrage, le système appliquera le mof et le système sera configuré.copie du fichier MOF vers vhd (xvhdFile) avant le démarrage
Malheureusement, le fichier mof n'est pas copié. J'ai d'autres entrées sous xVhdFile
qui sont copiées (unattended.xml
, DSC resource directories
) mais pas le mof. Quelqu'un sait pourquoi?
Voici la xVhdFile
entrée:
xVhdFile "CopyUnattendedXml DC01"
{
VhdPath = "F:\VMs\DC01\DC01`.vhdx"
FileDirectory = @(
# Pending.mof
MSFT_xFileDirectory {
SourcePath = 'F:\DSCScripts\Lab01\ForestRoot\Localhost.mof'
DestinationPath = "\Windows\Sytem32\Configuration\Pending.mof"
}
# unattend.xml
MSFT_xFileDirectory {
SourcePath = 'F:\VMs\Sysprep\2016DataCenterEval_2.xml'
DestinationPath = "\Windows\System32\Sysprep\Unattend.xml"
}
# xActiveDirectory
MSFT_xFileDirectory {
SourcePath = 'C:\Program Files\WindowsPowerShell\Modules\xActiveDirectory\'
DestinationPath = "\Program Files\WindowsPowerShell\Modules\"
type = 'Directory'
Recurse = $True
}
# xNetworking
MSFT_xFileDirectory {
SourcePath = 'C:\Program Files\WindowsPowerShell\Modules\xNetworking\'
DestinationPath = "\Program Files\WindowsPowerShell\Modules\"
type = 'Directory'
Recurse = $True
}
)
DependsOn = "[File]CopyBaseImage DC01"
}
Merci
de sortie verbeux:
VERBOSE: [WIN-LBCPOR4PDR5]: LCM: [ Start Resource ] [[xVhdFile]CopyUnattendedXml DC01]
VERBOSE: [WIN-LBCPOR4PDR5]: LCM: [ Start Test ] [[xVhdFile]CopyUnattendedXml DC01]
VERBOSE: [WIN-LBCPOR4PDR5]: [[xVhdFile]CopyUnattendedXml DC01] Alias
VERBOSE: [WIN-LBCPOR4PDR5]: [[xVhdFile]CopyUnattendedXml DC01] C
VERBOSE: [WIN-LBCPOR4PDR5]: [[xVhdFile]CopyUnattendedXml DC01] Cert
VERBOSE: [WIN-LBCPOR4PDR5]: [[xVhdFile]CopyUnattendedXml DC01] D
VERBOSE: [WIN-LBCPOR4PDR5]: [[xVhdFile]CopyUnattendedXml DC01] E
VERBOSE: [WIN-LBCPOR4PDR5]: [[xVhdFile]CopyUnattendedXml DC01] Env
VERBOSE: [WIN-LBCPOR4PDR5]: [[xVhdFile]CopyUnattendedXml DC01] F
VERBOSE: [WIN-LBCPOR4PDR5]: [[xVhdFile]CopyUnattendedXml DC01] Function
VERBOSE: [WIN-LBCPOR4PDR5]: [[xVhdFile]CopyUnattendedXml DC01] H
VERBOSE: [WIN-LBCPOR4PDR5]: [[xVhdFile]CopyUnattendedXml DC01] HKCU
VERBOSE: [WIN-LBCPOR4PDR5]: [[xVhdFile]CopyUnattendedXml DC01] HKLM
VERBOSE: [WIN-LBCPOR4PDR5]: [[xVhdFile]CopyUnattendedXml DC01] Variable
VERBOSE: [WIN-LBCPOR4PDR5]: [[xVhdFile]CopyUnattendedXml DC01] WSMan
VERBOSE: [WIN-LBCPOR4PDR5]: [[xVhdFile]CopyUnattendedXml DC01] H:\
VERBOSE: [WIN-LBCPOR4PDR5]: [[xVhdFile]CopyUnattendedXml DC01] DestinationPath => \Windows\Sytem32\Configuration\Pending.mof
VERBOSE: [WIN-LBCPOR4PDR5]: [[xVhdFile]CopyUnattendedXml DC01] Recurse => True
VERBOSE: [WIN-LBCPOR4PDR5]: [[xVhdFile]CopyUnattendedXml DC01] Force => True
VERBOSE: [WIN-LBCPOR4PDR5]: [[xVhdFile]CopyUnattendedXml DC01] Type => File
VERBOSE: [WIN-LBCPOR4PDR5]: [[xVhdFile]CopyUnattendedXml DC01] Ensure => True
VERBOSE: [WIN-LBCPOR4PDR5]: [[xVhdFile]CopyUnattendedXml DC01] Content =>
VERBOSE: [WIN-LBCPOR4PDR5]: [[xVhdFile]CopyUnattendedXml DC01] SourcePath => F:\DSCScripts\Lab01\ForestRoot\Localhost.mof
VERBOSE: [WIN-LBCPOR4PDR5]: [[xVhdFile]CopyUnattendedXml DC01] Attributes =>
VERBOSE: [WIN-LBCPOR4PDR5]: [[xVhdFile]CopyUnattendedXml DC01] Testing the file with relative VHD destination
\Windows\Sytem32\Configuration\Pending.mof
VERBOSE: [WIN-LBCPOR4PDR5]: [[xVhdFile]CopyUnattendedXml DC01] Test returned False
VERBOSE: [WIN-LBCPOR4PDR5]: LCM: [ End Test ] [[xVhdFile]CopyUnattendedXml DC01] in 2.4530 seconds.
VERBOSE: [WIN-LBCPOR4PDR5]: LCM: [ Start Set ] [[xVhdFile]CopyUnattendedXml DC01]
VERBOSE: [WIN-LBCPOR4PDR5]: [[xVhdFile]CopyUnattendedXml DC01] Alias
VERBOSE: [WIN-LBCPOR4PDR5]: [[xVhdFile]CopyUnattendedXml DC01] C
VERBOSE: [WIN-LBCPOR4PDR5]: [[xVhdFile]CopyUnattendedXml DC01] Cert
VERBOSE: [WIN-LBCPOR4PDR5]: [[xVhdFile]CopyUnattendedXml DC01] D
VERBOSE: [WIN-LBCPOR4PDR5]: [[xVhdFile]CopyUnattendedXml DC01] E
VERBOSE: [WIN-LBCPOR4PDR5]: [[xVhdFile]CopyUnattendedXml DC01] Env
VERBOSE: [WIN-LBCPOR4PDR5]: [[xVhdFile]CopyUnattendedXml DC01] F
VERBOSE: [WIN-LBCPOR4PDR5]: [[xVhdFile]CopyUnattendedXml DC01] Function
VERBOSE: [WIN-LBCPOR4PDR5]: [[xVhdFile]CopyUnattendedXml DC01] H
VERBOSE: [WIN-LBCPOR4PDR5]: [[xVhdFile]CopyUnattendedXml DC01] HKCU
VERBOSE: [WIN-LBCPOR4PDR5]: [[xVhdFile]CopyUnattendedXml DC01] HKLM
VERBOSE: [WIN-LBCPOR4PDR5]: [[xVhdFile]CopyUnattendedXml DC01] Variable
VERBOSE: [WIN-LBCPOR4PDR5]: [[xVhdFile]CopyUnattendedXml DC01] WSMan
VERBOSE: [WIN-LBCPOR4PDR5]: [[xVhdFile]CopyUnattendedXml DC01] DestinationPath => \Windows\Sytem32\Configuration\Pending.mof
VERBOSE: [WIN-LBCPOR4PDR5]: [[xVhdFile]CopyUnattendedXml DC01] Recurse => True
VERBOSE: [WIN-LBCPOR4PDR5]: [[xVhdFile]CopyUnattendedXml DC01] Force => True
VERBOSE: [WIN-LBCPOR4PDR5]: [[xVhdFile]CopyUnattendedXml DC01] Type => File
VERBOSE: [WIN-LBCPOR4PDR5]: [[xVhdFile]CopyUnattendedXml DC01] Ensure => True
VERBOSE: [WIN-LBCPOR4PDR5]: [[xVhdFile]CopyUnattendedXml DC01] Content =>
VERBOSE: [WIN-LBCPOR4PDR5]: [[xVhdFile]CopyUnattendedXml DC01] SourcePath => F:\DSCScripts\Lab01\ForestRoot\Localhost.mof
VERBOSE: [WIN-LBCPOR4PDR5]: [[xVhdFile]CopyUnattendedXml DC01] Attributes =>
VERBOSE: [WIN-LBCPOR4PDR5]: [[xVhdFile]CopyUnattendedXml DC01] Setting the VHD file Copy
VERBOSE: [WIN-LBCPOR4PDR5]: LCM: [ End Set ] [[xVhdFile]CopyUnattendedXml DC01] in 1.6880 seconds.
VERBOSE: [WIN-LBCPOR4PDR5]: LCM: [ End Resource ] [[xVhdFile]CopyUnattendedXml DC01]
Avez-vous le journal détaillé lorsque DSC copie le fichier mof? – TravisEz13
J'ai ajouté cette section de la sortie. Il n'y a aucune erreur dans l'une des sorties. L'une des choses que j'ai faites avant cette version était de déplacer le fichier mof en haut du tableau FileDirectory de xVhdFile. Notez comment il ne traite aucune des entrées de tableau suivantes. –
Quel système d'exploitation est le VHD? A-t-il des WMFs appliqués? Je pense que j'ai une solution de contournement de toute façon. Copiez le MOF à un autre emplacement et utilisez Start-DscConfiguration dans Unattend pour exécuter la configuration. Je vais être hors ligne pendant un moment, sinon j'entrerais dans plus de détails. – TravisEz13