Active Directory
--
Questions
--
Followers
Top Experts
Zero AI Policy
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
If they're all in the same OU are you aware that you can do this in AD Users and Computer?
Select them all (in AD Users and Computers), then Open the Properties then explicitly change those two (and only those two) by ticking the box beside them and setting the new value.
Of course we can do this in VbScript if you're after it doing something a bit more complex.
Chris
I have selected a few test users in AD and then click properties and I typed a new user profile path and home
profile path= \\serverX\profile\%usernam
home path=\\serverX\home\%usern
Also 1 would like to try dsquery..links that you type is not working.could you please write dsquery as detailed? what will I write the username place for every seperate user?






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
"Also 1 would like to try dsquery..links that you type is not working.could you please write dsquery as detailed? what will I write the username place for every seperate user?"
I just tested the links and both of them are live.
The special token $username$ (case insensitive) may be used to place the
SAM account name in the value of -webpg, -profile, -hmdir, and
-email parameter.
For example, if the target user DN is
CN=Jane Doe,CN=users,CN=microsoft,
attribute is "janed," the -hmdir parameter can have the following
substitution:
-hmdir \users\$username$\home
The value of the -hmdir parameter is modified to the following value:
- hmdir \users\janed\home
on tob,I have a one OU named XX,its further down,there are five OU structure named Xa,Xb,Xc,Xd,Xe..I would like to change only users' profile and home paths in the named Xd OU..how can I write ldap Query?
(LDAP://OU=XX,OU=Xd,DC=your
(LDAP://OU=Xd,,DC=yourdomai
That would change this line to:
Set objOU = GetObject("LDAP://OU=Xd,OU
It goes in reverse order, so domain.com/xx/xd in AD users and computers will become the above.
Chris

Get a FREE t-shirt when you ask your first question.
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
Set objOU = GetObject("LDAP://OU=Xd,OU
objOU.Filter = Array("user")
For Each objUser in objOU
objUser.Put "homeDirectory", "\\dc-srv-01\home$\" & objUser.Get("sAMAccountNam
objUser.Put "profilePath", "\\dc-srv-01\profile$\" & objUser.Get("sAMAccountNam
objUser.SetInfo
Next
the error> Line=2,Char=1, Error=A referral was returned from the server.Code=8007202B,Sourc
http://technet.microsoft.com/en-us/library/aa996216(EXCHG.65).aspx
download here
http://admodify.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=6065
That would suggest the path supplied is invalid (doesn't exist on the server you made the request to).
Trying to think of the easiest way to check the path...
If you have the Support Tools installed, open up ADSIEdit.msc (Start, Run). Then browse to the OU you want to make the changes to, open up the Properties and take a look at the "distinguishedName" attribute. The value there is the one we want to use in the script.
Chris






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
first, 1 tried Chris's vbscript and it didnt give me a error but nothing happened when 1 click on dc..no error,no message,no change
second,I tried xxdcmast's solution dsquery user "OU=Xd,OU=XX,DC=microsoft,
it works wihthout errors and it returned the following changes for each user on AD
profile=\\ds-srv01\profile
home=it didnt changed. why didnt it change? also it doesnt available drive name=H
it will be in this way
home folder=
connect=drive letter to=\\ds-srv01\profiles$\us
Active Directory
--
Questions
--
Followers
Top Experts
Active Directory (AD) is a Microsoft brand for identity-related capabilities. In the on-premises world, Windows Server AD provides a set of identity capabilities and services, and is hugely popular (88% of Fortune 1000 and 95% of enterprises use AD). This topic includes all things Active Directory including DNS, Group Policy, DFS, troubleshooting, ADFS, and all other topics under the Microsoft AD and identity umbrella.