Re: set Logon Script path to null
- From: "Joe Richards [MVP]" <humorexpress@xxxxxxxxxxx>
- Date: Sun, 24 Sep 2006 12:25:29 -0400
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?
- Prev by Date: Re: Question on reconciling members and memberof attributes
- Next by Date: Re: NETLOGONS and SYSVOL shares missing
- Previous by thread: Re: set Logon Script path to null
- Next by thread: Problem with Password Policy
- Index(es):
Relevant Pages
|