FriendsOfMDT / PSD

PowerShell Deployment
MIT License
504 stars 78 forks source link

BITS transfer -Dynamic flag over App Proxy #181

Open LOldfield opened 1 week ago

LOldfield commented 1 week ago

To make my PSD setup accessible from off-premise, I've proxied it using EntraID/Azure App Proxy by installing the agent on the server, configuring an application

To start with this worked perfectly, the WinPE client connects and validated without issue.

When it booted into Windows 10 and reached a powershell script containing "Get-PSDContent" I discovered that the files were enumerating, but transferring no data. All appeared as 0 bytes in explorer, meaning the RMM I was trying to pull did not install.

After some tinkering I discovered that adding the "-Dynamic" flag to Start-BitsTransfer: Start-BitsTansfer $url -Authenticaion Ntlm -Credential (get-credential) -TransferType Download -Dynamic Downloaded the folder fully.

Adding the -Dynamic flag to line 416 of the PSDDeploymentShare.psm1 file and rebuilding the ISO gets it working. I'm not sure what other implications this might have e.g in WinPE though. Aware that this is likely more a server than client issue, posting for awareness.

mtniehaus commented 1 week ago

Where is your content hosted? The -Dynamic switch would fix issues with servers that don't support byte range requests. The main impact of adding that would be that interrupted downloads would end up starting over, rather than resuming from where they left off.


From: LOldfield @.> Sent: Wednesday, September 18, 2024 12:00 AM To: FriendsOfMDT/PSD @.> Cc: Subscribed @.***> Subject: [FriendsOfMDT/PSD] BITS transfer -Dynamic flag over App Proxy (Issue #181)

To make my PSD setup accessible from off-premise, I've proxied it using EntraID/Azure App Proxy by installing the agent on the server, configuring an application

To start with this worked perfectly, the WinPE client connects and validated without issue.

When it booted into Windows 10 and reached a powershell script containing "Get-PSDContent" I discovered that the files were enumerating, but transferring no data. All appeared as 0 bytes in explorer, meaning the RMM I was trying to pull did not install.

After some tinkering I discovered that adding the "-Dynamic" flag to Start-BitsTransfer: Start-BitsTansfer $url -Authenticaion Ntlm -Credential (get-credential) -TransferType Download -Dynamic Downloaded the folder fully.

Adding the -Dynamic flag to line 416 of the PSDDeploymentShare.psm1 file and rebuilding the ISO gets it working. I'm not sure what other implications this might have e.g in WinPE though. Aware that this is likely more a server than client issue, posting for awareness.

— Reply to this email directly, view it on GitHubhttps://github.com/FriendsOfMDT/PSD/issues/181, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AEBSCGHUYFLRRDI25ABOGK3ZXEQHXAVCNFSM6AAAAABOM7DAYKVHI2DSMVQWIX3LMV43ASLTON2WKOZSGUZTEOBZGM4DIMQ. You are receiving this because you are subscribed to this thread.Message ID: @.***>

LOldfield commented 1 week ago

Sorry should have mentioned, hosted on-premise, standard Windows server IIS. Internally, on the LAN, the Dynamic flag is not required, which is what makes me think the App Proxy is introducing this byte-range issue. image I wonder if the rate limiting has anything to do with this - maybe an attempt to dissuade large downloads