Jump to content
Sign in to follow this  

Ignore error messages

Recommended Posts


I wrote a small script which read some information from Active Directory:

Const $ADS_NAME_TYPE_NT4 = 3 
Const $ADS_NAME_TYPE_1779 = 1 

$strDNSDomain = $objRootDSE.Get("defaultNamingContext")
$objTrans.Init($ADS_NAME_INITTYPE_GC, "" )
$objTrans.Set($ADS_NAME_TYPE_1779, $strDNSDomain)
$strNetBIOSDomain = $objTrans.Get($ADS_NAME_TYPE_NT4) 
$strNetBIOSDomain =StringLeft($strNetBIOSDomain,StringLen($strNetBIOSDomain)-1)
$objTrans.Set($ADS_NAME_TYPE_NT4, $strNetBIOSDomain & "\" & @UserName) 
$strUserDN = $objTrans.Get($ADS_NAME_TYPE_1779) 
$objUser = ObjGet("LDAP://" & $strUserDN)


This script works fine as long as the fields are filled in the Active Directory.

Some users have the field Initials empty. In this case I get an error message:

C:\Documents and Settings\admin-GER\Desktop\test.au3 (17) : ==> The requested action with this object has failed.:



How can I ignore error messages? I tried it with $oMyError = ObjEvent("AutoIt.Error","nothing"), but it doesnt work. Any hints?

Best Regards


Share this post

Link to post
Share on other sites

If your looking to jump past the error, and move on to the rest of the script, then you minds well just take it out of your script...because that part of the script wont work either way...

[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...