<# This should work in Windows 10 & Server 2016. To use this script, create a shortcut in common startup (START > RUN > SHELL:COMMON STARTUP). The shortcut should call PS something like this: powershell.exe -ExecutionPolicy Bypass -WindowStyle Hidden -NonInteractive -NoLogo -File "C:\Scripts\add_printers_logon.ps1" #> # I've added a sleep-timer to avoid a timing issue with getting the system and its networking up and running. # This can be adjusted to suit your needs. Start-Sleep -Seconds 15 # Testing for an active network connection. $upTest = ( Get-NetConnectionProfile | Where-Object {$_.IPv4Connectivity -ne "NoTraffic"} ) # Print server. Some prefer an IP or NetBIOS name here. $PrintServer = "prntsrvr2.gvsd.org" # If the active network connection is on the correct domain, the printer installations will begin. if ($upTest.NetworkCategory -eq "DomainAuthenticated" -and $upTest.Name -ieq "gvsd.org" ) { Add-Printer -ConnectionName "\\$PrintServer\Color402_q" Add-Printer -ConnectionName "\\$PrintServer\Copy Center B-W_Q" Add-Printer -ConnectionName "\\$PrintServer\Copy Center Color_Q" Add-Printer -ConnectionName "\\$PrintServer\Print_Q" } else { exit }