FN-GM Posted September 23, 2019 Posted September 23, 2019 (edited) Hello, The organisation I work for has previous manually mapped printers for users. The printers were spread around 15 servers. We now want to consolidate these down to 1 server and map the printers using Group Policy Preferences. Once we start to de-commision servers there will be a large amount of disruption. So I was wondering if anyone has a script I could run at login that will collect what network printers a user is connected to and then store this information in a central CSV file please? Based of this information we can then configure the Group Policy printer mapping and keep disruption to a minimum. Thanks for any help Edited September 23, 2019 by FN-GM
stevec_ Posted September 23, 2019 Posted September 23, 2019 Providing all your clients are on at least Windows 8 the following quick and dirty script should do the trick: Get-Printer | Where-Object { $_.Type -eq "Connection" } | Export-Csv -Path "\\path\to\printers.csv" -Append 1
FN-GM Posted September 23, 2019 Author Posted September 23, 2019 Providing all your clients are on at least Windows 8 Thank you. I wish that was the case. We still have a number of Windows 7 machines in service.
stevec_ Posted September 23, 2019 Posted September 23, 2019 In that case the following should work for you: Get-WmiObject win32_printer -Filter "SystemName!='$($env:COMPUTERNAME)'" | Select-Object Name,Location,SystemName,ShareName | Export-Csv -Path "\\path\to\printers.csv" -Append
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