User Profile Service error

Recently I was domain joining a number of machines which had previously been a member of another domain. Some of the Windows 10 machines had been upgraded from Windows 7, and this left an issue in the Default profile which cause an error when creating a new profile.

This error occured when trying to log in with a domain user.

The solution is simple:

  1. Find a healthy Windows 10 machine, preferably one that has been originally installed with Windows 10
  2. Copy the folder “C:\users\Default” onto a USB-stick (or a file share)
  3. Log on the affected machine with a local admin account
  4. Backup (or rename) the exisiting Default folder (hint: it’s hidden)
  5. Copy the Default folder from your USB stick into “C:\users\” on the affected machine
  6. Try to log on with the domain user

I read a lot of suggested solutions to this issue, many requiring complex forensics into registry, and file analysis on the default and affected profiles. This is the only solution I was able to come up with which in my case had a 100% chance of success.

Making your (Powershell) job work for you

Jobs are a in many ways the key to Powershell multithreading. Having jobs running in the background not only allows you to keep working in your console while your script is silently churning away in the background, but it also lets you run multiple commands or scripts simultaneously executed from console.

When to use jobs

Whenever you’d like to run a command or a scriptblock without locking up your console, or when you’d like to run multiple commands simultaneously. Jobs are “fire and forget” tasks that you don’t review until they’ve completed or failed.

When not to use jobs

When running basic administration tasks where you’re reviewing output or the result of command continuously, or when working with result sets in variables where you’d like to keep reviewing the current value of the variable.

Ways to use jobs

There are two ways of using jobs in Powershell. First of all, many cmdlets have the parameter “-AsJob” to allow them run in the background directly. Alternatively you can use the cmdlet Start-Job to initiate a job with any cmdlet of combination of commands.

-AsJob

Some cmdlets that has the -AsJob parameter are:
Get-WmiObject
Invoke-Command
Invoke-WmiMethod
Remove-WmiObject
Restart-Computer
Set-WmiInstance
Stop-Computer
Test-Connection

If you like to find a more complete list, use the following command.

NB. Keep in mind that you need to load the modules your looking for commands in, in advance. Module autoloading doesn’t work when looking for parameters (Tested with Powershell 5.0 in Windows 10 Technical Preview)

Cmdlets

There are 4 cmdlets that are key to using Powershell jobs:

Start-Job

Starts a background job to execute one or more Powershell commands.

 Get-Job

Collects and lists the running and completed jobs currently in memory

 Receive-Job

Presents the result of a job to screen, or otherwise lets you collect or manipulate the result

 Remove-Job

Removes one or more jobs from memory

 Other useful cmdlets:

Suspend-Job: Pauses a job.
Resume-Job: Resumes a paused job.
Stop-Job: Stops a job.
Wait-Job: Suspends the command prompt until a job is finished, preventing you from making the input.

RSAT for Windows 10 Technical Preview

Those who have tried have failed. Installing Remote Server Admin Tools (RSAT) for Windows 8 on Windows 10 Technical Preview won’t work. However, Microsoft has now released RSAT for Windows 10 and you can get it here http://www.microsoft.com/en-us/download/details.aspx?id=44280