Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Vb script for Homedrv for multiple users .

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,54640
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Vb script for Homedrv for multiple users .
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Vb script for Homedrv for multiple users . - 12/20/2007 8:24:52 AM   
  Athar0229

 

Posts: 8
Score: 0
Joined: 10/24/2007
Status: offline
Hi,

I had a script that change the Home directory for mutiple users in the OU , But the only thing that i cannot figured out in this script is to How to Put the
$ after username for Ex .. We have a user with a username of JOHN and his home directory look like \\Servername\JOHN$ .. So the only thing i cannot figured out
in this script to to put the $ after the username .. Thanks if anyone can help. Here is my script

set objParent = GetObject(LDAP://(parentou))
objParent.Filter = Array("user")
for each objUser in objParent
   Wscript.Echo "Modifying " & objUser.Get("sAMAccountName")
   objUser.HomeDirectory = "\\Servername\" & _
                           objUser.Get("sAMAccountName")
   objUser.Put "homeDrive", "P:"
   objUser.SetInfo
Next
 
 
Post #: 1
 
 RE: Vb script for Homedrv for multiple users . - 12/20/2007 8:31:49 AM   
  ebgreen


Posts: 5250
Score: 31
Joined: 7/12/2005
Status: offline
objUser.HomeDirectory = "\\Servername\" & _
                          objUser.Get("sAMAccountName") & "$"

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to Athar0229)
 
 
Post #: 2
 
 RE: Vb script for Homedrv for multiple users . - 12/20/2007 8:48:44 AM   
  Athar0229

 

Posts: 8
Score: 0
Joined: 10/24/2007
Status: offline
Thanks for your quick response it works...

(in reply to ebgreen)
 
 
Post #: 3
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Vb script for Homedrv for multiple users . Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts