Solved

Script to check profile paths in AD

Posted on 2011-02-28
12
602 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 250 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 250 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
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 
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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Had a business requirement to store the mobile number in an environmental variable. This is just a quick article on how this was done.
Uncontrolled local administrators groups within any organization pose a huge security risk. Because these groups are locally managed it becomes difficult to audit and maintain them.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

690 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