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