Remotely Shutdown a computer attached to a Windows Domain

If you have sufficient rights to manage a remote computer over your company network, you can use this command from CMD.exe to remotely shutdown a computer.

Examples

shutdown /s /t 3600 /m \\COMPUTERNAME.YOURCOMPANYDOMAINNAME.net /c "Your computer is sleepy."

Issues the shutdown command to Shut down a computer in 3600 seconds, to the remote machine named \\COMPUTERNAME.YOURCOMPANYDOMAINNAME.net while displaying the reason to any logged on users as “Your computer is sleepy”.

shutdown /r /t 300 /m \\COMPUTERNAME.YOURCOMPANYDOMAINNAME.net

Restarts the remote computer in 300 seconds.

shutdown /a /m \\COMPUTERNAME.YOURCOMPANYDOMAINNAME.net

Immediately aborts the scheduled shutdown or reboot task if it is not yet happening.

Detailed Documentation from Microsoft

C:\Users\Administrator>shutdown /help
Usage: shutdown [/i | /l | /s | /r | /g | /a | /p | /h | /e] [/f]
[/m \\computer][/t xxx][/d [p|u:]xx:yy [/c "comment"]]

No args Display help. This is the same as typing /?.
/? Display help. This is the same as not typing any options.
/i Display the graphical user interface (GUI).
This must be the first option.
/l Log off. This cannot be used with /m or /d options.
/s Shutdown the computer.
/r Shutdown and restart the computer.
/g Shutdown and restart the computer. After the system is
rebooted, restart any registered applications.
/a Abort a system shutdown.
This can only be used during the time-out period.
/p Turn off the local computer with no time-out or warning.
Can be used with /d and /f options.
/h Hibernate the local computer.
Can be used with the /f option.
/e Document the reason for an unexpected shutdown of a computer.
/m \\computer Specify the target computer.
/t xxx Set the time-out period before shutdown to xxx seconds.
The valid range is 0-315360000 (10 years), with a default of 30.
If the timeout period is greater than 0, the /f parameter is
implied.
/c "comment" Comment on the reason for the restart or shutdown.
Maximum of 512 characters allowed.
/f Force running applications to close without forewarning users.
The /f parameter is implied when a value greater than 0 is
specified for the /t parameter.
/d [p|u:]xx:yy Provide the reason for the restart or shutdown.
p indicates that the restart or shutdown is planned.
u indicates that the reason is user defined.
If neither p nor u is specified the restart or shutdown is
unplanned.
xx is the major reason number (positive integer less than 256).
yy is the minor reason number (positive integer less than 65536).

Reasons on this computer:
 (E = Expected U = Unexpected P = planned, C = customer defined)
 Type Major Minor Title
U 0 0 Other (Unplanned)
 E 0 0 Other (Unplanned)
 E P 0 0 Other (Planned)
 U 0 5 Other Failure: System Unresponsive
 E 1 1 Hardware: Maintenance (Unplanned)
 E P 1 1 Hardware: Maintenance (Planned)
 E 1 2 Hardware: Installation (Unplanned)
 E P 1 2 Hardware: Installation (Planned)
 E 2 2 Operating System: Recovery (Planned)
 E P 2 2 Operating System: Recovery (Planned)
 P 2 3 Operating System: Upgrade (Planned)
 E 2 4 Operating System: Reconfiguration (Unplanned)
 E P 2 4 Operating System: Reconfiguration (Planned)
 P 2 16 Operating System: Service pack (Planned)
 2 17 Operating System: Hot fix (Unplanned)
 P 2 17 Operating System: Hot fix (Planned)
 2 18 Operating System: Security fix (Unplanned)
 P 2 18 Operating System: Security fix (Planned)
 E 4 1 Application: Maintenance (Unplanned)
 E P 4 1 Application: Maintenance (Planned)
 E P 4 2 Application: Installation (Planned)
 E 4 5 Application: Unresponsive
 E 4 6 Application: Unstable
 U 5 15 System Failure: Stop error
 U 5 19 Security issue
 E 5 19 Security issue
 E P 5 19 Security issue
 E 5 20 Loss of network connectivity (Unplanned)
 U 6 11 Power Failure: Cord Unplugged
 U 6 12 Power Failure: Environment
 P 7 0 Legacy API shutdown
Learn More

Troubleshooting Group Policy Object Application for Users and Computers

Microsoft Group Policy is powerful way to automate configuration of machines and user settings for anything attached to the domain. This article assumes you are familiar with Group Policy and the process of creating, editing, linking, and filtering those group policy objects.

Article Scope: This article is intended for System Administrators to help in diagnosis of Group Policy issues where the settings configured are not working as expected for a user, group, or computer object.

Problem Description: A computer or user is not inheriting the settings you are expecting that they should, from a given GPO.

Symptoms: The GPO has been in place longer than 24-48 hours, and the user should have the most recent group policy, but still isn’t getting the settings you expect.

Diagnosis: There are many steps for diagnosis. I will start with the more basic steps, and then get into the less-likely-but-more-complex aspects of troubleshooting. We will start with checking the state of how the clients are receiving their settings.

Check Client / User is able to receive the updated settings.

  1. Log onto the same computer as the user, and
Learn More

Compiling PHP with IMAP in DirectAdmin Custom Build

This is a quick guide on how to compile PHP with IMAP and SSL support for DirectAdmin Custom Build.

We will need to install additional libraries, change the build options for PHP5, and then recompile PHP. These instructions are for DirectAdmin 1.2.x and 1.3.x on CentOS 5 (x86-64). Use with caution.

Install needed libraries

yum install libc-client
 yum install libc-client-devel

Reconfigure CustomBuild PHP5 Configuration File

nano /usr/local/directadmin/custombuild/configure/ap2/configure.php5

Add the below lines to the configure.php5 file.

--with-imap=/usr/lib/dovecot/imap \
 --with-imap-ssl \

 

Recompile PHP5 with our customizations configure.php5

cd /usr/local/directadmin/custombuild/configure/ap2
./build php y

If all goes well, you will see it succeed without error.

Possible Error and Resolution:

Error: /usr/local/directadmin/custombuild/configure/ap2/configure.php5: line 31: –with-imap=/usr/lib/dovecot/imap: No such file or directory
*** There was an error while trying to configure php. Check the configure/ap2/configure.php5 file

To Resolve:

make sure that when you add the line to the configure.php5 that you add a trailing slash \ to the end of the line above it. (The second to last line, but not the last line itself).

for example,

--enable-mbstring

now becomes:

 --enable-mbstring \

Then save and call the build command once more.

Learn More

KSL.com Suggestion – Report Reverse Reply Spam

While KSL.com allows people viewing ads to report them, there is no mechanism to report spam sent via their built in “contact the seller” messaging service. Potentially anyone who has an account on KSL, can “reply” to a classified listing, and send spam to the original listing creator. It’s a process known as reverse-spamming. In a typical scenario, we might expect the classified listing itself to be the spam. However on legitimate postings, a spammer can capitalize on the concept known as in reverse-spam or reply-spam, where they use KSL.com as the means of relaying spam to the original classified lister. This is generally a successful technique for spammers because they are able to reach their target with 100% deliverability. Since the Email uses KSL.com’s email servers for delivery, it will inherit the reputation of their email servers when being processed at the recipients email server. Additionally, the spammer doesn’t actually have to know the target’s email address. They simply have to reply to a listing. An automated bot can crawl the site, and send off many replies with their spammed message in the content, and KSL.com will facilitate the delivery to their target, the lister.

My wish is that KSL.com would include an action on each email message sent out to the classifieds lister, where they could report the message as spam. Then they could track abusive users who are doing this reverse-spam methodology and address this problem to bring them in compliance with the CAN-SPAM Act.

Here’s a message I received on my auto listing. It’s obvious that this seller really didn’t want to look at my car.

wes stillman – <redacted>@gmail.com
I’m interested in your vehicle, I would like to look at it and take it for a test drive. Also I run a shutter company in salt lake called Stanfield Shutters we build custom shutters to fit any window no matter the shape or size of them, they come with a warranty. We also match any color or stain as well, would you be interested in trading shutters for the vehicle Thanks Wes

Learn More

Ten Second Mac OS X HTTP Server

Apple Macintosh OS X includes a little known python script which turns your computer into a basic web server. You can use this if you simply want to make an easy way to access files on your mac from another computer. Beware that as this is, there is no security for preventing anyone from connecting into the directory you’re sharing, so use it with caution, and always terminate the process / close it down when you’re done. Whatever directory you publish, will remain accessible with all files and folders within, until you terminate and close the process out. Use with caution.

How to setup an HTTP server on OS X in 10 seconds.

  1. Open Terminal
  2. Change to the directory where you want to serve up content from
    • cd /path/to/what/you/want/to/make/available
  3. Run the HTTP Server process via Python
    • sudo python -m SimpleHTTPServer 80

When you close the Terminal that spawned the python http server; you will end the process and terminate the http server.

Notes: Be mindful of anything you’re sharing as it could potentially be accessible to anyone on the network you are connected to as well as potentially the internet as well; so use with caution.

Learn More

Updating Ubuntu Kernel and Removing All Old Kernels

This is a quick guide on how to update your kernel and supporting header and image files, as well as clean out older ones to free up space on the boot partition. I have used this process and these specific commands on Ubuntu 10.04 through 14.04.

1. SSH in and switch user to get Root Access

sudo su

2. Update all packages

apt-get update;
apt-get upgrade;

3. Install any available kernel, image, and kernel headers packages.

Usually you will see a message stating that apt-get installed 0 items but three are available. You will have to manually type in apt-get install <package name> in order to do these updates. Just copy and paste the item names as you see from the output of apt-get.

4. Reboot

We need to make sure we’re running the most recent kernel and supporting files, especially if we just installed newer versions. We will then be able to remove the older ones.

reboot

5. Clean up any no longer needed packages and outdated versions

apt-get autoremove;
apt-get autoclean;

6. Remove remaining unused kernel packages.

This command checks for any existing but no longer used kernels, and deletes them. This prevents your boot partition from filling up with old kernels and supporting files. Use with care!

dpkg -l linux-* | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e [0-9] | xargs sudo apt-get -y purge
Learn More

Remove Exchange Attributes from All Users in Active Directory – Uninstall Exchange Server

If you are attempting to remove Exchange Server from your active directory, you will find that Exchange has created user account attributes that exist on all accounts even after deinstalling Exchange server. If you want to remove these attributes from all accounts, this is a command to do so.

Please take note that you would only ever use this if you have completely deinstalled Exchange from your domain and no longer need it. If you run this command, all accounts will lose their Exchange attributes. This WILL REMOVE Exchange settings for all user accounts. This command is very dangerous. Do not use it unless you know what you are doing. Any use of it is without warranty or liability on my part.

 

get-aduser -filter {msExchMailboxGuid -like “*”} | set-aduser -clear msExchMailboxGuid,msexchhomeservername,legacyexchangedn,mail,mailnickname,msexchmailboxsecuritydescriptor,msexchpoliciesincluded,msexchrecipientdisplaytype,msexchrecipienttypedetails,msexchumdtmfmap,msexchuseraccountcontrol,msexchversion

Learn More

The Difference Between Network Illiterates, Amateurs, and Admins

To solve network connectivity problems, network illiterates will turn off the firewall; network amateurs will open ports, but true network admins will create conditional firewall rules. – P. Tanner Williamson

Turning off a firewall is just a bad idea. While usually a basic starting step to confirm that it is the firewall that is blocking your application connectivity, leaving it off as a solution is a very bad practice. You should only turn it off long enough to confirm connectivity works when it is off. If connectivity still doesn’t work when it is off, then you may have a compounded networking / application issue, and it may not be the only point of failure.

Opening ports or port forwarding is typically a NAT feature. On home routers, that do not utilize a dedicated firewall feature, this may be the only option you have. However on a true enterprise grade firewall device where NAT and Firewall rules are configured separately, but conjunctively in order to set up traffic, you would want to take advantage of the firewall configuration and define specifically which sources and types of traffic can be forwarded through a port, rather than letting anyone from any IP come through a port.

Another concept to think about, is that firewalls don’t have to only exist at the edge of the network facing the internet. You can also place firewalls within the network, to isolate areas of the network from other areas, depending on how you have designed your network.

Learn More

Self-Signed SSL Certificates cause Mozilla Firefox to say The URL is invalid and cannot be loaded.

If you have Mozilla Firefox telling you the URL is Invalid and cannot be loaded, chances are your Firefox installation has corrupted. I had multiple devices on my network which use self-signed SSL certificates. I have previously allowed them.

Symptoms:

Bob on his userprofile can get to the SSL site just fine, but John on the same computer under a different profile can’t get there and is told the URL is invalid. Other browsers work just fine but Mozilla Firefox does not.

Solution:

You have to Uninstall Firefox completely, and delete all the folders it has created.

YOU WILL LOSE ALL YOUR SETTINGS, BOOKMARKS, SAVED PASSWORDS, etc. SO it is highly recommended that you make a system backup, and at minimum backup your bookmarks. Create a list of the plugins you have that you want to reinstall, and get your saved passwords somewhere safe. I recommend Xmarks to backup your bookmarks, and LastPass to backup your passwords.

  1. First, go to Programs Files and Programs Files (x86) and delete all Mozilla Folders. (Warning, this will delete any other programs that you have by Mozilla such as Thunderbird.)
  2. Now, go to C:\Users\YOUR-USERNAME\AppData\Local\ and delete Mozilla
  3. Again, go to C:\Users\YOUR-USERNAME\AppData\Roaming\ and delete Mozilla.
  4. Now, reinstall Mozilla Firefox, and this issue should be gone.
Learn More

Symantec Backup Exec Agent Installation Fails with Error Setup Already Running

Symptoms:

Remote Installation or Local of the Backup Exec agent fails.

 Install  — The job failed with the following error: Fatal error during installation.

OR

Unable to run Setup.exe. Another instance is already running. WARNING: Installation has been canceled.

Applies to:

Backup Exec 2008, 2010, 2012.

The Cause:

I found the solution to the problem. The root cause is that

Learn More