• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 608
  • Last Modified:

Script to check profile paths in AD

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
LyonJay
Asked:
LyonJay
  • 5
  • 4
  • 3
2 Solutions
 
Krzysztof PytkoActive Directory EngineerCommented:
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
 
Glen KnightCommented:
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
 
LyonJayAuthor Commented:
Where would i run them querys from?

Thanks,

Lyon
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Glen KnightCommented:
both from a command prompt.
0
 
Krzysztof PytkoActive Directory EngineerCommented:
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
 
LyonJayAuthor Commented:
Thanks guy!

Will have a go and get back to you!
0
 
LyonJayAuthor Commented:
demazter,

your query just errored out.

Thanks,

Lyon
0
 
Glen KnightCommented:
possibly you don't have permissions to C:

take the c:\ off.

Try:

CSVDE -f PROFILES.CSV -l "profilepath"
0
 
Glen KnightCommented:
the -l is a lowercase L not an i.
0
 
LyonJayAuthor Commented:
That didnt work.

Thanks,

Lyon
0
 
Glen KnightCommented:
odd, what's the error you are getting?
0
 
Krzysztof PytkoActive Directory EngineerCommented:
and where you are typing this command? I would suggest doing that on a DC :)

Krzysztof
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 5
  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now