Skip to main content
Solved

Managing Mapped Drives

  • December 1, 2021
  • 3 replies
  • 429 views

TJ_Coppola
Forum|alt.badge.img

Considering the shift to remote work, managing mapped drives through group policy isn’t as effective as it would be with the majority of users being on premises. 

I would like to use shift to using Automox worklets to manage mapped network drives, but when I test using PowerShell commands like “New-PSDrive” it runs as the administrator and the drives don’t appear for the end user. 

My current solution is to drop a .cmd file into the startup folder, but this is inelegant. Is there a better way to do this?

Best answer by JohnG-Automox

Hi @TJ_Coppola,

 

Better late then never here!

 

We’ve just published a new Worklet to our Catalog that will generate a scheduled task to map a network drive during your user’s next log on action. You can check it out here: 

Windows - Configuration - Map Network Drive via Scheduled Task

 

I hope this helps with your request!

 

Have a great day!

View original
How helpful was this post to you?

3 replies

TJ_Coppola
Forum|alt.badge.img
  • Author
  • Pro
  • 32 replies
  • December 1, 2021

Looks like this was covered in a previous post, but a solution wasn’t found.


jack.smith
Forum|alt.badge.img+1
  • All Star
  • 168 replies
  • December 10, 2021

Could leverage scheduled task running in the user context. 

 

copy-item script.ps1 C:\windows\temp\script.ps1

$TaskStartTime = (Get-Date)
$SchedService = New-Object -ComObject Schedule.Service
$SchedService.Connect()
$Task = $SchedService.NewTask(0)
$Task.RegistrationInfo.Description = 'Description'
$Task.Settings.Enabled = $TaskSchd
$Task.Settings.AllowDemandStart = $true
$Task.Settings.WakeToRun = $true
$trigger = $Task.triggers.Create(1) # https://docs.microsoft.com/en-us/windows/win32/taskschd/triggercollection-create
$trigger.StartBoundary = $TaskStartTime.ToString("yyyy-MM-dd'T'HH:mm:ss")
$trigger.Enabled = $true
$action = $Task.Actions.Create(0)
$action.Path = "c:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe"
$action.Arguments = '-NoProfile -NoLogo -NonInteractive -ExecutionPolicy Bypass -File "C:\windows\temp\script.ps1"'
$taskFolder = $SchedService.GetFolder('\')
$taskFolder.RegisterTaskDefinition("Task Name", $Task , 6, 'Users', $null, 4) | out-null


JohnG-Automox
Forum|alt.badge.img
  • Automox Employee
  • 121 replies
  • Answer
  • August 4, 2023

Hi @TJ_Coppola,

 

Better late then never here!

 

We’ve just published a new Worklet to our Catalog that will generate a scheduled task to map a network drive during your user’s next log on action. You can check it out here: 

Windows - Configuration - Map Network Drive via Scheduled Task

 

I hope this helps with your request!

 

Have a great day!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings