Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Script to check profile paths in AD

Posted on 2011-02-28
12
Medium Priority
?
606 Views
Last Modified: 2012-05-11
Dear all,

We are currently moving all profiles from one server to another but i need to check which users in active directory still have there profile paths set to the old server.

Do anyone have a script that could show me a print out of who still have there profile path set to the old server?

Thanks,

Lyon
0
Comment
Question by:LyonJay
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 3
12 Comments
 
LVL 39

Accepted Solution

by:
Krzysztof Pytko earned 1000 total points
ID: 34995990
You can simply use Microsoft DS Tools. On a DC or workstation with Administrative Tools/RSAT installed type in command-line:

dsquery user -name * -limit 0 | dsget user -fn -ln -samid -hmdir | find /i "oldServerName"

Regards,
Krzysztof
0
 
LVL 74

Assisted Solution

by:Glen Knight
Glen Knight earned 1000 total points
ID: 34995999
how about something like:

CSVDE -f C:\PROFILES.CSV -l "profilepath"

This will export the DN and the profile path to a CSV file.
0
 
LVL 3

Author Comment

by:LyonJay
ID: 34996024
Where would i run them querys from?

Thanks,

Lyon
0
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
LVL 74

Expert Comment

by:Glen Knight
ID: 34996027
both from a command prompt.
0
 
LVL 39

Expert Comment

by:Krzysztof Pytko
ID: 34996028
it's also good example :)

There is many ways for that :) PowerShell, CSVDE, LDIFDE, DS Tools, ADFind aso.
Usage depends on user preferences, I prefer using DS Tools :)

Krzysztof
0
 
LVL 3

Author Comment

by:LyonJay
ID: 34996041
Thanks guy!

Will have a go and get back to you!
0
 
LVL 3

Author Comment

by:LyonJay
ID: 34996058
demazter,

your query just errored out.

Thanks,

Lyon
0
 
LVL 74

Expert Comment

by:Glen Knight
ID: 34996063
possibly you don't have permissions to C:

take the c:\ off.

Try:

CSVDE -f PROFILES.CSV -l "profilepath"
0
 
LVL 74

Expert Comment

by:Glen Knight
ID: 34996066
the -l is a lowercase L not an i.
0
 
LVL 3

Author Comment

by:LyonJay
ID: 34996112
That didnt work.

Thanks,

Lyon
0
 
LVL 74

Expert Comment

by:Glen Knight
ID: 34996114
odd, what's the error you are getting?
0
 
LVL 39

Expert Comment

by:Krzysztof Pytko
ID: 34996125
and where you are typing this command? I would suggest doing that on a DC :)

Krzysztof
0

Featured Post

Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This process allows computer passwords to be managed and secured without using LAPS. This is an improvement on an existing process, enhanced to store password encrypted, instead of clear-text files within SQL
In the absence of a fully-fledged GPO Management product like AGPM, the script in this article will provide you with a simple way to watch the domain (or a select OU) for GPOs changes and automatically take backups when policies are added, removed o…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question