4

We have about 70 servers that we are in the process of moving into a domain environment, so we are converting our users from local accounts to domain controlled accounts. How can we determine which users may have files on their desktop or documents folder they may want to back up before their profile is deleted. As part of joining to the domain, the users will be converting to using a domain login, instead of local logins. The only people who would have been logging into these machine would have been specific technical staff running client specific configurations against specific targets.

I was thinking there might be a bit of powershell I could do here, but there might be issues with that.

The users profiles are indeed in C:\Users\\ so I could list those directories and loop them, but I suspect there's a better "Microsofty way" to look for those folders which aren't empty per user, then report the username and hostname for easy collation later in Excel.

Ideally the code would be run from one head-machine and collect details back from all the other machines using some of the newer (PS3?) powershell remoting techniques .. or some other instrumentation.

Thoughts?

This is my first attempt:

$Servers = @("localhost")
$Cred = Get-Credential

foreach ($Server in $Servers) {
    Invoke-Command -ComputerName $Server -Credential $Cred {
        $server
        @(GCI c:\Users\*\Desktop\. -Exclude *.lnk)
    }
}

I'm one of the users whose profile will be deleted and I don't know if I have files on one of the servers but I can get IT to run powershell against all the machines if I can get a concept of the code to run.

Edits made due to comments

2
  • 1
    1. Why would users have user profiles on servers? 2. Why would the profiles be deleted by joining the domain? The local user profiles will still exist after the domain join.
    – joeqwerty
    Jan 26, 2015 at 23:31
  • @joeqwerty because someone wants them to be deleted. But good question. As for 1), because sometime it is more advantageous for me to do things on the server. Someone has to make sure things work.
    – jcolebrand
    Jan 26, 2015 at 23:50

1 Answer 1

0

Migwiz is microsoft way. Delete each profile when they got migrated. I would not personnaly delete the profile, you put yourself the burden if you delete an important file.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .