Thank you a lot, I got some error & have some questions (There is no much examples about crateobject function in the board ).Following is what I did.
As I told you that The user who I want to disable/enable his account is in the following path (I got this path from the domain LAN administrator) LDAP://ABCD-00730-nd05.zain.com/CN=noor NIaa.,OU=Test,OU=Messaging,DC=zain,DC=com
$sysinfo = createobject("adsysteminfo")
$user = getobjec("LDAP://"+$sysinfo.username)
do I have to insert ABCD-00730-nd05.zain.com after LDAP:// ?
You said that .Username (property) will return current user name, actually I have a list of users accounts who I want to disable their accounts. My script is reading these account one by one and then I want to pass it to the disable/enable command. Should I search for each account in AD data base to get the path then disable/enable it?
I got this error “;Script error : unknown command !$user.AccountDisabled = 1”
How can I know the AD objects and properties for each abject? I searched in MSDN (msdn.microsoft.com/library) for ADO programmers guide, object model & reference and all what I found was about ActiveX.
Your support is highly appreciated.