Why?! So I can play locally without the need to spin up VMs. Of course being a desktop environment, I am shutting myself out of server-specific actions, but it’s fine for a sandbox. This post is just about the challenge of getting 2 boxes to talk to each other in PS.
Given 2 PCs on the same HomeGroup, it seems to me (“seems” because finding a definitive view is a challenge) that as long as you have created a local user on each PC with the same name and the same password (unlikely but bear with me), and with administrator rights, then both PSSession and DSC will work. I have proven it works. What is less clear is, for example, do I really need the same name and/or the same password. Certainly the password seems unlikely. You will need to invoke the -Credential switch because you are effectively cross-domain. Having HomeGroup file rights is a long way off having rights to unleash the full power of PSSession and DSC on an unwitting neighbour’s box. And BTW, in my experience, you need to use local users, not hotmail etc users, even thought Microsoft encourage you to use MS usernames on your W10 box.
There will be more on this, but right now, given a PC named “I7” and a PC “Dennis-PC”, and the built-in administrator user (I have proven it does not have to be that user), this is a simple DSC action to create a folder if it does not exist (i.e. so called “make-it-so”).
First the script. This is slightly modified from other posts in this blog to include the -Credential switch. Gist.
First execution – the folder does not exist, so it gets created. Note the references to the “pusher” dennis-pc, and the receiver/executor I7.
Second execution – the folder already exists, so DSC does nothing: