Jump to content
Matthew Mclaughlin

Script File Copy with a Variable - Windows 10 Build Upgrade

Recommended Posts

Hi All,

After speaking with ConnectWise, I understand there is a script from the Solution Centre called 'Windows 10 - Install Feature Update' which requires you to deploy the latest build of Windows 10 to your LTShare, but that it's only a supported feature on-prem and cloud partners currently don't have support for this..

 

https://docs.connectwise.com/ConnectWise_Automate/ConnectWise_Automate_Knowledge_Base_Articles/Scripting%3A_Windows_10_Install_Feature_Update_Script

Quote

Note: The Windows 10 Feature Install script can only be used with on premise instances of ConnectWise Automate® because it requires the use of LTShare to transfer the files. This script is not supported for cloud partners at this time.

 

As a potential workaround, ConnectWise have told me I can individually place the ISO under the LTsvc\packages folder on each machine.

 

Rather than download 50 x 4GB ISO's for a client, I thought to use the server to then have Automate copy this locally, but I'm struggling.

 

My plan was to create an EDF whereby we can enter at the location level the path to the ISO and then call this in a variable for the Script copy as Admin but it doesn't seem to unpack the variable path and the script fails.

Has anybody else had any success upgrading from 1803/1809/1903 using Automate?

 

Any help would be appreciated!

 

Share this post


Link to post
Share on other sites

As @KI_EricS suggested, you could use my script, or duplicate and update the script CWA provides, pointing the ISO at a cloud hosted version of the file instead of pulling it off LTShare. You could also edit it with EDFs to pull the file off network shares on a per client basis.

My script works almost identically as the CW provided one, but mine does a better job of giving details of the process to the tech that ran it. Mines also a little more flexible with Windows versions than theirs.

  • Like 1

Share this post


Link to post
Share on other sites

Hi @danialbulloch

 

Thanks for the information and @KI_EricS it's very helpful!

 

I'm having issues with Caching at the moment and Automate Support seem to think it's a known issue, are you able to offer any guidance on getting the ISO from a client server share (Accessible by all client PC's) to each client PC's  LTSVC\Packages folder using the script? I've tried using File Copy/File Copy as Admin and it seems to continue failing

We have a client with 50 Windows 10 Machines and downloading the ISO to each Computer from a shared web location would kill bandwidth

Share this post


Link to post
Share on other sites

File copy as admin should work, just make sure to use the UNC path, not a drive letter. Also, make sure the credentials are set in the location settings that you get to by double clicking a location under "Deployment & Defaults". If you do not set this, the As Admin commands will not work.

image.png.2ef66cdd79d8c8b74ba96a39669d36c7.png

  • Like 1

Share this post


Link to post
Share on other sites

@Matthew Mclaughlin, I recommend you review the ConnectWise Automate Knowledge Base Articles if you haven't already.

 

31 minutes ago, Matthew Mclaughlin said:

I'm having issues with Caching at the moment and Automate Support seem to think it's a known issue, are you able to offer any guidance on getting the ISO from a client server share (Accessible by all client PC's) to each client PC's  LTSVC\Packages folder using the script? I've tried using File Copy/File Copy as Admin and it seems to continue failing

We have a client with 50 Windows 10 Machines and downloading the ISO to each Computer from a shared web location would kill bandwidth

You could definitely use @danialbulloch's script as a basis here, but I recommend either manually (or by running a script) downloading the needed ISOs from Microsoft.com to a server or a hard-lined, always-on PC running a Windows Pro edition client OS.

What you do from there is dependent upon your environment ("all Workgroup", "all AD Domain", or "mixed")...

  • If "all Workgroup", then either set it up proper as per Microsoft documentation if not, or get migrated to a proper AD Domain.
  • If "mixed", get migrated to a proper AD Domain.
  • Hard-line the target PCs.

...and LT/CWA configuration.

  • If you're running a single Location in that LT Client, then set the hosting PC/server to be a "Master" in LT.
  • If running multiple Locations in that LT Client, then consider setting FastTalk to go by Router/Public IP Address instead of by LT Location (remember: system-wide setting).
  • Consider using "caching". (See: Agent: Caching 101Adding, Modifying, and Removing Locations | Troubleshooting Caching )
  • Set the run of the deploy script to "stagger" at least 10 minutes (if not 30) and I recommend running the first time as "once" only.

The biggest gotcha here, and possibly your main problem, is a quirk (pain) on (only, I think) the Windows-side involving how certain operations are performed. It has been my experience that some operations -especially if they use elevation- require that a functioning User Profile exist on the PC for the user account being used/authenticated against. I have run into this when using PowerShell in LT Scripts, specifically when using "by-pass" and "as admin" options/functions.

Other possibilities involve the PC's Environment Variables settings causing the LT Agent issues, and the LT Agent being unable to login as a user.

Share this post


Link to post
Share on other sites

@KI_EricS@danialbulloch

Thank you both for the responses, they're full of useful information

The 'test' client at the moment has a 2016 Domain Controller, all 50+ Windows 10 devices joined to the domain, Domain Admin creds set at location level and #whoami in command line from Automate shows the domain admin credentials, We've set caching up and Automate have remotely connected in to confirm it is correct however doesn't seem to be working so they are investigating that.

 

I've just found an article to get a public URL from Microsoft for an ISO for 24 hours (I'm not sure if this is how you're getting them or if you're getting them from Visual Studio subscriptions etc so would be interested to here your thoughts on that, but I'm now creating a script to download the ISO to the server (is marked as a Master) and then to run a second script on client PC's to download the ISO from a UNC path on the server (is there a way to create variables for this so the script will work across all clients in automate possibly from EDF's?

 

I tried last time to use File Copy as Admin from an EDF it didn't actually pull the location out of the EDF

 

Thanks for all your help with this! It's been a nightmare.

Share this post


Link to post
Share on other sites

@Matthew Mclaughlin @danialbulloch

thanks for this thread.  I am having the same issues copying from the unc path on the server to the client.

 

Question does the Server have to be in the same Client location as the workstations?  They are the same domain.

 

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...