G
Guest
How can I set some user Account's "logon script" property in Active Directory
to null?
this is the script I've written:
'Retrieve Current User's LDAP path
Set objSysInfo = CreateObject("ADSystemInfo")
strUserAdsPath = objSysInfo.UserName
'Binding to Current User's account object in Active Directory
Set objUser = GetObject("LDAP://" & strUserAdsPath )
'Resetting User's Logon Script path to null so that it is never run again
strNewScriptPath = vbNullString
objUser.Put "scriptpath", strNewScriptPath
objUser.SetInfo
at the SetInfo line,I get this error:
"The attribute syntax specified to the directory service is invalid" code
8007200B
already tried "" instead of vbNullString;no Luck.
also tried retriving logon script path from a user whose property is null
already,and putting it instead of vbNullString;but when it reaches to the
retriving command,an error occurs as "the Active Directory property cannot be
found in the cache" Code 8000500D.
what's wrong and how can I fix it?
to null?
this is the script I've written:
'Retrieve Current User's LDAP path
Set objSysInfo = CreateObject("ADSystemInfo")
strUserAdsPath = objSysInfo.UserName
'Binding to Current User's account object in Active Directory
Set objUser = GetObject("LDAP://" & strUserAdsPath )
'Resetting User's Logon Script path to null so that it is never run again
strNewScriptPath = vbNullString
objUser.Put "scriptpath", strNewScriptPath
objUser.SetInfo
at the SetInfo line,I get this error:
"The attribute syntax specified to the directory service is invalid" code
8007200B
already tried "" instead of vbNullString;no Luck.
also tried retriving logon script path from a user whose property is null
already,and putting it instead of vbNullString;but when it reaches to the
retriving command,an error occurs as "the Active Directory property cannot be
found in the cache" Code 8000500D.
what's wrong and how can I fix it?