Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

remove user Home folder in AD 1

Status
Not open for further replies.

vtfglc

Technical User
Sep 30, 2003
19
CH
Hello
here is my problem. I have more than 400 users who have a home directory mapped by using their AD properties (tab profile --> Home folder --> \\server\share).
For several reasons, I want to map their Home folder only by using the login script and therefore, remove these settings in the Active Directory.I want the radio button "local path" to be check instead of the 2 others,
I tried to write a script to do that without success.
I tried:

objUser.Put "homeDirectory",vbNullString
objUser.Put "homeDrive",vbNullString
objUser.SetInfo
'OR

objUSer.PutEx ADS_PROPERTY_CLEAR,"homeDirectory",vbNullString
objUser.PutEx ADS_PROPERTY_CLEAR,"homeDrive", vbNullString
'OR
objUser.PutEx ADS_PROPERTY_DELETE,"homeDirectory", vbNullString
objUser.PutEx ADS_PROPERTY_DELETE,"homeDrive", vbNullString

If you have any idea, it would be more than welcomed!
 
Hello vtfglc,

Have you defined constant explicitly:
[tt]
const ADS_PROPERTY_CLEAR=1
[/tt]
After the .PutEx, you have to ritually .setInfo as well.

regards - tsuji
 
a note on the mapping of homedrives not via AD.
i presonally prefer to use the same approach as you, use a logonscript to map home directories.
however, last week i had to update our logonscripts to include a function to create %homeshare% and %homedrive% environment variables. when you map the home drive via AD you get these environment variables set. evidently some applications like to write information using these environment variables, in our case citrix
 
to tsuji:
shame on me!! I had forgotten the .setinfo!!

objUSer.PutEx ADS_PROPERTY_CLEAR,"homeDirectory",vbNullString
objUser.PutEx ADS_PROPERTY_CLEAR,"homeDrive", vbNullString
objuser.setInfo

and it works!!
thanks for you help!!

to mrmovie:
thanks for your post. That's interesting and I have to check this problem.
 
to tsji:
shame on me! I had forgotten the .setinfo. it's working fine with it.
objUSer.PutEx ADS_PROPERTY_CLEAR,"homeDirectory",vbNullString
objUser.PutEx ADS_PROPERTY_CLEAR,"homeDrive", vbNullString
'OR
objuser.setinfo

Thanks for your help!!

to mrmovie:
thanks for your post. That's an interesting remark and i have to check this problem!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top