FriendsOfMDT / PSD

PowerShell Deployment
MIT License
505 stars 78 forks source link

Copying OS files through UNC is not happening #94

Closed kuyavinny closed 7 months ago

kuyavinny commented 1 year ago

I've set up a lab environment that is successful in OSD through HTTP/IIS. At work, I am not able to, so I tried UNC. I was able to replicate this from my lab environment after several troubleshooting at work. Basically, the function call to copy files is called by 'PSDApplyOS.ps1' , Get-PSDContentUNC, but nothing is copied on to the PC being imaged. PSDApplyOS.log image I am able to browse the UNC directory from the deployment as seen in the image.

GeoSimos commented 1 year ago

Hello,

Unfortunately, we are not supporting the UNC path provider in PSD, what you get as an error is because the files have not been actually downloaded to the cache staging folder and the image can't be applied. You can check here https://github.com/FriendsOfMDT/PSD/issues/63 and here https://github.com/FriendsOfMDT/PSD/issues/54#issuecomment-1294141151. Can you provide more info regarding your production environment? Is there any chance that there is a firewall blocking http/https traffic if not in an exception rule for your PSD setup?

kuyavinny commented 1 year ago

Oh, I didn't know that UNC is not supported. I see that the function is there. I'm assuming that this function was never completed? As for the IIS setup at work, I'm still working on getting it approved through the chain. I'm just contracting with the company and I'm waiting on them to provide me a test lab, as what I've been trying this on is on the production server. Will UNC ever be supported?

GeoSimos commented 1 year ago

The statement for the http/https is in the landing page of the solution here https://github.com/FriendsOfMDT/PSD#target-audience. Regarding the UNC support, as a team we're not going to invest on providing and supporting it, because UNC can't support the scenarios we have built for secure imaging from anywhere (over the internet from a web server). If someone from the community wants to do it, then you may use parts of their solution with ours as a baseline, if you search through the issues you will see people working on it.

itangir commented 10 months ago

Currently it looks like the XCopy command in Copy-PSDFolder won't work because it is not equipped to handle spaces, and the path will have a space since it's ".\Operating Systems..."

In your PSDUtility.psm1 (.\Tools\Modules) try changing:

$null = Start-Process xcopy -ArgumentList "$s $d /s /e /v /d /y /i" -NoNewWindow -Wait -Passthru -RedirectStandardOutput xcopy

To:

$null = Start-Process xcopy -ArgumentList "`"$s`" `"$d`" /s /e /v /d /y /i" -NoNewWindow -Wait -Passthru -RedirectStandardOutput xcopy

Then rebuild and replace the boot image(s) so it has this change.

GeoSimos commented 10 months ago

Currently it looks like the XCopy command in Copy-PSDFolder won't work because it is not equipped to handle spaces, and the path will have a space since it's ".\Operating Systems..."

In your PSDUtility.psm1 (.\Tools\Modules) try changing:

$null = Start-Process xcopy -ArgumentList "$s $d /s /e /v /d /y /i" -NoNewWindow -Wait -Passthru -RedirectStandardOutput xcopy

To:

$null = Start-Process xcopy -ArgumentList "`"$s`" `"$d`" /s /e /v /d /y /i" -NoNewWindow -Wait -Passthru -RedirectStandardOutput xcopy

Then rebuild and replace the boot image(s) so it has this change.

Thank you for the workaround but as it is stated, UNC support is not going to be implemented as our focus is on secure imaging from anywhere (my post above yours).