|
server
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Log On To by script?
Can I reset log on to information (computers) by script?
Like Logon hours: Const ADS_PROPERTY_CLEAR = 1 Set objUser = GetObject _ ("LDAP://cn=MyerKen,ou=Management,dc=NA,dc=fabrikam,dc=com") objUser.PutEx ADS_PROPERTY_CLEAR, "logonHours", 0 objUser.SetInfo Milan wrote:
> Can I reset log on to information (computers) by script? That should work. I have to check if I have done it myself. Also, if that > > Like Logon hours: > Const ADS_PROPERTY_CLEAR = 1 > > Set objUser = GetObject _ > ("LDAP://cn=MyerKen,ou=Management,dc=NA,dc=fabrikam,dc=com") > > objUser.PutEx ADS_PROPERTY_CLEAR, "logonHours", 0 > objUser.SetInfo doesn't work, I think you can assign 0, which has the same affect. VBScript cannot assign any other values. And property name for "Log On To" is?
objUser.PutEx ADS_PROPERTY_CLEAR, "logonto", 0 Show quote "Richard Mueller [MVP]" wrote: > Milan wrote: > > > Can I reset log on to information (computers) by script? > > > > Like Logon hours: > > Const ADS_PROPERTY_CLEAR = 1 > > > > Set objUser = GetObject _ > > ("LDAP://cn=MyerKen,ou=Management,dc=NA,dc=fabrikam,dc=com") > > > > objUser.PutEx ADS_PROPERTY_CLEAR, "logonHours", 0 > > objUser.SetInfo > > That should work. I have to check if I have done it myself. Also, if that > doesn't work, I think you can assign 0, which has the same affect. VBScript > cannot assign any other values. > > -- > Richard Mueller > Microsoft MVP Scripting and ADSI > Hilltop Lab - http://www.rlmueller.net > -- > > > I found, that property name is
"userWorkstations" Show quote "Milan" wrote: > And property name for "Log On To" is? > objUser.PutEx ADS_PROPERTY_CLEAR, "logonto", 0 > > "Richard Mueller [MVP]" wrote: > > > Milan wrote: > > > > > Can I reset log on to information (computers) by script? > > > > > > Like Logon hours: > > > Const ADS_PROPERTY_CLEAR = 1 > > > > > > Set objUser = GetObject _ > > > ("LDAP://cn=MyerKen,ou=Management,dc=NA,dc=fabrikam,dc=com") > > > > > > objUser.PutEx ADS_PROPERTY_CLEAR, "logonHours", 0 > > > objUser.SetInfo > > > > That should work. I have to check if I have done it myself. Also, if that > > doesn't work, I think you can assign 0, which has the same affect. VBScript > > cannot assign any other values. > > > > -- > > Richard Mueller > > Microsoft MVP Scripting and ADSI > > Hilltop Lab - http://www.rlmueller.net > > -- > > > > > > The logonHours attribute is binary (byte array). The userWorkstations
attribute is a multivalued string (no values, one value, or more than one). I document most attributes of user objects in this link: http://www.rlmueller.net/UserAttributes.htm The first spreadsheet documents the attributes of user objects corresponding to the fields on most of the tabs of the properties dialog of ADUC. The second spreadsheet documents all attributes in a default installation of W2k AD. Show quote "Milan" <Mi***@discussions.microsoft.com> wrote in message news:F849F8B8-458D-4E6F-8BD3-035FFA24364F@microsoft.com... >I found, that property name is > "userWorkstations" > > "Milan" wrote: > >> And property name for "Log On To" is? >> objUser.PutEx ADS_PROPERTY_CLEAR, "logonto", 0 >> >> "Richard Mueller [MVP]" wrote: >> >> > Milan wrote: >> > >> > > Can I reset log on to information (computers) by script? >> > > >> > > Like Logon hours: >> > > Const ADS_PROPERTY_CLEAR = 1 >> > > >> > > Set objUser = GetObject _ >> > > ("LDAP://cn=MyerKen,ou=Management,dc=NA,dc=fabrikam,dc=com") >> > > >> > > objUser.PutEx ADS_PROPERTY_CLEAR, "logonHours", 0 >> > > objUser.SetInfo >> > >> > That should work. I have to check if I have done it myself. Also, if >> > that >> > doesn't work, I think you can assign 0, which has the same affect. >> > VBScript >> > cannot assign any other values. >> > >> > -- >> > Richard Mueller >> > Microsoft MVP Scripting and ADSI >> > Hilltop Lab - http://www.rlmueller.net >> > -- >> > >> > >> > |
|||||||||||||||||||||||