Switching users in a remote PC with PowerShell
<p>So as the title self implies I'm trying to put together a PowerShell script so I can switch the user of multiple computers, from the primary server which is connected to all of them.</p>

<p>Currently, all devices have two users. </p>

<ol>
<li>Application </li>
<li>Admin</li>
</ol>

<p>By default, all computers are in the <strong>application</strong> user. So the idea is to have a <strong>TXT</strong> list, which would determine which ones to log off/sign in into the <strong>Admin</strong> user account.  </p>

<p>Currently I'm using: </p>

<pre><code>foreach ($_ in get-content .\CPUNameList.txt) 
{(gwmi win32_operatingsystem -ComputerName $_).Win32Shutdown(4)}
</code></pre>

<p>Which grabs from CPUNameList.txt, and logs off the stations. It works to log a bunch of them off, but i still need to go and log them all in. </p>

<p>Assuming the credentials for <strong>Admin</strong> is say, </p>

<p><strong>User:</strong> Admin
<strong>Pass:</strong> PASSWORD</p>

<p>How would we even go about doing this..? </p>

<p>Any help is appreciated :) </p>