glennda Posted March 4, 2010 Posted March 4, 2010 I am looking into ways to try and reduce the load for this stupid controlled assessment coursework thing where they can have nothing apart from word or something like that. I am trying to set up a way that i can batch file for each class so we can schedule a job to enable/disable the accounts. I am trying to do this via Net user but its a long time since i used it and i think i have the syntax wrong although i am reading it off the microsoft website! i am trying net user %username% /domain.local /active:yes obviously substituting %username% with the kids username am i just being really stupid or is not?
bio Posted March 5, 2010 Posted March 5, 2010 Do this from a domain pc where you are domain admin the correct syntax = net user username /DOMAIN /Active:NO bio.. 2
srochford Posted March 5, 2010 Posted March 5, 2010 key thing which isn't always obvious is that you don't put the name of the domain -ie it's just "/domain" not "/name.of.my.domain" Excel is your friend here - get a list of usernames in column A and then in B1 put: ="net user " & A1 & " /domain /active:no" fill down, copy and paste the contents of column B into notepad save as a batch file and job done. When you want to reverse it, just put "/active:yes" in the formula and job done :-) 1
smadison Posted March 5, 2010 Posted March 5, 2010 We have a profile where they only have access to MS Office and time restrict the accounts and appears to work here. We call the profile "The Doghouse".
glennda Posted March 5, 2010 Author Posted March 5, 2010 We have a profile where they only have access to MS Office and time restrict the accounts and appears to work here. We call the profile "The Doghouse". This is how i have set it up but the i cannot set it up via AD for time restrictions as we have a 2 week timetable and would mean changing it each week which i can't be bothered - was going to run the script a couple of mins before the lesson then the opersite after each lesson. I knew i was doing something stupid ill give it a go... first to set up assembly!!
mac_shinobi Posted March 5, 2010 Posted March 5, 2010 key thing which isn't always obvious is that you don't put the name of the domain -ie it's just "/domain" not "/name.of.my.domain" Excel is your friend here - get a list of usernames in column A and then in B1 put: ="net user " & A1 & " /domain /active:no" fill down, copy and paste the contents of column B into notepad save as a batch file and job done. When you want to reverse it, just put "/active:yes" in the formula and job done :-) or use your favourite scripting language ( vbscript ) and save that as a csv and you can use vbscript to go through each value of the csv file and execute each of those as commands ? Maybe have a boolean type variable that you can set to yes or no and you just have an input box and either type yes or no for the active part of the command ??
glennda Posted March 5, 2010 Author Posted March 5, 2010 I would do it like that but i am trying to set it up so that i don't have to do anything! i am just going to set up class scripts that enable the account a min before the beginning of the lesson then disable them again at the end of the lesson also im going to try and experiment with adding them into my Exam internet group and then removing them from it so i have nothing to remember to do as i am not very good at remembering! Toby
mac_shinobi Posted March 5, 2010 Posted March 5, 2010 I would do it like that but i am trying to set it up so that i don't have to do anything! i am just going to set up class scripts that enable the account a min before the beginning of the lesson then disable them again at the end of the lesson also im going to try and experiment with adding them into my Exam internet group and then removing them from it so i have nothing to remember to do as i am not very good at remembering! Toby just thought - can't you do this in active directory assuming you have the OU's setup correctly you could multi select the users and either disable them enable them or I think there is a section somewhere that you can set times of when they can log in and are allowed to use the account HOW TO: Limit User Logon Time in a Domain in Windows Server 2003
glennda Posted March 5, 2010 Author Posted March 5, 2010 just thought - can't you do this in active directory assuming you have the OU's setup correctly you could multi select the users and either disable them enable them or I think there is a section somewhere that you can set times of when they can log in and are allowed to use the account HOW TO: Limit User Logon Time in a Domain in Windows Server 2003 problem with that is it is over a two week period so would require changing on a friday for the next week with scheduled tasks i can get them set up now for the next 2 months rather then keep having to change. the teachers have given me a timetable of when the students will be allowed internet etc. but the select all enable/disable still means i have to be at my pc at the time. only downside of the scheduled tasks is if server goes down but then they dids wouldnt be able to access work anyway as i am going to do it from the server server with exam shares on
mac_shinobi Posted March 5, 2010 Posted March 5, 2010 I would do it like that but i am trying to set it up so that i don't have to do anything! i am just going to set up class scripts that enable the account a min before the beginning of the lesson then disable them again at the end of the lesson also im going to try and experiment with adding them into my Exam internet group and then removing them from it so i have nothing to remember to do as i am not very good at remembering! Toby Not tried it but you might be able to make the one script toggle the yes or no option so if they are set to no then it will toggle it to yes and visa versa so you dont have to specify the option. Would be nice if I could have a look into this later on - good time to setup a server 2003 vm and have a prat about.
jcs808 Posted March 5, 2010 Posted March 5, 2010 I've been using the dsmod user command in a .bat which I then schedule to run on a DC, one .bat file to enable the accounts and another to disable them.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now