Auteur de questions
Splash Screen pour MDT

Question
-
Bonjour à tous,
Je souhaiterai mettre en place un splashscreen de type upgrade après redémarrage du poste, lorsque la séquence de tâches effectue les actions depuis l'OS. Le but est de ne pas donner accès au bureau tant que la séquence de tâches n'est pas achevée.
J'ai trouvé cette ressource https://smsagent.blog/2019/08/01/windows-10-upgrade-splash-screen-take-2/ mais qui ne semble pas être adaptée à MDT, notamment au niveau des variables utilisées.
Avez-vous d'autres sources afin d'obtenir un résultat similaire ?
J'ai essayé de récupérer les sources sur systanddeploy mais les galeries technet sont fermées, plus rien n'est accessible.Merci d'avance !
Toutes les réponses
-
Bonjour,
Voici un autre article qui peut être utile:
Windows Splash Screen for the Task Sequence Progress
Cordialement,
NinaMicrosoft propose ce service gratuitement, dans le but d'aider les utilisateurs et d'élargir les connaissances générales liées aux produits et technologies Microsoft. Ce contenu est fourni "tel quel" et il n'implique aucune responsabilité de la part de Microsoft.
-
Bonjour,
Merci pour le retour.
J'ai réussi à intégrer le splashscreen sur mon MDT mais il me reste un problème.
Le pourcentage d'installation ne s'affiche pas car les variables ne sont pas les mêmes que pour SCCM.
Je sais qu'il est possible de récupérer le pourcentage via le cmdlet get-mdtmonitordata mais, lorsque je l'interroge, je ne parviens pas à obtenir de résultats. J'ai un message d'erreur :Impossible d'effectuer un cast d'un objet de type "System.IO.DirectoryInfo" en type "Microsoft.BDD.PSSnapIn.MDTObject".
Sur plusieurs aides j'ai vu qu'a priori la commande devrait me remonter toutes les informations de monitoring, dont le pourcentage d'installation.
Merci d'avance ! -
Également, voici le bout de code que j'utilise actuellement pour récupérer l'information :
$mycomputer = get-content env:computername # Import-Module "\\$$$$$\deploymentshare$\Tools\Modules\MicrosoftDeploymentToolkit.psd1" Import-Module "$MDT_module_path\microsoftdeploymenttoolkit.psd1" New-PSDrive -name "DSManager" -PSProvider MDTProvider -Root \\$$$$$\DeploymentShare$ $Stopwatch = New-Object System.Diagnostics.Stopwatch $Stopwatch.Start() $TimerCode2 = { $Get_Monitoring = Get-MDTMonitorData -Path DSManager: | where {$_.name -eq $mycomputer} $ProgressValue2 = $Get_Monitoring.PercentComplete $UI.TextBlock3.Text = "$($Stopwatch.Elapsed.Hours.ToString('00')):$($Stopwatch.Elapsed.Minutes.ToString('00')):$($Stopwatch.Elapsed.Seconds.ToString('00'))" $UI.ProgressBar.Value = $ProgressValue2
- Modifié ReRox mardi 17 août 2021 15:13
-
Bonjour ReRox,
Merci pour votre retour.
Voici des liens Forum et articles MS qui pourront peut-être vous aider :
- Utilisation de Microsoft Deployment Toolkit
- Monitoring MDT Task Sequences with PowerShell
- How to enable progress bar to MDT Task Sequence?
- MDT Progress Bar
- Progress Bar Not Showing Progress During OS Install
- MDT Monitoring: Deployment Notification scripts
A bientôt
Alexis
Microsoft propose ce service gratuitement, dans le but d'aider les utilisateurs et d'élargir les connaissances générales liées aux produits et technologies Microsoft. Ce contenu est fourni « tel quel » et il n'implique aucune responsabilité de la part de Microsoft. S'il vous plaît n'oubliez pas de « Marquer comme réponse » les réponses qui ont résolu votre problème. C'est une voie commune pour reconnaître ceux qui vous ont aidé, et rend plus facile l’accès aux solutions.
- Modifié Alexis ThorezModerator mercredi 18 août 2021 07:14
-
-
Bonjour,
Merci pour votre réponse.
J'ai pu avancer dans ma configuration mais je ne parviens toujours pas à récupérer le pourcentage d'installation sur mon écran.
Il semblerait que Windows PE ne puisse pas s'appliquer lui-même Get-MDTMonitorData...Si quelqu'un a une solution...
-
Avez- vous consulté le script proposé dans l'article cité plus haut ?
$Get_Monitoring = get-mdtmonitordata -path DSManager: | where {$_.name -eq "$Computer_Name"}
$Title = "Step: " + $Get_Monitoring.stepname
$Progression = "Deployment progress is " + $Get_Monitoring.percentcomplete + " %"
A bientôt
Alexis
Microsoft propose ce service gratuitement, dans le but d'aider les utilisateurs et d'élargir les connaissances générales liées aux produits et technologies Microsoft. Ce contenu est fourni « tel quel » et il n'implique aucune responsabilité de la part de Microsoft. S'il vous plaît n'oubliez pas de « Marquer comme réponse » les réponses qui ont résolu votre problème. C'est une voie commune pour reconnaître ceux qui vous ont aidé, et rend plus facile l’accès aux solutions.
-
Bonjour,
Oui j'ai bien consulté les différents liens.
La commande ci-dessus nécessite la création d'un partage via la cmdlet New-PSDrive.
Mon problème réside dans le fait que cette cmdlet n'est pas exécutée depuis le poste en cours de déploiement justement.Je rencontre l'erreur "Couldn't load file or assembly "Microsoft.BDD.Core".
J'ai essayé d'ajouter à mon script un "Add-PSSnapIn" mais j'obtiens le même message d'erreur.
Je précise que depuis mon poste "contrôle" sur lequel est installé deployment workbench, je n'ai aucun problème à récupérer via ces mêmes commandes et scripts les informations de monitoring de mes postes. Le problème se situe sur le poste en cours de déploiement qui ne parvient pas à exécuter correctement le script.
Voici mon script complet :
Set-ExecutionPolicy -ExecutionPolicy Unrestricted # Creates a full screen 'background' styled for a Windows 10 upgrade, and hides the task bar # Called by the "Show-OSUpgradeBackground" script Param($DeviceName) # Set the location we are running from $Source = $PSScriptRoot Add-Type -AssemblyName PresentationFramework,PresentationCore,WindowsBase,System.Windows.Forms,System.Drawing,System.DirectoryServices.AccountManagement Add-Type -Path "$Source\bin\System.Windows.Interactivity.dll" Add-Type -Path "$Source\bin\ControlzEx.dll" Add-Type -Path "$Source\bin\MahApps.Metro.dll" # Add custom type to hide the taskbar # Thanks to https://stackoverflow.com/questions/25499393/make-my-wpf-application-full-screen-cover-taskbar-and-title-bar-of-window $CSharpSource = @" using System; using System.Runtime.InteropServices; public class Taskbar { [DllImport("user32.dll")] private static extern int FindWindow(string className, string windowText); [DllImport("user32.dll")] private static extern int ShowWindow(int hwnd, int command); private const int SW_HIDE = 0; private const int SW_SHOW = 1; protected static int Handle { get { return FindWindow("Shell_TrayWnd", ""); } } private Taskbar() { // hide ctor } public static void Show() { ShowWindow(Handle, SW_SHOW); } public static void Hide() { ShowWindow(Handle, SW_HIDE); } } "@ Add-Type -ReferencedAssemblies 'System', 'System.Runtime.InteropServices' -TypeDefinition $CSharpSource -Language CSharp # Add custom type to prevent the screen from sleeping $code=@' using System; using System.Runtime.InteropServices; public class DisplayState { [DllImport("kernel32.dll", CharSet = CharSet.Auto,SetLastError = true)] public static extern void SetThreadExecutionState(uint esFlags); public static void KeepDisplayAwake() { SetThreadExecutionState( 0x00000002 | 0x80000000); } public static void Cancel() { SetThreadExecutionState(0x80000000); } } '@ Add-Type -ReferencedAssemblies 'System', 'System.Runtime.InteropServices' -TypeDefinition $code -Language CSharp # Load the main window XAML code [XML]$Xaml = [System.IO.File]::ReadAllLines("$Source\Xaml\SplashScreen.xaml") # Create a synchronized hash table and add the WPF window and its named elements to it $UI = [System.Collections.Hashtable]::Synchronized(@{}) $UI.Window = [Windows.Markup.XamlReader]::Load((New-Object -TypeName System.Xml.XmlNodeReader -ArgumentList $xaml)) $xaml.SelectNodes("//*[@*[contains(translate(name(.),'n','N'),'Name')]]") | ForEach-Object -Process { $UI.$($_.Name) = $UI.Window.FindName($_.Name) } # Find screen by DeviceName $Screens = [System.Windows.Forms.Screen]::AllScreens $Screen = $Screens | Where {$_.DeviceName -eq $DeviceName} #$Screen = [System.Windows.Forms.Screen]::PrimaryScreen # Get the bounds of the primary screen $script:Bounds = $Screen.Bounds # Set some initial values $UI.MainTextBlock.MaxWidth = $Bounds.Width $UI.TextBlock2.MaxWidth = $Bounds.Width $UI.TextBlock3.MaxWidth = $Bounds.Width $UI.TextBlock4.MaxWidth = $Bounds.Width $UI.TextBlock10.MaxWidth = $Bounds.Width $UI.TextBlock2.Text = "Windows Setup Progress 0%" $UI.TextBlock3.Text = "00:00:00" $UI.TextBlock4.Text = "Cela va prendre un moment... Merci de patienter" $UI.TextBlock10.Text = "Initialization..." # Find the user identity from the registry $LoggedOnSID = Get-WmiObject -Namespace ROOT\CCM -Class CCM_UserLogonEvents -Filter "LogoffTime=null" | Select -ExpandProperty UserSID If ($LoggedOnSID.GetType().IsArray) { # Multiple values returned $GivenName = "there" } Else { $RegKey = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\SessionData" $DisplayName = (Get-ChildItem -Path $RegKey | Where {$_.GetValue('LoggedOnUserSID') -eq $LoggedOnSID}).GetValue('LoggedOnDisplayName') If ($DisplayName) { $GivenName = $DisplayName.Split(',')[1].Trim() } Else { $GivenName = "there" } } $UI.MainTextBlock.Text = "Bonjour $GivenName" # Create some animations $FadeinAnimation = [System.Windows.Media.Animation.DoubleAnimation]::new(0,1,[System.Windows.Duration]::new([Timespan]::FromSeconds(3))) $FadeOutAnimation = [System.Windows.Media.Animation.DoubleAnimation]::new(1,0,[System.Windows.Duration]::new([Timespan]::FromSeconds(3))) $ColourBrighterAnimation = [System.Windows.Media.Animation.ColorAnimation]::new("#012a47","#1271b5",[System.Windows.Duration]::new([Timespan]::FromSeconds(5))) $ColourDarkerAnimation = [System.Windows.Media.Animation.ColorAnimation]::new("#1271b5","#012a47",[System.Windows.Duration]::new([Timespan]::FromSeconds(5))) # Create TSEnvironment COM object $tsenv = New-Object -COMObject Microsoft.SMS.TSEnvironment $WindowsVersion = $tsenv.Value('WindowsVersion') # An array of sentences to display, in order. Leave the first one blank as the 0 index gets skipped. $TextArray = @( "" "Windows 10 en cours d'installation" "Cela peut prendre quelques minutes" "Windows 10 en cours d'installation" "Cela peut prendre quelques minutes" "Windows 10 en cours d'installation" "Cela peut prendre quelques minutes" "Windows 10 en cours d'installation" ) # Start a dispatcher timer. This is used to control when the sentences are changed. $TimerCode = { If ($tsenv.Value('QuitSplashing') -eq "True") { $UI.Window.Close() } # The IF statement number should equal the number of sentences in the TextArray If ($i -lt 7) { $FadeoutAnimation.Add_Completed({ $UI.MaintextBlock.Opacity = 0 $UI.MaintextBlock.Text = $TextArray[$i] $UI.MaintextBlock.BeginAnimation([System.Windows.Controls.TextBlock]::OpacityProperty,$FadeinAnimation) }) $UI.MaintextBlock.BeginAnimation([System.Windows.Controls.TextBlock]::OpacityProperty,$FadeoutAnimation) } # The final sentence to display ongoing ElseIf ($i -eq 7) { $FadeoutAnimation.Add_Completed({ $UI.MaintextBlock.Opacity = 0 $UI.MaintextBlock.Text = "Installation de Windows en cours" $UI.MaintextBlock.BeginAnimation([System.Windows.Controls.TextBlock]::OpacityProperty,$FadeinAnimation) $UI.ProgressRing.IsActive = $True }) $UI.MaintextBlock.BeginAnimation([System.Windows.Controls.TextBlock]::OpacityProperty,$FadeoutAnimation) } Else {} $ColourBrighterAnimation.Add_Completed({ $UI.Window.Background.BeginAnimation([System.Windows.Media.SolidColorBrush]::ColorProperty,$ColourDarkerAnimation) }) $UI.Window.Background.BeginAnimation([System.Windows.Media.SolidColorBrush]::ColorProperty,$ColourBrighterAnimation) $Script:i++ } $DispatcherTimer = New-Object -TypeName System.Windows.Threading.DispatcherTimer $DispatcherTimer.Interval = [TimeSpan]::FromSeconds(10) $DispatcherTimer.Add_Tick($TimerCode) # Ajout du module, du composant enfichable et création du partage de déploiement #Import-Module "\\$$$$$$\deploymentshare$\Tools\Modules\MicrosoftDeploymentToolkit.psd1" #Import-Module "$MDT_module_path\microsoftdeploymenttoolkit.psd1" $mycomputer = get-content env:computername $deploymentShare = "\\$$$$$$\DeploymentShare$" Import-Module "\\$$$$$$\deploymentshare$\Tools\Modules\MicrosoftDeploymentToolkit.psd1" #Add-PSSnapin "Microsoft.BDD.PSSNAPIN" If (!(Test-Path MDT:)) { New-PSDrive -Name MDT -Root $deploymentShare -PSProvider MDTPROVIDER } Get-MDTMonitorData -Path MDT: | Where-Object { $_.Name -eq $mycomputer } | Remove-MDTMonitorData -Path MDT: $InProgress = Get-MDTMonitorData -Path MDT: | Where-Object { $_.Name -eq $mycomputer } # Fin du script de récupération des informations de monitoring $Stopwatch = New-Object System.Diagnostics.Stopwatch $Stopwatch.Start() $TimerCode2 = { $ProgressValue = $InProgress.PercentComplete $UI.TextBlock3.Text = "$($Stopwatch.Elapsed.Hours.ToString('00')):$($Stopwatch.Elapsed.Minutes.ToString('00')):$($Stopwatch.Elapsed.Seconds.ToString('00'))" $UI.ProgressBar.Value = $ProgressValue $UI.TextBlock2.Text = "Progression de l'installation $ProgressValue%" $CurrentStepName = $tsenv.Value("_SMSTSCurrentActionName") $UI.TextBlock10.Text = "$CurrentStepName" } $DispatcherTimer2 = New-Object -TypeName System.Windows.Threading.DispatcherTimer $DispatcherTimer2.Interval = [TimeSpan]::FromSeconds(1) $DispatcherTimer2.Add_Tick($TimerCode2) # Event: Window loaded $UI.Window.Add_Loaded({ # Activate the window to bring it to the fore $This.Activate() # Fill the screen $This.Left = $Bounds.Left $This.Top = $Bounds.Top $This.Height = $Bounds.Height $This.Width = $Bounds.Width # Hide the taskbar [TaskBar]::Hide() # Hide the mouse cursor [System.Windows.Forms.Cursor]::Hide() # Keep Display awake [DisplayState]::KeepDisplayAwake() # Begin animations $UI.MaintextBlock.BeginAnimation([System.Windows.Controls.TextBlock]::OpacityProperty,$FadeinAnimation) $UI.TextBlock2.BeginAnimation([System.Windows.Controls.TextBlock]::OpacityProperty,$FadeinAnimation) $UI.TextBlock3.BeginAnimation([System.Windows.Controls.TextBlock]::OpacityProperty,$FadeinAnimation) $UI.TextBlock4.BeginAnimation([System.Windows.Controls.TextBlock]::OpacityProperty,$FadeinAnimation) $UI.TextBlock10.BeginAnimation([System.Windows.Controls.TextBlock]::OpacityProperty,$FadeinAnimation) $UI.ProgressRing.BeginAnimation([System.Windows.Controls.TextBlock]::OpacityProperty,$FadeinAnimation) $UI.ProgressBar.BeginAnimation([System.Windows.Controls.TextBlock]::OpacityProperty,$FadeinAnimation) $ColourBrighterAnimation.Add_Completed({ $UI.Window.Background.BeginAnimation([System.Windows.Media.SolidColorBrush]::ColorProperty,$ColourDarkerAnimation) }) $UI.Window.Background.BeginAnimation([System.Windows.Media.SolidColorBrush]::ColorProperty,$ColourBrighterAnimation) }) # Event: Window closing (for testing) $UI.Window.Add_Closing({ # Restore the taskbar [Taskbar]::Show() # Restore the mouse cursor [System.Windows.Forms.Cursor]::Show() # Cancel keeping the display awake [DisplayState]::Cancel() $Stopwatch.Stop() $DispatcherTimer.Stop() $DispatcherTimer2.Stop() }) # Event: Close the window on right-click (for testing) #$UI.Window.Add_MouseRightButtonDown({ # # $This.Close() # #}) # Display the window $DispatcherTimer.Start() $DispatcherTimer2.Start() $UI.Window.ShowDialog()
-
Bonjour ReRox,
Voici un autre article qui pourra peut-être vous aider:
A bientôt
Alexis
Microsoft propose ce service gratuitement, dans le but d'aider les utilisateurs et d'élargir les connaissances générales liées aux produits et technologies Microsoft. Ce contenu est fourni « tel quel » et il n'implique aucune responsabilité de la part de Microsoft. S'il vous plaît n'oubliez pas de « Marquer comme réponse » les réponses qui ont résolu votre problème. C'est une voie commune pour reconnaître ceux qui vous ont aidé, et rend plus facile l’accès aux solutions.
-
Hello,
j'avais fait un truc similaire dans le passé pour mes clients, mais tu nous donnes pas beaucoup d'informations. en quel moment ton script est lancé !!!!!!! dans la tache !!! des captures d'écran seront les bienvenus.
autre chose de quel type de task parles-tu ?
j'ajoute as-tu activé le module powershell et .NET ?
autre chose encore que disent les logs !!! lors de l'installation t'as bien un suivi de ton déploiement ? as-tu un message d'erreur ? car c'est souvent le probleme quand on récupere un script en copier coller, si tu t'es inspiré du script cela aurait été plus facile, car tu pouvais gérer les erreurs et savoir quand intervenir mais comme ca dire que la commande get-mdtmonitordata ne fonctionne pas avec un joli copier coller du script, ce n'est pas évident
Dakhama Mehdi : Windows developper https://github.com/dakhama-mehdi
-
Bonjour,
j'essaie d'utiliser le même module que l'utilisateur du post' initial et j'obtiens la même erreur.
J'ai réaliser les commandes suivantes :
Import-Module "C:\Program Files\Microsoft Deployment Toolkit\Bin\MicrosoftDeploymentToolkit.psd1"
Puis "Add-PSSnapin -Name Microsoft.BDD.PSSnapIn" :> Premiere erreur :
"Add-PSSnapin : Le composant logiciel enfichable Windows PowerShell «Microsoft.BDD.PSSnapIn» n’est pas installé sur cet
ordinateur."Alors que j'ai toutes les sources du dossier Bin sur le poste.
Ensuite : New-PSDrive -Name "DS002" -PSProvider "MDTProvider" -Root "C:\MDTDeploymentShare$" -Description "MDT Deployment Share Created with Cmdlets" -NetworkPath "\\MonserveurMDT\MDTDeploymentShare$" -Verbose => Erreur :
"COMMENTAIRES : Opération « Nouveau lecteur » en cours sur la cible « Nom : DS002 Fournisseur :
MicrosoftDeploymentToolkit\MDTProvider Racine : E:\MDTDeploymentShare$ ».
New-PSDrive : Impossible de charger le fichier ou l'assembly 'Microsoft.BDD.Core, Version=6.3.8456.1000,
Culture=neutral, PublicKeyToken=31bf3856ad364e35' ou une de ses dépendances. Le fichier spécifié est introuvable."J'ai lu ici et là qu'il fallait installer des packages MSI concernant SQL ?
Merci pour votre aide ! S'il faut je posterais une nouvelle discussion.
Benoit