Jump to content
EduGeek EdSec 2026 is Go! 27th Oct in Derby! Join us for a day of EdTech security focused talks, networking, and an evening social ×

Recommended Posts

Posted

Hi there,

Some of our accounts have got screwed up for some reason. I know that there must be a way to add a user's "home path" to Z: \\server\username$ somehow, but I just can't find the command.

 

Must be a switch in "net user", but again I can't find it.

 

Anyone know how to do it?

 

Thanks!

Posted

This is a bit of my current script

 

for /f "tokens=1 delims=," %%1 in (2006.txt) do (

net user "%%1" /comment:"2006 Intake" /homedir:"\\server\%%1"$ /scriptpath: /profilepath:\\server\Profiles$\pupil

 

Just missing the "/homepath= whatever" bit

 

Thanks

Posted

run on each OU

 

set objParent = GetObject("LDAP://ou=year group,DC=example,DC=college,DC=org")

Set shell = CreateObject("WScript.Shell")

objparent.Filter = Array("user")



for each objUser in objParent







   	objUser.put "homedrive", "Z:"

  	objuser.HomeDirectory = "\\server\" & objUser.get("sAMAccountName") 

 

			




objuser.Setinfo

   

next





Wscript.Echo "Done"

  • Thanks 1
Posted
You can select them all in ADUC and change them all at the sametime.

 

\\servername\%username%$

 

 

Doh!

Yes, thanks - did that. Can't believe I forgot that - early term pressure :)

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...