Printer question
- From: Rob <Rob@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 7 Jun 2007 10:17:02 -0700
This question is not as much the content within a script, however best
practices when completing the following.
What is the best way to assign default printers with the following conditions.
- Mobile users
- Thick and Thin clients
- No OUs currently set
- Thin clients using Citrix.
I thought about assigning it to the end-user (logon name) however when they
log on the get the same default printer, no matter if the move to another
location.
This wont work, as they need the new locations printer.
I thought about assigning the script to the workstation in ADS, by making an
OU and assigning a GPO to the container, however Thin clients are not in ADS.
Group memebership wont work either as this enviroment is 4000+ users and a
ton of groups where in one department they may have 30+ printers, and when
they move the want the one thats closest to them. No matter if they use
Citrix or Thick/Workstations.
Any thoughts?
I thought about the logon script, however the only orangization as of right
now is "groups" in ads.
Our security team hasnt created ou structure, and I had a discussion about
how we need this as all users are in the default container, and likewise PCs
in computers,
The only change was i moved all the servers in their own ou, as i didnt want
their gpos effecting my servers; espically automatic windows updates.
I thought about based on location, however using membership/subnet tracking
will not work, as one subnet may have 10+ printers easily.
On thick Clients (or better know as Pcs) they are in ADS, so assigning a gpo
to an ou and moving designated workstation in the appropriate container would
work.
and create multible scripts for each ou/gpo. However thin clients, which are
passed through citrix dont even have computer accounts in ads to manage. So
that is the pit fall.
I keep spinning my wheels as i try to think of the best way -- here is a
sample of the script thus far created by jdh logonscript creator.... And
ideas.
'Created: 6/6/2007
'Author: haverlyr
'**********************
On Error Resume Next
Dim objFSO,objFILE,objShell,objNetwork
set objFSO=CreateObject("Scripting.FileSystemObject")
set objShell=CreateObject("Wscript.Shell")
set objNetwork=CreateObject("Wscript.Network")
'Map network drives
If IsAMemberOf(objNetwork.UserDomain,objNetwork.UserName,"Staff Nurse II -
BU3") Then MapIt "Z:","\\fileserver\groups\StaffNursing" &
objNetwork.Username & ""
'Map printers
AddPrinterConnection "\\Prntserver1\BU3HpLaserJ"
objNetwork.SetDefaultPrinter "\\Prntserver1\BU3HpLaserJ"
'End of main script
'//////////////////////////////////////////////////
Function PasswordExpires(strDomain,strUser)
On Error Resume Next
Dim objUser
Set objUser=GetObject("WinNT://" & strDomain & "/" & strUser & ",user")
PassExp=INT(objUser.MaxPasswordAge/86400)-INT(objUser.PasswordAge/86400)
If PassExp<0 Then
strPassMsg="Your password never expires."
Else
strPassMsg="Your password expires in " & PassExp & " day(s)"
end If
PasswordExpires=strPassMsg
End Function
Function IsAMemberOf(strDomain,strUser,strGroup)
On Error Resume Next
Set objUser=GetObject("WinNT://" & strDomain & "/" & strUser & ",user")
Set objGrp=GetObject("WinNT://" & strDomain & "/" & strGroup & ",group")
If objGrp.IsMember(objUser.ADsPath) Then
IsAMemberOf=True
Else
IsAMemberOf=False
End If
End Function
Sub MapIt(strDrive,strMap)
On Error Resume Next
If objFSO.DriveExists(strDrive) Then objNetwork.RemoveNetworkDrive(strDrive)
objNetwork.MapNetworkDrive strDrive,strMap
If Err.Number<>0 And blnShowError Then
strMsg="There was a problem mapping drive " & UCase(strDrive) & " to " &_
strMap & VbCrLf & strHelpMsg & VbCrLf & "Error#:" & Hex(err.Number) &_
VbCrLf & Err.Description
objShell.Popup strMsg,iErrorTimeOut,"Error",vbOKOnly+vbExclamation
Err.Clear
End If
End Sub
Sub AddPrinterConnection(strPrinterUNC)
On Error Resume Next
objNetwork.AddWindowsPrinterConnection strPrinterUNC
If Err.Number<>0 And blnShowError Then
strMsg="There was a problem mapping " & UCase(strPrinterUNC) & ". " &_
vbcrlf & VbCrLf & strHelpMsg & VbCrLf & "Error#:" & Hex(err.Number) &_
VbCrLf & Err.Description
objShell.Popup strMsg,iErrorTimeOut,"Error",vbOKOnly+vbExclamation
Err.Clear
End If
end sub
Sub AddPrinterPortConnection(strPort,strPrinterUNC)
On Error Resume Next
objNetwork.AddPrinterConnection strPort,strPrinterUNC
If Err.Number<>0 And blnShowError Then
strMsg="There was a problem mapping " & UCase(strPrinterUNC) & " to " &_
strPort & vbcrlf & VbCrLf & strHelpMsg & VbCrLf & "Error#:" &
Hex(err.Number) &_
VbCrLf & Err.Description
objShell.Popup strMsg,iErrorTimeOut,"Error",vbOKOnly+vbExclamation
Err.Clear
End If
end sub
.
- Prev by Date: Re: Mapped network drive??
- Next by Date: Client printing to old print server
- Previous by thread: Re: Mapped network drive??
- Next by thread: Client printing to old print server
- Index(es):