<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">hello to all <br><br>i have been using this script to add users to my active directory structure<br><br>i wise to make a loop in order for it to run for A large Number of Users <br><br>can anyone give me some advice on the loop ??<br><br><br><br>import win32com,win32com..client<br>def add_acct(location,account):<br>    <br>  ad_obj=win32com.client.GetObject(location)<br>  ad_user=ad_obj.Create('user','cn='+user['login'])<br>  ad_user.Put('sAMAccountName',user['login'])<br>  ad_user.Put('userPrincipalName',user['login']+'@email.address.com')<br>  ad_user.Put('DisplayName',user['last']+' '+user['first']) #fullname<br>  ad_user.Put('givenName',user['first'])<br>  ad_user.Put('sn',user['last'])<br>  ad_user.Put('description','regular account')<br>  ad_user.Put('physicalDeliveryOfficeName','office
 1')<br>  ad_user.Put('HomeDirectory',r'\\server1\ '[:-1]+user['login']) <br>  ad_user.Put('HomeDrive','H:')<br>  ad_user.SetInfo();ad_user.GetInfo()<br>  ad_user.LoginScript='login.bat'<br>  ad_user.AccountDisabled=0<br>  ad_user.setpassword('the password')<br>  ad_user.Put('pwdLastSet',0) #-- force reset of password<br>  ad_user.SetInfo()<br><br><br>location='LDAP://OU=sales,DC=shay,DC=com'<br>user={'first':'shay','last':'smith','login':'shay123'}<br>add_acct(location,user)<br><br><br>location='LDAP://OU=sales,DC=shay,DC=com'<br>user={'first':'ron','last':'smith','login':'ron1267'}<br>add_acct(location,user)<br><br></td></tr></table><br>