Jump to content

Rich

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by Rich

  1. Set objSysInfo = Createobject("ADSystemInfo") strName = objSysInfo.UserName arrDN = Split(strName, ",")'Split the Users Distinguished Name into an array DNCount = Len(arrDN(1)) 'Determines how many characters in the 2nd element of the array which is the where the OU name is (Ex. 'OU=Teachers' would be 11 characters) So DNCount=11 NewDNCount = DNCount - 3 ' This takes the DNCount and subtracts 3. Now we know how many characters there are in the string 'OU=Teachers' ( NewDNCount=8 ) minus the 'OU=' part Wscript.Echo Right(arrDN(1), NewDNCount) 'Now we print 'OU=Teachers' except for the 3 characters at the beginning. So we print 'OU=Teachers' from the Right side but only print 8 characters which leaves us with 'Teachers' You can also create a variable strOU = Right(arrDN(1), NewDNCount) I've also done it this way: Set objSysInfo = CreateObject("ADSystemInfo") strName = objSysInfo.UserName arrUserName = Split(strName, ",") 'Split the User Distinguished Name into array based on commas arrOU = Split(arrUserName(1), "=") 'takes the 'OU=Teachers' and splits it into two parts based on the "=" sign wscript.echo arrOU(1) 'Echos the 2nd element in the two part array which is 'Techers' You can also create a variable from this strOU = arrOU(1) Either way works but it's nice to see two ways to accomplish the same task. I do use the 2nd method to map printers to computers based on their OU name and it works great.
  2. See if running this script in conjunction with that group policy does the trick. It just sets your domain as part of the trusted zone. Make sure you change yourschoolhere.net to your domain. Const HKEY_CURRENT_USER = &H80000001 strComputer = "." Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv") strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\yourschoolhere.net" objRegistry.CreateKey HKEY_CURRENT_USER, strKeyPath strValueName = "*"' dwValue = 2 objRegistry.SetDWORDValue HKEY_CURRENT_USER, strKeyPath, strValueName, dwValue
  3. In Group Policy Editor navigate to User Configuration > Policies > Administrative Templates > Windows Components > Attachment Manager. Edit the Policy "Inclusion list for low file types" and add *.lnk.
×
×
  • Create New...