OK hello and everything. I would like to be able to map printers to certain computers based on their department which is an OU in AD, e.g english
Here is the script I have at present and it isn't quite coming off how I'd prefer. What is it thats going wrong?
PS. I'm actually a student who is interested in networks and this is a wee server I set up at home to mimic the one at my school.
I've got profiles, shares and re-directed desktops all sorted and working, but I for the life of me, can not get this script to pull off.
So I can give details here:
Servername:jonnyserv
OU's:public
neo
DM
set objSysInfo = CreateObject("ADSystemInfo")
strComputerDN = lcase(objSysInfo.ComputerName)
intStart=InStr(strComputerDN,"ou=")
if intStart <> 0 then
intEnd=InStr(intStart,strComputerDN,",")
strOU = mid(strComputerDN,intStart,intEnd)
Set objNetwork= CreateObject("WScript.Network")
select case lcase(strOU)
case "ou=public"
objNetwork.AddWindowsPrinterConnect "\\jonnyserv\hp 2000c 1"
objNetwork.AddWindowsPrinterConnect "\\jonnyserv\hp 2000c 2"
objNewwork.SetDefaultPrinter "\\jonnyserv\hp 2000c 1"
case "ou=neo"
objNetwork.AddWindowsPrinterConnect "\\jonnyserv\hp 2000c 3"
objNewwork.SetDefaultPrinter "\\jonnyserv\hp 2000c 3"
end select
end if
But its acting rather awkwardly, in that only some usuers actualy recieve the printers, another gets hp 2000c 1+2 when they should only recieve 3, and most get nothing, and another gets hp 2000c3 wherever they go.
Could it also be down to me using preconfigured profiles, I ave done those with all users but kept the .dat extension so settings are saved, would changing it to .man and apply that then remove the printers from the profile at logoff as .man doesnt save settings.In other words, the printers are sticking to the users profile.
I made a new user with no pre-configured profile and it only recieves hp 2000c 1+2 regardless of which PC they log into
Hope this all makes sense thnx