How to use psexec to remotely update machines time (from domain)?

In my previous posts you can find info how to install psexec. When you’re already done with this process, you can start updating clock settings on remote machines.

Set time

psexec64 -s /user:domain\user -i \\remote_ip net time \\domain_controller /set /y

Will output:

Bieżąca godzina na \\domain_controller to 2018-08-28 09:55:00.

At least in polish Windows 😀

Check time

psexec64 -s /user:domain\user -i \\remote_ip cmd /c time /t

Will output:

11:18

And remember good IT specialist is lazy specialist! Do not go anywhere! Eat ya buritos.

Znalezione obrazy dla zapytania fat guy computer

Use psexec to troll your work colleagues

If you’re an admin in a windows environment you can troll your friends a little bit 🙂

Install psexec and use bellow command to run Rick Astley’s famous “sweet troll of mine” on a remote computer (background, no window!).

psexec64 -s /user:domain\user -i \\xxx.xxx.xxx.xxx "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --app="https://youtu.be/dQw4w9WgXcQ"

xxx.xxx.xxx.xxx – stands for an ip number of a trolled person.

PS. Make sure you’re using psexec64 not psexec because it may not work on modern systems (tested on Windows 10).

How to change priority on Windows scheduled task using Powershell?

By default Windows setups task priority in scheduler to 7 (which is kinda low). The side effect of this is that for eg. backups are taking very long to take. In my case all databases were backed up in about 40-50 minutes…

Continue reading How to change priority on Windows scheduled task using Powershell?

How to force https on IIS webiste?

Edit web.config file in your website directory and carefully add this lines (remember to change domain name):


File: web.config
----------------

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="Force HTTPS" stopProcessing="true">
                    <match url="^(.*)$" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                        <add input="{HTTPS}" pattern="^OFF$" />
                    </conditions>
                    <action type="Redirect" url="https://website.com/{R:1}" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>