Are you trying to make a WIM file for deployment onto multiple other PCs? Because if so, you would need to have a multi user license for Windows to do this legally. As for is it possible, yes it is. This is how a lot of large enterprises image their computers. I personally do not have experience making the WIM (Windows Image file) but have installed them via disc and via PXE servers.
If you are wanting to make a backup of your current system config for rapid deployment of a reimage to your own PC, it would be doable and legal. If you attempted though to put that image onto another computer without the multi user license, it would be illegal.
Please give us a little more information on exactly what it is you are trying to do and we can help you more.
So you are wanting to make an image of PC #2 by slaving the drive to PC #1 and then reaplying the image to a new drive inside PC #2 again.
This can be done, but I don't know if it can be done with the integrated windows tools as I haven't played with them. Someone else has probably played around with it more than me and can answer this though.
Macrium reflect can do this. However, it is a complete copy of the drive including boot settings etc. If you have different specs on one computer than the other it will likely blue screen right away because of the driver differences. This isn't legal without a multiple computer license, so I will assume you are asking to get a backup for your current computer.