Creates a scheduled task to map network drives for users at logon without requiring Group Policy infrastructure
This Automox Worklet™ creates a Windows scheduled task that maps a network drive when users log on. Because the Automox agent runs as SYSTEM and network drives exist in the user context, the Worklet uses a scheduled task approach to execute drive mapping with user credentials at logon time.
The Worklet creates a scheduled task named "Map Network Drive" that triggers on user logon. The task runs a PowerShell script that uses New-PSDrive to map the specified UNC path to the configured drive letter with the Persist flag for permanent mapping.
Results are logged to C:\ProgramData\amagent\WorkletCache\WSE-339\MapNetworkDrive.log for troubleshooting. The Worklet stores the scheduled task script at C:\Windows\temp\MapNetworkDrive.ps1 and removes any existing scheduled task with the same name before creating a new one.
Traditional network drive mapping relies on Group Policy Preferences, logon scripts, or manual configuration. These approaches require Active Directory infrastructure or user intervention. The scheduled task approach works on both domain-joined and standalone endpoints, providing consistent drive access regardless of domain membership.
Organizations transitioning away from traditional Active Directory or managing mixed environments benefit from this approach. The Worklet provides centralized management of drive mappings through Automox without requiring Group Policy infrastructure or VPN connections during initial configuration.
The scheduled task executes in the user context, respecting NTFS and share permissions on the network resource. Users access the mapped drive with their own credentials, maintaining appropriate access controls and audit trails.
Evaluation phase: The Worklet checks the HKEY_USERS registry hive for each user SID, looking under Network\{DriveLetter} for existing drive mappings. If the specified drive letter exists and points to the correct UNC path, the endpoint is compliant. If the drive does not exist or points to a different path, remediation is triggered.
Remediation phase: The Worklet validates the drive letter parameter format (single uppercase letter A-Z), creates the cache directory for logging, removes any existing "Map Network Drive" scheduled task, generates a PowerShell script for drive mapping, and registers a new scheduled task with a logon trigger that runs for all users in the Users group. The actual drive mapping occurs when users next log on.
Windows 10 or later, Windows Server 2019 or later
PowerShell 5.0 or later
Network connectivity to the file server hosting the share
Appropriate share and NTFS permissions configured for target users
Configure $driveLetter (single letter A-Z) and $uncPath (full UNC path) variables
After remediation, the scheduled task exists but the drive does not map until the next user logon. When users log on, the scheduled task executes, verifies the UNC path is accessible, and maps the drive using New-PSDrive. The mapped drive appears in File Explorer and persists across logon sessions.
You can verify the scheduled task by opening Task Scheduler and locating "Map Network Drive" in the root task folder. Check C:\ProgramData\amagent\WorkletCache\WSE-339\MapNetworkDrive.log for execution results and troubleshooting information. If the UNC path is not accessible at logon time, the log records the failure for investigation.
Run this Worklet on a pilot Windows endpoint and review evaluation output for map network drive via scheduled task.
Confirm Automox activity logs show successful completion and exit code 0.
Verify endpoint state using checks aligned to evaluation script logic, such as New-PSDrive, Get-UsernameFromSID, New-Object.
Validate remediation effects from script operations such as New-PSDrive, Write-Error, Test-Path, then rerun evaluation for compliance.


By submitting this form you agree to our Master Services Agreement and Privacy Policy.
Already have an account? Log in
Consider Worklets your easy button
A Worklet is an automation script, written in Bash or PowerShell, designed for seamless execution on endpoints – at scale – within the Automox platform. Worklet automation scripts perform configuration, remediation, and the installation or removal of applications and settings across Windows, macOS, and Linux.

AUTOMOX + WORKLETS™
Uncover new possibilities with simple, powerful automation.
By submitting this form you agree to our Master Services Agreement and Privacy Policy