<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>CMD | TekCookie</title>
	<atom:link href="https://tekcookie.com/category/cmd/feed/" rel="self" type="application/rss+xml" />
	<link>https://tekcookie.com</link>
	<description>Everything about IT</description>
	<lastBuildDate>Wed, 24 Nov 2021 14:24:27 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://i0.wp.com/tekcookie.com/wp-content/uploads/2021/06/cropped-TekCookie-211.png?fit=32%2C17&#038;ssl=1</url>
	<title>CMD | TekCookie</title>
	<link>https://tekcookie.com</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">174510684</site>	<item>
		<title>Execute PowerShell Remotely with PSEXEC</title>
		<link>https://tekcookie.com/execute-powershell-remotely-with-psexec/</link>
					<comments>https://tekcookie.com/execute-powershell-remotely-with-psexec/#respond</comments>
		
		<dc:creator><![CDATA[jeffythampi]]></dc:creator>
		<pubDate>Mon, 19 Oct 2020 13:37:52 +0000</pubDate>
				<category><![CDATA[CMD]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[connec to remote pc using psexec]]></category>
		<category><![CDATA[powershell-remoting]]></category>
		<category><![CDATA[psexec]]></category>
		<guid isPermaLink="false">https://tekcookie.com/?p=1742</guid>

					<description><![CDATA[PowerShell commands can be executed on a remote systems by using PowerShell-Remoting. By default, PowerShell remoting is disabled on clients operating systems. We can either enable PowerShell remoting by executing the command &#8220;Enable-PSRemoting -Force&#8221; under administrative context. This can be either done locally on each systems by executing the commands or remotely via a group [&#8230;]]]></description>
										<content:encoded><![CDATA[				<div class="wp-block-uagb-table-of-contents uagb-toc__align-left uagb-toc__columns-1  uagb-block-4f7ab2dc     "
					data-scroll= "1"
					data-offset= "30"
					style=""
				>
				<div class="uagb-toc__wrap">
						<div class="uagb-toc__title">
							Table Of Contents						</div>
																<div class="uagb-toc__list-wrap">
						<ol class="uagb-toc__list"><li class="uagb-toc__list"><a href="#interactive-powershell-prompt-with-psexec" class="uagb-toc-link__trigger">Interactive Powershell prompt with PSExec</a><li class="uagb-toc__list"><a href="#execute-multiple-powershell-commands-with-psexec" class="uagb-toc-link__trigger">Execute multiple Powershell commands with PSExec</a><li class="uagb-toc__list"><a href="#execute-multiple-powershell-commands-with-psexec" class="uagb-toc-link__trigger">Execute multiple Powershell commands with PSExec</a></ol>					</div>
									</div>
				</div>
			


<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<p>PowerShell commands can be executed on a remote systems by using PowerShell-Remoting. By default, PowerShell remoting is disabled on clients operating systems.</p>



<p>We can either enable PowerShell remoting by executing the command &#8220;Enable-PSRemoting -Force&#8221; under administrative context. This can be either done locally on each systems by executing the commands or remotely via a group policy or through SCCM.</p>



<p>But if we have administrative access to a system, we can execute PowerShell commands remotely by means of PSEXEC.EXE (https://docs.microsoft.com/en-us/sysinternals/downloads/psexec)</p>



<p>PSEXEC shell does not work well (interactively) with PowerShell as it works with cmd commands.</p>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">Interactive Powershell prompt with PSExec </h2>



<p>In windows 10, the interactive part is much better.</p>



<p>Enabling PowerShell Remoting using PSEXEC</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash">#cmd.exe in the administrative context
#navigate to the sysinternals tools folder or add the folder to the PATH
#executing the below command would take us to the powershell prompt of the remote system
psexec.exe \\&lt;computerName powershell.exe

#run the below command to enable PS Remoting or any commands as we wish
Enable-PSRemoting -Force</code></pre>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading"> Execute multiple Powershell commands with PSExec </h2>



<p>So, rather than going with interactive way, we can also issue a single command to do the same task</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash">#navigate to the sysinternals suite folder, to directly execute from the prompt, add the folder to the PATH
psexec.exe \\&lt;computerName&gt; powershell.exe -command "&amp; {Enable-PSRemoting -Force}"</code></pre>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">Execute multiple Powershell commands with PSExec</h2>



<p>We can also execute multiple commands as a single statement</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash">#navigate to the sysinternals suite folder, to directly execute from the prompt, add the folder to the PATH
psexec.exe \\&lt;computerName&gt; powershell.exe -command "&amp; {Get-Process; Get-service; $num1 = 2; $num2 = 1; $num1 + $num2}"</code></pre>



<div style="height:30px" aria-hidden="true" class="wp-block-spacer"></div>



<p>Also, please have a look at my other post about PSEXEC</p>



<figure class="wp-block-embed is-type-wp-embed is-provider-tekcookie wp-block-embed-tekcookie"><div class="wp-block-embed__wrapper">
<blockquote class="wp-embedded-content" data-secret="3LKc5DQQbg"><a href="https://tekcookie.com/control-remote-windows-system-with-command-line-psexec/">Control remote windows system with command line &#8211; PSEXEC</a></blockquote><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  title="&#8220;Control remote windows system with command line &#8211; PSEXEC&#8221; &#8212; TekCookie" src="https://tekcookie.com/control-remote-windows-system-with-command-line-psexec/embed/#?secret=3LKc5DQQbg" data-secret="3LKc5DQQbg" width="600" height="338" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
</div></figure>



<div style="height:30px" aria-hidden="true" class="wp-block-spacer"></div>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>Hope you liked this article and thank you for reading</p></blockquote>



<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://tekcookie.com/execute-powershell-remotely-with-psexec/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1742</post-id>	</item>
		<item>
		<title>Control remote windows system with command line &#8211; PSEXEC</title>
		<link>https://tekcookie.com/control-remote-windows-system-with-command-line-psexec/</link>
					<comments>https://tekcookie.com/control-remote-windows-system-with-command-line-psexec/#respond</comments>
		
		<dc:creator><![CDATA[jeffythampi]]></dc:creator>
		<pubDate>Tue, 18 Jun 2019 05:50:03 +0000</pubDate>
				<category><![CDATA[CMD]]></category>
		<category><![CDATA[Remoting]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[connec to remote pc using psexec]]></category>
		<category><![CDATA[connect remote windows system]]></category>
		<category><![CDATA[psexec]]></category>
		<guid isPermaLink="false">https://adminscripter.wordpress.com/?p=66</guid>

					<description><![CDATA[PsExec is a light-weight telnet-replacement to execute processes on other systems, without having to manually install client software. But beware of some antivirus software&#8217;s, they may flag it. Connect to remote cmd prompt ? And the best part, PsExec can run the process with system account !!! WoW Change local user password in more than [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>PsExec is a light-weight telnet-replacement to execute processes on other systems, without having to manually install client software. But beware of some antivirus software&#8217;s, they may flag it.</p>



<p>Connect to remote cmd prompt ?</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash"># Below command connect to remote system in interactive mode through cmd
psexec.exe  \\pcname  cmd
</code></pre>



<pre class="wp-block-verse">And the best part, PsExec can run the process with system account !!! WoW</pre>



<p class="has-text-align-left">Change local user password in more than one computer</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash"># Create a file with computer names and execute the below command to change admin password in remote systems

psexec.exe  @pcname.txt  cmd /c "net user administrator complexpassword123:)"</code></pre>



<p>The dangerous one &#8211; Runs in all system within the domain</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash"> psexec.exe  \*  cmd /c "net user administrator complexpassword123:)" </code></pre>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p><strong>Hope you like this article and thank you for reading.</strong></p></blockquote>
]]></content:encoded>
					
					<wfw:commentRss>https://tekcookie.com/control-remote-windows-system-with-command-line-psexec/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">66</post-id>	</item>
	</channel>
</rss>
