עזרה ב VBscript

gadi_f

New member
עזרה ב VBscript

היי אני מחפש דרך (ב VBscript) לבדוק האם יוזר קיים ב OU מסויים ואם כן אז תופעל אפליקציה מסוימת. מישהו יכול לעזור? תודה
 

antidot

New member
------>

אם זה 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​
 

myofer

New member
זה צריך להתבסס על משהו כזה:

Set objUser = GetObject("LDAP://cn=HuffArlene,OU=HR,dc=NA,dc=fabrikam,dc=com")​
אם שם המשתמש לא קיים תתקבל שגיאה. מה שנשאר זה להוסיף ...on error.
 
למעלה