Mapping Drives

Hi All,

I have written a script which adds a network drive using specified user credentials but when I run it on a computer it doesn’t appear to remove or add the drive, however I did test it on there server and it worked fine.

I have also logged onto the computer in question and run the script via powershell ISE and it works fine.

I can only assume there is an issue with how syncro is running the script as the output reports fine.

Reading on here I came across a support ticket basically saying it has to elevate any script it runs and this is why drive mappings don’t work with syncro?

If this is the case has anyone managed to resolve this issue?, I have seen some suggestions across the internet utilizing scheduled tasks to achieved this.

Can anyone recommend a solution?

I ran into this and even auditing mapped drives is hit or miss. Something like this is ran as User, because System doesn’t have network access, but something about the way Syncro does it, it just doesn’t work right. No one in support could really tell me why other than it doesn’t work. I tried to output to a text file and it came out blank on most systems, but some systems it would run, didn’t make any sense. Perhaps someone does have a workaround, but I gave up because it became too much work.

This is going to be very inconsistent, when it works at all…Syncro just doesn’t do the “run as” thing well…

You’d be better off finding a different solution, maybe a logon script for the user, or possibly run something from the task tray.

When the script is run later, is there a user logged into that system at that moment?

Never tried Scheduled Tasks but I hit the same issue as you with running scripts as the Logged on User via Syncro, batch or PowerShell made no difference and they’d never appear.

I did have some success with adding Registry Entries for the required mapped drives, but with the caveat that a reboot or logoff/logon was required to see them.

Is the specified user you are using, the logged in user? Network drive mappings are on a per-user basis, so if you were using an admin account to run the script, but the current user logged in is different, the drives wouldn’t generally show up then, since it was ran under a different account.

I posted an explanation in a past post. I’ll link it here too:

Was looking at the L2TP VPN community script and noticed a trick to load the credentials as the logged in user by creating a scheduled task. I think this will also work for mapped drives. I am going to work on testing that theory when I get some more time. Replying here so I wouldn’t forget.

Has anyone just uploaded a bat file on an onboarding script?