Solved

Script to check profile paths in AD

Posted on 2011-02-28
12
599 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Mapping Drives using Group policy preferences Are you still using old scripts to map your network drives if so this article will show you how to get away for old scripts and move toward Group Policy Preference for mapping them. First things f…
This script can help you clean up your user profile database by comparing profiles to Active Directory users in a particular OU, and removing the profiles that don't match.
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…
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

821 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