friendsofmdt / psd Goto Github PK
View Code? Open in Web Editor NEWPowerShell Deployment
License: MIT License
PowerShell Deployment
License: MIT License
Always use the default partition scheme in File: PSDPartition.ps1
this issue happens when deploying to physical machine this problem was in mdt 8443 and adk 1703 and was related to ltiapply script.wsf.
also i have another question how to to use mdt databae with the psd extension?
thank you for this great project.
avi
If the installer is designed to Create or Upgrade (re-running the installer) MDT-Shares, this should never be an error.
Hi, in rules i set SkipDeployReadiness=YES but this didn't disable this step, how can I disable this?
do not close this yet. Please upvote and down vote this? thanks #
At MMS 2023, Johan gave a quick demo of upgrading a PDT installation to a new release - super helpful!
From memory, the steps were:
These steps should ideally be put into a .md file with screenshots to make this process more accessible to folks.
It should be mentioned to use an English based 'OsLanguage' OS, because the security groups are not localized in the install script.
For PowerShell Cmdlets the groups can be translated and icacls.exe can work with SID's directly.
Will I run into more problems when continuing with a non English OS, after fixing the group names ?
I love the new Pre-PSD menu (and the release in general). But I noticed that wiping all disks also wipes the USB stick (from which I booted).
PSDResources\Prestart\PSDPrestartMenu.ps1
'2' { Clear-Host Write-Host "Cleaning all disks" #Get-Disk | Clear-Disk -RemoveData -RemoveOEM -Confirm:$false -Verbose #Get-PhysicalDisk | Reset-PhysicalDisk -Verbose # Using diskpart due to issues with Clear-Disk # Borrowed (with pride) code snippet from David Segura $Disks = Get-Disk foreach ($Disk in $Disks){ $null = @" select disk $($Disk.number) clean exit "@ | diskpart.exe }
Changing line 75 to
$Disks = Get-Disk | Where-Object "bustype" -ne "usb"
should prevent that.
I've updated the Install-PSD.ps1 to do what the Install-PSD script does, what the New-PSDWebInstance is trying to do, and a whole lot more, like 'creating a URI folder, SMB share, PSDrive, and PSDrive description. It also goes on to install the scripts that Michael started writing over 2 years ago that someone slapped code over that just 'checks' to see if minimum versions of ADK, WinPE and MDT are installed, my version will check the version numbers and if they're not installed, it will source those installations from Microsoft's website and install them automatically and then proceed with the rest of the installation.
That's called 'doing things the right way'.
My installation script also installs the web server features that you've listed in your WebInstance in addition to several others that I intend to use once my project stretches it's legs.
Are there problems? Sure.
Is there a lot more cohesiveness to my script? Yup.
https://github.com/mcc85s/PSD-Remaster
I don't mean to sound like I know everything... because I don't. There's still a lot of room left for my project to expand, but you know what?
I went ahead and made the process a lot more convenient.
Because that's what experts are supposed to do.
After installing Windows 10 21H2 via the PSDClient task sequence i give the machine a sysprep.exe /oobe /quiet /reboot. (with an whiteout /mode:vm)
The virtual machine keeps hanging on just a moment no matter how long i wait.
Tried to remove the unattend xml in the pather folder (same result)
Tried the UnattendforAutopilotSysprep.xml of the website from Johan (same result)
Wim file i use is untouched and downloaded from my visualstudio portal (business edition)
There is an error In ADK and ADKPE detection
Lines 51 to 57 in da134d1
Here two functions works in FR-FR and en-US OsCulture
when selecting single application or multiple applications from the deployment wizard they are ignored.
PSDApplications.log
smsts.log
The current documentation says in order to enable debug mode one has to add the parameter to the PSDStart.ps1 execution command in PSD:\Templates\LiteTouchPE.xml
. However, there is no such command in that file. So I added the parameter to the command in PSD:\Templates\Unattend_PE_x64.xml
and PSD:\Templates\Unattend_PE_x86.xml
.
But changing
<Path>powershell.exe -noprofile -windowstyle hidden -file X:\Deploy\Scripts\PSDStart.ps1</Path>
to
<Path>powershell.exe -noprofile -windowstyle hidden -file X:\Deploy\Scripts\PSDStart.ps1 -Debug</Path>
causes the deployment to stop and the monitor output remains the following indefinitely:
If you leave off the .ISO file extension in the hydration pack, the installer cannot find the file and throws errors but does not cause the script to fail.
The PowerShell step in the task sequence (which utilises PSDPowershell.ps1) opens a blank powershell window instead of executing the script. This happens only if a full path is specified instead of a simple file name.
The format %SCRIPTROOT%\Upload-PSDLogs.ps1
won't work (but Upload-PSDLogs.ps1
should work).
This is a minor issue (it works if I provide the file name instead of the full path). However, most if not all examples on using scripts in MDT will use %SCRIPTROOT\
in front of the script name. It also can be confusing because executing scripts using cmd will require the full path.
<![LOG[PSDPowerShell.ps1: Starting: PSDPowerShell.ps1 - Version 0.0.1]LOG]!><time="19:23:30.96960" date="12-21-2022" component="PSDPowerShell.ps1:46" context="CND-DPL-XN0CPE\Administrator" type="1" thread="7408" file="PSDPowerShell.ps1">
<![LOG[PSDPowerShell.ps1: The task sequencer log is located at C:\MININT\SMSTSLog\SMSTS.LOG. For task sequence failures, please consult this log.]LOG]!><time="19:23:30.96960" date="12-21-2022" component="PSDPowerShell.ps1:47" context="CND-DPL-XN0CPE\Administrator" type="1" thread="7408" file="PSDPowerShell.ps1">
<![LOG[PSDPowerShell.ps1: tsenv:ScriptName C:\MININT\Cache\Scripts\Upload-PSDLogs.ps1]LOG]!><time="19:23:31.21960" date="12-21-2022" component="PSDPowerShell.ps1:50" context="CND-DPL-XN0CPE\Administrator" type="1" thread="7408" file="PSDPowerShell.ps1">
<![LOG[PSDPowerShell.ps1: tsenv:Parameters ]LOG]!><time="19:23:31.21960" date="12-21-2022" component="PSDPowerShell.ps1:51" context="CND-DPL-XN0CPE\Administrator" type="1" thread="7408" file="PSDPowerShell.ps1">
<![LOG[PSDPowerShell.ps1: About to run: ]LOG]!><time="19:23:31.68860" date="12-21-2022" component="PSDPowerShell.ps1:55" context="CND-DPL-XN0CPE\Administrator" type="1" thread="7408" file="PSDPowerShell.ps1">
<![LOG[PSDPowerShell.ps1: ArgumentList: ]LOG]!><time="19:23:31.68860" date="12-21-2022" component="PSDPowerShell.ps1:56" context="CND-DPL-XN0CPE\Administrator" type="1" thread="7408" file="PSDPowerShell.ps1">
The about About to run:
line expands an empty variable.
I did a minor change to PSDPowershell.ps1 to line 53:
$ScriptToRun = Find-PSDFile -FileName $($tsenv:ScriptName)
Adding another split-path -Leaf -Path ...
$ScriptFileName = Split-Path -Leaf -Path $($tsenv:ScriptName)
$ScriptToRun = Find-PSDFile -FileName $ScriptFileName
This way it doesn't matter in which format the path is provided and Find-PSDFile
can provide the path.
If I try to set OSDComputerName as ABC-%SerialNumber%, it does not get replaced with the serial number of the device. It tries to use ABC-%SerialNumber%, which of course is more than 15 characters.
When running the MDT .ISO on a machine the PSD selection wizard does not come up automatically. If I hit F8 and browse to X:\Deploy\Scripts and run PSDStart.ps1 the menu loads. When I select a task sequence and run it, it formats the disk, downloads and installs the image and it stops at the gather step (Installation Progress disappears) after applying the image and does not restart nor does it continue. Is something missing in the latest version? Please help!
I look in the file and find only one reference to $bOnBattery and its set to false.
When do you change this verb to true?
Looking for some general advice/guidance/tips on implementing branchcache with psd. I have the 2pint OSD toolkit addon working great but I seem to only pull about 60mb for a 1gb driver package in wim format and about 600mb for a 4.5gb os image (standalone wim). I have a windows server setup on my local network and I've tried:
I might be over estimating how much branchcache can be utilized here but I was expecting more than 600mb to be used for a 4.5gb os wim especially when the entire file is available on my local server. I've read through serveral 2pint KB articles on branchcache usage and several of Johan's blog articles on the subject to see if Im missing something but so far I can find anything.
Any advice or tips here are appreciated, I'm a bit of a noob to branchcache as you may be able to tell.
For specific behavior example, Dell Latitude 7420. The driver pack CAB is 1.84GB, the extracted folder size is 3.42GB.
However, the file generated by New-PSDDriverPackage is 5.21GB and its source folder is over 9GB.
I think I've narrowed down the issue to..
Within New-PSDDriverPackage it takes the Driver name from MDT and iterates through each of them. These drivers however can live in the same source folder, but have different classes. The script itself looks at driver classes and creates a folder based off of the class. It then copies the entire source folder to that folder. This leads to redundant files in different folders. If it's a small driver, it's fine. But in the case of video drivers, this leads to multiple GB's difference between the uncompressed source, and the zip file.
Back to the example of the 7420, the video drivers are in Display, Extension, MEDIA and SoftwareComponent.
I Followed this guide to setup MDT from scratch https://brookspeppin.com/2020/06/26/how-to-setup-powershell-deployment-extension-for-mdt-with-https/
And kinda works but keep getting error above... Where do I set hostname in MDT toolbox or scripts??
Looking at the PSD templates, I don't see a template which does an OS Upgrade. In the standard MDT templates, there was the ClientUpgrade.xml which utilized the UpgradeOS function in LTIApply.wsf. How is this functionality accomplished in PSD(PSDApplyOS.ps1)?
Additionally, in my testing the PSDDeploymentShare.Get-PSDContent function has a return value of a string. However, when control returns back to PSDStart.ps1, the return value is an array which is then attempted to be used as a string. This is throwing errors.
PowerShell takes about 7-8 seconds to start for each script, which very much slows down the process. This is tracked down to being the reason of lack of native (compiled) .Net images. By running ngen against well known assemblies we should be able to greatly speed things up.
This should be kicked off in parallel to any other activity as soon as possible in the WinPE startup.
This could also affect brand new image deployments where the .NET optimizers have not been run (after .Net upgrade or raw images).
I tested everything with SAC, 2019 Server core, Hyper-V, Proxmox and had no problem,
compared to vanilla MDT, the experience wasn't good to be honest, but to finally ditch PXE and offer a HTTP boot over the edge, I might use it anyway.
I struggled for a second to realize, I had to set DeployRoot=http:// to the new web based deploymentshare in bootstrap.ini,
maybe I missed it in the documents.
First, I had to customize the Scripts\PSDStart.ps1, to not check for mspaint.exe on the filesystem providers, as this file is not present on server core. This resulted in a missing "script/PSDStart.ps1" in the MININT folder.
# TODO: Need to find a better file for detection of running OS If (Test-Path -Path "$($Drive.Name):\Windows\System32\notepad.exe"){ Start-PSDLogging -Logpath "$($Drive.Name):\MININT\SMSOSD\OSDLOGS"
I also tuned the shutdown command to 5 sec. (I don't like the back and forth between, CMD commands and PowerShell!!) and
deleted the creation of the recovery partition for EFI and Bios, as ProxMox is not fond of EFI at all (changed with 7.1).
I had to take my time to learn, that the TS entry's for partitioning, are now useless and I had to change the
Partition-layout in Script/PSDPartition.ps1 (Maybe delete it from PSD*.xml ?)
After I created a new TS, based on the the PSDServer.xml and a server core OS, the newly created unattend.xml, was still referring to the C:\LTIBootstrap.vbs if I choose a server core OS, standard GUI server
or Clients OS were already changed to the new PSDStart.ps1 scripts.
After changing it to the new default, the psdstart.ps1 was still not started after WIM install phase,
<FirstLogonCommands> <SynchronousCommand wcm:action="add"> <CommandLine>powershell.exe -noprofile -windowstyle minimized -executionpolicy bypass -file %SystemDrive%\MININT\Scripts\PSDStart.ps1 -start</CommandLine> <Description>Lite Touch new OS</Description> <Order>1</Order> </SynchronousCommand> </FirstLogonCommands>
I also had to delete the "-start part" of the command.
If I kept the restarts to a minimum (1 :D) everything was working fine, if I used more reboots, the TS was not continuing after the second reboot,
I worked around it with an old school runonce regkey step to start the PSDStart.ps1 again.
I noticed if I set "SkipSummary" and/or "SkipFinalSummary" in Customsettings.ini to yes, the final reboot/Shutdown will not happen at the end of a TS, but I will have to test this again.
Thanks for the MDT additions and I hope the project will get some final adjustments.
I have tried to use nginx to reverse proxy this, but have ran into issues passing the credentials over due to how ntlm auth works, I have tried with disabling auth and allowing anonymous on IIS and both basic and digest auth on the nginx reverse proxy.
After filling out the credentials it just gets stuck on Verifying connection to https://site.website.tld/deploy
As for the reason for the reverse proxy:
my home isp changes ip pretty rapidly and the reverse proxy is hosted on a vps with a vpn tunnel back to my home lab.
I got my PS Deployment share set up and then added the OS, drivers and a few applications. I then try to update the deployment share and it never seems to complete. I started the update a couple days ago around 5pm and then checked it the next morning and it was still updating. Any idea what may cause this? Too many drivers or something possibly? I downloaded the Dell Deploy Driver pack for the model laptop we're imaging, but it does seem like there's quite a few drivers that get's included for some reason. In the past when I've setup MDT I feel like I've had 12-15 drivers total but this driver pack probably has 45 or so.
Any thoughts are appreciated. Thanks!
Properties defined in BS/CS.ini are not resolved further upon use;
e.g.
Priority = Test, Default
Property = FooBar
[Test]
Foobar=MyBootSize
[Default]
SLShare=\%FooBar%\Deploy$
I'm planning to install this on Windows 2019 Standard, but thought I would ask if you need it tested on other OS's/builds?
The CONTRIBUTING.md file lists the MarkdownTOC Extension for Visual Studio Code. This extension is not available on the marketplace any longer. Are there any recommended alternatives?
Hi PSD Team!,
I have a minor issue I have run into hoping for some guidance. I cannot get the application selection to work correctly in the task sequence.
When selecting the applications in the Wizard and starting the task sequence the install Applications script meant to install the applications via the deployment wizard does nothing during the task sequence.
I can create task sequences and add the applications in that way and it works or add them to the custom.ini file.
But I would like the ability to use the Deployment Wizard and select the apps if possible and have the install.
Hope that makes sense
Regards Carl
I added MACADDRESS to Priority= line as well as [] section in bootstrap.ini. There is no DHCP/IP helper on the subnet.
The configuration works perfectly in native MDT, but in PSD IP address and other network settings are not assigned and the Network Adapter is set with APIPA.
There is no installer folder separately now as in step 9 in this link: https://www.brookspeppin.com/2020/06/26/how-to-setup-powershell-deployment-extension-for-mdt-with-https/
But, continued by selecting the file Install-PSD1 from main root/parent folder.
Then it prompted for wim file, but all the latest windows 10 enterprise/pro versions we download has ESD files, so converted them using this link: https://www.neeosearch.com/esd-wim-converter/
Then, I selected the install.wim file converted and tried to boot the generated litetouch iso file from a virtualbox VM. But it is frozen/stuck on the initial screen itself. No progress.
I haven't gotten around to testing the changes that I made, but I went through each script and installation module.
https://github.com/secure-digits-plus-llc/Hybrid-DesiredStateController
There are a lot of projects that I'd like to pursue, but i'm coming to terms with the fact that I may need to take a bit of a break.
Most of what I changed was some formatting, but I also changed a bit of the presentation and tried to reduce the repetitive code.
I added a GUI feature to the installation, so it'll actually ask and provide fields for someone to install the files to where they please. It should create the folder where you tell it to go, but I might have to add a way to add credentials for a folder or to do stuff over CIM or what have you.
I've got some ideas... but I just wanted to let you know that I made the effort to go through them all and I understand the process quite a lot more now.
Thanks for making some updates.
When copying the OS image from a UNC path to the cache, if there are any spaces in the OS folder, the xcopy line is not interpreted appropriately as it sees spaces as the next parameter.
$null = Start-Process xcopy -ArgumentList """$s"" ""$d"" /s /e /v /d /y /i" -NoNewWindow -Wait -Passthru -RedirectStandardOutput xcopy
PSD/Installer/New-PSDWebInstance.ps1
Line 687 in da134d1
The Write-PSDInstallLog -Message on line 688 of the New-PSDWebInstance.ps1 file refers to "now exiting"
elsewhere this phrase precedes a break command, but here there is none.
I don't know enough about what's going on to figure out if the log output is incorrect or if there is a missing break.
If there is an existing ADK installation left running in the background, the ADK installer throws a 1618 error, which causes the hydration script to fail.
Copy-PSDFolder in PSDUtility.psm1 returns the output of
& xcopy $s $d /s /e /v /d /y /i
The output breaks a check with Test-Path in PSDStart.ps1 (Line 563) causing the task sequence to fail
In the old version the output of this was piped to Out-Null. Changing the line back to
& xcopy $s $d /s /e /v /d /y /i | Out-Null
seems to fix the issue.
@arwidmark this is a test a
I received no errors when running the "Install-PSD.ps1", but when i attempted to import an OS .wim I received this exception message.
System.Management.Automation.ParameterBindingException: Cannot bind parameter 'Path' to the target. Exception setting "Path": "Cannot find path 'PSD:\Operating Systems' because it does not exist." ---> System.Management.Automation.SetValueInvocationException: Exception setting "Path": "Cannot find path 'PSD:\Operating Systems' because it does not exist." ---> System.Management.Automation.ItemNotFoundException: Cannot find path 'PSD:\Operating Systems' because it does not exist.
at System.Management.Automation.LocationGlobber.ExpandMshGlobPath(String path, Boolean allowNonexistingPaths, PSDriveInfo drive, ContainerCmdletProvider provider, CmdletProviderContext context)
at System.Management.Automation.LocationGlobber.ResolveDriveQualifiedPath(String path, CmdletProviderContext context, Boolean allowNonexistingPaths, CmdletProvider& providerInstance)
at System.Management.Automation.LocationGlobber.GetGlobbedMonadPathsFromMonadPath(String path, Boolean allowNonexistingPaths, CmdletProviderContext context, CmdletProvider& providerInstance)
at System.Management.Automation.LocationGlobber.GetGlobbedProviderPathsFromMonadPath(String path, Boolean allowNonexistingPaths, CmdletProviderContext context, ProviderInfo& provider, CmdletProvider& providerInstance)
at System.Management.Automation.SessionStateInternal.GetItem(String[] paths, CmdletProviderContext context)
at System.Management.Automation.SessionStateInternal.GetItem(String[] paths, Boolean force, Boolean literalPath)
at Microsoft.BDD.PSSnapIn.ImportOperatingSystem.set_Path(String value)
at System.Management.Automation.ReflectionParameterBinder.BindParameter(String name, Object value, CompiledCommandParameter parameterMetadata)
--- End of inner exception stack trace ---
at System.Management.Automation.ReflectionParameterBinder.BindParameter(String name, Object value, CompiledCommandParameter parameterMetadata)
at System.Management.Automation.ParameterBinderBase.BindParameter(CommandParameterInternal parameter, CompiledCommandParameter parameterMetadata, ParameterBindingFlags flags)
--- End of inner exception stack trace ---
at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
at Microsoft.BDD.Wizards.OperatingSystemProgress.WizardProcessing()
at Microsoft.BDD.Wizards.WizardProgress.InitiateWizardProcessing()
/BG
Deployment routine is not aborted when trying to deploy from offline media
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.