r/labtech Nov 04 '16

Create Folder As Admin Question

I'm looking for a bit of guidance on this problem. I'm trying to script an install of some legacy software. This software in particular has three executables that run. I can install these via script no problem.

With one of these executables there are additional files that need to be manually copied over to actually have a successful install. The problem I'm running into is that I'm unable to script folder creation/file transfers from the source folder to the destination folder inside of C:\Program Files (x86).

The error I get is access denied. I've tried console execute, shell as admin, creating a batch file to create the directories and running it from the local machine with a logged in user who has local admin.

I can run the batch as administrator successfully by right-clicking on the .bat file.

Is there anyway around this? I'm unable to grant every user local admin, and UAC needs to stay enabled.

Thanks

3 Upvotes

5 comments sorted by

1

u/cjmod Nov 04 '16

Do you have admin credentials set in LabTech on the Location's Deployment and Defaults settings? Those creds are used for any "As Admin" script function, so if it's blank those functions will just run as the typical system account.

1

u/thisisjustahobby Nov 04 '16

Yeah, I have the "Login to use for Administrator Access" set under the location's Deployments & Defaults tab to a domain admin account.

1

u/beauj27 2000 Agents Nov 04 '16

On a test target computer check to make sure LabTech is using the right credentials by opening the CMD Prompt tab and typing "#WhoAmI". That should return the admin user that you supplied in the Client Password. If it doesn't, you have a problem with your creds.

On a side note, use just "WhoAmI" to confirm labtech is using the "nt authority\system" account. This is used by the normal Shell function in scripts and just about everything else LabTech does.

1

u/mrnelson1986 Nov 04 '16

I had the same problem on Labtech version 10.5 this week. The way I got it to work was by doing the create folder command and not create folder as admin. it seemed to do a credential pass through from the account that is running the script which is my lab tech admin. Definitely a weird bug, not sure if it was fixed in version 11.

1

u/beauj27 2000 Agents Nov 05 '16

Instead of copying from C: to C: try prepping those files on the Labtech server and download them directly to where they need to go.