Deploy network printers to endpoints via a scheduled task that connects to the printer at user logon
This Automox Worklet™ deploys network shared printers to Windows endpoints. Because network printer installation requires user context and network connectivity to the print server, the Worklet creates a scheduled task that runs at user logon rather than installing immediately during the Automox policy run.
The scheduled task tests connectivity to the print server before attempting installation. If the print server is reachable, the task uses Add-Printer with the -ConnectionName parameter to connect to the shared printer. This approach handles scenarios where endpoints are sometimes off-network (laptops) or where print servers are only accessible after VPN connection.
Once the printer is successfully installed, subsequent Worklet runs detect the printer and remove the scheduled task. This self-cleaning behavior prevents unnecessary task accumulation while allowing retry attempts if the initial installation fails due to network issues.
Traditional network printer deployment relies on Group Policy Preferences or login scripts, which may not be available in non-domain environments or may be impractical for specific targeting requirements. Automox provides an alternative deployment method that works regardless of directory services infrastructure.
The scheduled task approach handles intermittent network connectivity gracefully. Mobile users who connect to the corporate network occasionally will receive the printer installation on their next logon when the print server is reachable. Failed attempts do not block other Automox policies.
You can deploy multiple instances of this Worklet with different printer configurations to provide different printers to different endpoint groups. Each scheduled task uses the printer share name in its name, preventing conflicts when deploying multiple printers.
Evaluation phase: The Worklet uses Get-Printer to check if a printer matching the specified friendly name and print server already exists. If found and the scheduled task (Add_Printer_{sharename}) still exists, it flags for cleanup. If the printer is installed and no task exists, the endpoint is compliant. If the printer is not installed, the endpoint is flagged for remediation.
Remediation phase: If the printer is already installed, the Worklet removes any lingering scheduled task using Unregister-ScheduledTask. If no printer exists, the Worklet creates a scheduled task named Add_Printer_{sharename} that runs at logon (trigger type 9) under the Users group context. The task runs a PowerShell command that tests print server connectivity and calls Add-Printer -ConnectionName with the UNC path.
Windows 8, Server 2012, or later
PowerShell 3.0 or later
Network access to the print server from the endpoint
User must have authorization to connect to the print server (directory services or explicit share permissions)
Configure $prntSvr with print server name or IP (without backslashes)
Configure $shareName with printer share name (avoid spaces)
Configure $fName with partial printer friendly name for matching (wildcards added automatically)
Printer drivers may need pre-installation if not using directory services Point and Print
After the scheduled task runs successfully at user logon, the network printer appears in the user's Printers list. The printer shows the print server as its location. Users can print to the network printer immediately. The scheduled task is removed on the next Worklet evaluation cycle, leaving a clean configuration.
If the print server is unreachable at logon, the scheduled task remains and retries on subsequent logons. The Worklet reports "Scheduled task already present - Awaiting printer installation" until the printer successfully installs. Check network connectivity to the print server if the printer never installs despite the task being present.
Run this Worklet on a pilot Windows endpoint and review evaluation output for add network printer.
Confirm Automox activity logs show successful completion and exit code 0.
Verify endpoint state using checks aligned to evaluation script logic, such as Get-ScheduledTask, Write-Output.
Validate remediation effects from script operations such as Get-ScheduledTask, Unregister-ScheduledTask, Write-Output, 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