mavhc Posted April 28, 2023 Posted April 28, 2023 2 steps to have printers just print to the IP of the printer: run on startup: pnputil /a 'driver.inf' Preferably a v4 printer then on login: $CurrentUser = [system.Security.Principal.WindowsIdentity]::GetCurrent() $WindowsPrincipal = New-Object System.Security.Principal.WindowsPrincipal($CurrentUser) Add-printerport -Name "TCPPort:printerdns/ip" -PrinterHostAddress "printerdns/ip" -ErrorAction SilentlyContinue Add-PrinterDriver -name "Kyocera TASKalfa 4053ci v4 KX (XPS)" -ErrorAction SilentlyContinue Add-PrinterDriver -name "Kyocera TASKalfa 4053ci KX" -ErrorAction SilentlyContinue Add-PrinterDriver -name "Kyocera TASKalfa 4052ci KX" -ErrorAction SilentlyContinue if ([system.DirectoryServices.ActiveDirectory.ActiveDirectorySite]::GetComputerSite().Name -eq "site1") { Add-Printer -Name "Name to appear to users" -PortName "TCPPort:thatDNSorIPfromEarlier" -driver "Kyocera TASKalfa 4053ci v4 KX (XPS)" -ErrorAction SilentlyContinue set-printconfiguration -color $false -printername "Name to appear to users" -ErrorAction SilentlyContinue $printer = Get-CimInstance -Class Win32_Printer -Filter "Name='Name to appear to users'" Invoke-CimMethod -InputObject $printer -MethodName SetDefaultPrinter if (-not $WindowsPrincipal.IsInRole("PupilsGroup")) { Add-Printer -Name "Office printer" -PortName "TCPPort:..." -driver "Kyocera TASKalfa 4053ci v4 KX (XPS)" -ErrorAction SilentlyContinue Add-Printer -Name "Office printer v3" -PortName "TCPPort:...." -driver "Kyocera TASKalfa 4052ci KX" -ErrorAction SilentlyContinue set-printconfiguration -color $false -printername "Office printer" -ErrorAction SilentlyContinue if ($WindowsPrincipal.IsInRole("OfficeGroup")) { $printer = Get-CimInstance -Class Win32_Printer -Filter "Name='Office printer'" Invoke-CimMethod -InputObject $printer -MethodName SetDefaultPrinter } } } if ([system.DirectoryServices.ActiveDirectory.ActiveDirectorySite]::GetComputerSite().Name -eq "site2") { .... } 1
ITJAY2023 Posted April 28, 2023 Posted April 28, 2023 Thanks Mavhc we scoured tons of forums for a script and even went to the extreme of ChatGPT
KK20 Posted May 4, 2023 Posted May 4, 2023 Have your firewall take care of things such as DHCP if you need it. We use HA pfsense as our firewall and even if we went "serverless" I would still retain the HA pfsense as a firewall is still necessary. Pfsense can do DHCP, guest wifi portals, access logging, WPAD for guest access etc if necessary.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now