Hi all, apologies for this, I've done it before but forgot the exact code!
I need a logon vbs to check if the user logging on is on a computer in the "admin" ou which houses the Admin PC's. If the answer is yes then Map the network drive... for the life of me I can't get what I did last time where I used to work...
This should get you started:
Code:set oNet=createobject("wscript.network") set oSysinfo=createobject("adsysteminfo") 'get full name eg cn=pc010203,ou=finance,ou=allpcs,dc=ic,dc=ac,dc=uk sDN=lcase(oSysinfo.computername) 'separate at commas; sdata(0) will be cn=pc010203; sdata(1) will be ou=finance etc sData=split(sDN,",") sOU=mid(sdata(1),4) 'get the lowest level OU - finance here - and start at 4th char; ie lose "ou=" 'find the path to map for this OU select case sOU case "finance" sPath="\\server1\fin_data" case "admin" sPath="\\server2\adminstuff" end select 'and map it if sPath<>"" then oNet.mapnetworkdrive "Z:",sPath end if
There are currently 1 users browsing this thread. (0 members and 1 guests)