------>
אם זה logon script, אזי משהו בסגנון:
On Error Resume Next strMatchOU = LCase("ou=users,ou=accounts,dc=antid0t,dc=net") Set objAdsSystemInfo = CreateObject("adsysteminfo") Set objUserName = Getobject("LDAP://" & objAdsSystemInfo.UserName) Set objOU = GetObject(objUserName.Parent) 'Only the name of the OU strOU = replace(objOU.Name,"OU=","") 'Full LDAP DN of the OU strOUdn = objOU.Get("distinguishedname") Select Case LCase(strOUdn) Case strMatchOU Wscript.Echo "We have a match" 'Run your stuff here Case Else Wscript.Echo "No match" End Select