I need help with my DSC Powershell Script for a newinstallation of Win7computers

This topic contains 3 replies, has 2 voices, and was last updated by Profile photo of Don Jones Don Jones 1 year, 8 months ago.

  • Author
    Posts
  • #23476
    Profile photo of Christine Glaeser
    Christine Glaeser
    Participant

    Hi guys,
    I am using Powershell DSC for a silent newinstallation of our Win7 Computers in my Company and i got some Problems with my Script. I am using Win7 Professional on the traget computers and a Windows Server 2012 R2 as a Pull Server for the configuration. here is my Script:

    configuration CADKonfig
        {
            node 4d374ba6-416b-4b88-9322-00d7a9c2da9d #Zielcomputer
            {
            
            Script deskupdate 
                
                {
                
                TestScript = {$false}
                SetScript = ([String]{
                \\hhinstall2\Konfiguration\PowerShellScript\Deskupdate.ps1 
                })
                GetScript = {
    
                }
    
                } 
        
    
            Script wpi 
    
                {
    
                TestScript = {$false}
                SetScript = ([String]{
                \\hhinstall2\Konfiguration\PowerShellScript\WPIsilent.ps1            
                 })
                GetScript = {
    
                }
    
                }
    
    
            Script VLC 
    
                {
    
                TestScript = {$false}
                SetScript = ([String]{
                \\hhinstall2\Konfiguration\PowerShellScript\vlcInstallieren.ps1 
                })
                GetScript = {
    
                }
    
                }
    
    
            Script WU 
    
                {
    
                TestScript = {$false}
                SetScript = ([String]{
                \\hhinstall2\Konfiguration\PowerShellScript\WindowsUpdate
                })
                GetScript = {
    
                }
                
                }
    
            File DirectModeling 
                {
                Ensure = "Present"
                Type = "Directory"
                DestinationPath = "C:\PTC\Creo Elements\Direct Model and Drawing Manager 18.1"
                SourcePath = "\\hhcadfs\PTC\Creo Elements\Direct Modeling 18.1_x64"
                Recurse = "True"
                }
          
            File PunktKomma 
                {
                Ensure = "Present"
                Type = "Directory"
                DestinationPath = "C:\Programme\PunktKomma"
                SourcePath = "\\hhinstall2\Konfiguration\PunktKomma"
                Recurse = "True"
                }
            File OsdKill 
                {
                Ensure = "Present"
                Type = "Directory"
                DestinationPath = "C:\Programme\osdKill"
                SourcePath = "\\hhinstall2\Konfiguration\osdKill"
                Recurse = "True"
                }
    
            File Desktop18xx
                {
                Ensure = "Present"
                Type = "Directory"
                DestinationPath = "C:\Users\Public\Desktop\18.xx"
                SourcePath = "\\hhcadfs\PTC\Startscripts\Desktop\18.xx"
                Recurse = "True"
                DependsOn = "[File]PunktKomma"
                }
            File DruckerEinrichtenDesktop 
                {
                Ensure = "Present"
                Type = "File"
                DestinationPath = "C:\Users\Public\Desktop\DruckerEinrichten.ink"
                SourcePath = $Drucker
                Recurse = "True"
                DependsOn = "[File]PunktKomma"
                }
            File OsdKillDesktop 
                {
                Ensure = "Present"
                Type = "Directory"
                DestinationPath = "C:\Users\Public\Desktop\osdKill"
                SourcePath = "C:\Programme\osdkill"
                Recurse = "True"
                DependsOn = "[File]OsdKill"
                }
            File Mountprinter64bit 
                {
                Ensure = "Present"
                Type = "File"
                DestinationPath = "C:\Users\Public\Desktop\mountprinter64bit.bat"
                SourcePath = "\\hhinstall2\Konfiguration\Drucker\mountprinter64bit.bat"
                Recurse = "True"
                }
            File PunktKommaAutostart 
                {
                Ensure = "Present" 
                Type = "File"
                DestinationPath = "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\Autostart"
                SourcePath = "C:\Programme\PunktKomma\Punkt.exe"
                Recurse = "True"
                DependsOn = "[File]PunktKomma"
                }
            File TempVerzeichnis 
                {
                Ensure = "Present"
                Type = "Directory"
                DestinationPath = "C:\Temp"
                }
            Script runmountprinter 
                {
                TestScript = {$false}
                SetScript = ([String]{
                \\hhinstall2\Konfiguration\PowerShellScript\Startmountprinter64bit.ps1
                })
                GetScript = {
                
                }
                DependsOn = "[File]Mountprinter64bit"
                }
            }
        }
    
    $MofFile = CADKonfig
    
    $Drucker = "\\hhinstall2\Konfiguration\Drucker\Drucker einrichten (64bit).lnk"
    
    
    
    CADKonfig -ComputerName $env:COMPUTERNAME -OutputPath "C:\DSCMOF"
    

    here is the Windows Update Script:

    Get-WUInstall -NotTitle “Internet Explorer 11″ -AcceptAll 
    

    here the WPI Script:

    Start-Process -FilePath “\\hhinstall2\hhinstall\setup\WPI.exe” -verbose -ArgumentList 'timer=1 force=true'
    

    the VLC Script:

    $Anwendung = “\\hhinstall2\Konfiguration\vlc-2.2.0-win32\vlc-2.2.0-win32.msi”;
     #(Get-WmiObject -Class Win32_Product | where {$_.Name -eq “7-Zip 9.20 (x64 edition)”}).Uninstall();
     (Get-WmiObject -ComputerName localhost -List | Where-Object -FilterScript {$_.Name -eq “Win32_Product”}).Install($Anwendung);
    

    and here the DeskUpdate Script:

    start -FilePath “C:\Program Files (x86)\Fujitsu\DeskUpdate\ducmd.exe” -ArgumentList “/web /drv”
    

    So the configuration runs in Push Mode without any Problem but when I pull the configuration from my pull Server then the config doesnt work like it shouldt. i tried it to pull parts of the config as single configuration and noticed that the Windows Update, DeskUpdate, WPI and VLC Skripts doesnt work in pull mode. the other parts work without any problem. In addition i tried a configuration which uses a script to restart the Computer and this one also doesnt work in pull mode. I hope somebody couldt help me with this problem. Thank you in advance.

  • #23483
    Profile photo of Don Jones
    Don Jones
    Keymaster

    Are there any errors in the DSC log? Have you tried starting a Diagnostics trace on a client, and then waiting until it runs a pull cycle, and then checking the log? Without some error messages it's impossible to troubleshoot. The Diagnodtics module is in the DSC Resource Kit.

  • #23520
    Profile photo of Christine Glaeser
    Christine Glaeser
    Participant

    The Diagnostic tells me that the Checksum doesnt match but when I do it with a simpler configuration in the same way then it works. And I tried it a few times but i guess the problem is with the script ressource because only with this ressource the checksum doesnt match. Or am i wrong with this?

  • #23521
    Profile photo of Don Jones
    Don Jones
    Keymaster

    Well, without seeing exactly what you're trying, I can maybe try and provide some detail.

    In Pull mode only, both your configuration files and your resource module ZIP files must be accompanied by a checksum file. That file lets the target know (a) when something has changed, because the checksum changes, and (b) that the node was able to download the file with no data loss.

    Each time you change a configuration or a resource module ZIP file, you must generate a new checksum file. Every time.

    Now, if you are telling me that you generate a new checksum each time you change your configuration file, and that everything works fine unless the configuration file contains a Script resource, then I would suspect something in the contents of the Script resource, yes. I would probably create a configuration with as little as possible in it, and then add only one thing at a time and keep trying it until I found the thing that caused the problem. That would make troubleshooting easier. Right now, your configuration contains multiple Script resource blocks, so it's impossible to tell if only one of those is causing a problem.

You must be logged in to reply to this topic.