Discussion Locked

Logon VBScript - If OU = ? then .....

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
Hi, I'm trying to write a script file that installs a printer. I've no problem with the printer install, but I want to connect the user to a printer dependant on their location\group. The OU's are structured by site, so e.g. If OU = Site1 then connect to Site1 printer, or if OU = Site2 then connect to Site2 printer. etc. etc.

3 replies

by martin powell

Thanks Steve,

I'm not too sure when it come to programming but I think I have the information on Windows Scripting that should do the job. I just need to incorperate, my existing print map script into the script I found... See below...

Set oADsSysInfo = CreateObject("ADSystemInfo")

' Get distinguished name of the current user
sADsUser = oADsSysInfo.UserName

If InStr(1, sADsUser, "OU=marketing,", vbTextCompare) > 0 then
'map J: to \\server\shares_marketing
Elseif InStr(1, sADsUser, "OU=sales,", vbTextCompare) > 0 then
'map K: to \\server\shares_sales
end if

This discussion is closed to new replies.