Re: set Logon Script path to null

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



admod -b user_dn scriptpath:-

If you wanted to do it based on user SAM Name...

adfind -gc -b -f samaccountname=xxx -dsq |admod scriptpath:-

If that matches more than one user it will clear them all. If you want to focus further you can specify an actual BASE DN to scope your query.

If you wanted to pass more than 10 users and have this done, make sure you specify the -safety xx switch or -unsafe switch for admod or else it will think there is a mistake and try to help you protect yourself.

joe

--
Joe Richards Microsoft MVP Windows Server Directory Services
Author of O'Reilly Active Directory Third Edition
www.joeware.net


---O'Reilly Active Directory Third Edition now available---

http://www.joeware.net/win/ad3e.htm


Sasi wrote:
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?
.



Relevant Pages

  • Re: set Logon Script path to null
    ... Look at the following sample on how to clear specific attributes in Active Directory using ADSI. ... Set objUser = GetObject _ ... 'Resetting User's Logon Script path to null so that it is never run again ... retriving command,an error occurs as "the Active Directory property cannot be ...
    (microsoft.public.windows.server.active_directory)
  • Re: Apple Mail & LDAP
    ... Where do you specify the domain name ... Is there a syntax to follow? ... >> clients using LDAP services for directory lookups. ... >> The problem is everytime I try to switch them to use Active Directory ...
    (microsoft.public.exchange.setup)
  • Re: Apple Mail & LDAP
    ... Where do you specify the domain name ... Is there a syntax to follow? ... >> clients using LDAP services for directory lookups. ... >> The problem is everytime I try to switch them to use Active Directory ...
    (microsoft.public.exchange.admin)
  • Re: Apple Mail & LDAP
    ... Where do you specify the domain name ... Is there a syntax to follow? ... >> clients using LDAP services for directory lookups. ... >> The problem is everytime I try to switch them to use Active Directory ...
    (microsoft.public.exchange.clients)
  • Re: Security/Restrictions
    ... You can specify a start program in the users properties in Active Directory ... Users and Computers, doing so the desktop will not be available to the ...
    (microsoft.public.windows.terminal_services)