Solved

Script to check profile paths in AD

Posted on 2011-02-28
12
597 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
  • 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
 
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
Do email signature updates give you a headache?

Do you feel like all of your time is spent managing email signatures? Too busy to visit every user’s desk to make updates? Want high-quality HTML signatures on all devices, including on mobiles and Macs? Then, let Exclaimer solve all your email signature problems today!

 
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Welcome to my series of short tips on migrations. Whilst based on Microsoft migrations the same principles can be applied to any type of migration. My first tip is around source server preparation. No migration is an easy migration, there is a…
[b]Ok so now I will show you how to add a user name to the description at login. [/b] First connect to your DC (Domain Controller / Active Directory Server) SET PERMISSIONS FOR SCRIPT TO UPDATE COMPUTER DESCRIPTION TO USERNAME 1. Open Active …
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

706 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now