I am trying to fill in the fields of the address tab for users' properties in AD. Everything is working fine except for the country field. I get -2147016657 as err.number. Here's basically what I've got:
Option explicit
Const INPUT_FILE_NAME = "C:\Scripts\WMI\Testers\emplist1.txt"
Const COUNTRY = "United States"
Dim strLastName, strFirstName, strName, strExt, strTitle, strSubTitle, strDept
Dim objFSO, objFile, strLine, arrEmployees, i, k, l, strPhone, objUser
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(INPUT_FILE_NAME, FOR_READING)
Do Until objFile.AtEndOfStream
strLine = objFile.ReadLine
'****************************************************
' Process each employee
'****************************************************
Set objUser = GetObject("LDAP://CN=" & strName & _
",OU=XPUsers,DOMAIN INFo HERE")
objUser.Put "c", COUNTRY
objUser.SetInfo
if err<>0 then
wscript.echo err.number
err.clear
end if
Loop
objFile.Close
Set objUser = Nothing
Thanks in advance for your help and have a great day!
jazzfan
Option explicit
Const INPUT_FILE_NAME = "C:\Scripts\WMI\Testers\emplist1.txt"
Const COUNTRY = "United States"
Dim strLastName, strFirstName, strName, strExt, strTitle, strSubTitle, strDept
Dim objFSO, objFile, strLine, arrEmployees, i, k, l, strPhone, objUser
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(INPUT_FILE_NAME, FOR_READING)
Do Until objFile.AtEndOfStream
strLine = objFile.ReadLine
'****************************************************
' Process each employee
'****************************************************
Set objUser = GetObject("LDAP://CN=" & strName & _
",OU=XPUsers,DOMAIN INFo HERE")
objUser.Put "c", COUNTRY
objUser.SetInfo
if err<>0 then
wscript.echo err.number
err.clear
end if
Loop
objFile.Close
Set objUser = Nothing
Thanks in advance for your help and have a great day!
jazzfan