How to enable RDP remotely with psexec pstools

How to enable RDP remotely with psexec pstools

If a computer is powered up on your network, but RDP is not enabled, you can create a group policy to enable RDP, and then restart the computer. Or instead, you can use psexec to remotely enable RDP.

Below are a couple one-line scripts to enable RDP on a remote computer from a different computer on the same domain. Keep in mind you need to be an administrator and you will only enable RDP for yourself, not an entire security group.

  1. Download the pstools to your computer from the sysinternals download site here and unzip them into a folder named pstools at the root of your c: drive.
  2. Open the command prompt as administrator.
  3. Change directory into c:\pstools (where the pstools files are located) then run the command:
psexec64 -u domain\administrator -p "P@ssw0rd" \\remotecomputername.domain.com reg add "hklm\system\currentcontrolset\control\terminal server" /f /v fDenyTSConnections /t REG_DWORD /d 0

4. Run another command to open the required ports in the firewall on the remote machine

psexec64 -u domain\administrator -p "P@ssw0rd" \\remotecomputername.domain.com netsh firewall set service remoteadmin enable

5. RDP into the remote machine with mstsc.exe successfully, and that’s it!

Powershell – remotely copy multiple files to a list of computers

How to copy multiple files to a list of computers

PowerShell – copy a list of files to a list of multiple computers

Here is a simple PowerShell script I found (linked below) that can easily copy a list of files to a list of computers. If you want to copy more than one file to a lot of computers on your network, this simple script should work ok. It’s better to use a network share and use a UNC path to denote where the file source and destinations.

$a = Get-Content "C:\computerlist.txt" 

foreach ($i in $a) 

{$files= get-content "C:\fileslist.txt"
foreach ($file in $files)
{Copy-Item $file -Destination \\$i\C$\admin\ -force}
}

Here is a sample of what the computerlist.txt will look like:

hostname1.contoso.com
hostname2.contoso.com
hostname3.contoso.com

And here is a sample of what the fileslist.txt will look like:

\\fileserver\share\IT\myscript.ps1
\\fileserver\share\IT\Readme.txt
\\fileserver\share\IT\uninstall.bat

 

https://social.technet.microsoft.com/Forums/office/en-US/09575f93-7b17-4621-804d-4b018df34771/powershell-copy-a-list-of-files-to-multiple-servers-and-backup-exisiting-files?forum=winserverpowershell

 

 

Powershell – remotely copy multiple files to a list of computers

How to copy multiple files to a list of computers

PowerShell – copy a list of files to a list of multiple computers

Here is a simple PowerShell script I found (linked below) that can easily copy a list of files to a list of computers. If you want to copy more than one file to a lot of computers on your network, this simple script should work ok. It’s better to use a network share and use a UNC path to denote where the file source and destinations.

$a = Get-Content "C:\computerlist.txt" 

foreach ($i in $a) 

{$files= get-content "C:\fileslist.txt"
foreach ($file in $files)
{Copy-Item $file -Destination \\$i\C$\admin\ -force}
}

Here is a sample of what the computerlist.txt will look like:

hostname1.contoso.com
hostname2.contoso.com
hostname3.contoso.com

And here is a sample of what the fileslist.txt will look like:

\\fileserver\share\IT\myscript.ps1
\\fileserver\share\IT\Readme.txt
\\fileserver\share\IT\uninstall.bat

https://social.technet.microsoft.com/Forums/office/en-US/09575f93-7b17-4621-804d-4b018df34771/powershell-copy-a-list-of-files-to-multiple-servers-and-backup-exisiting-files?forum=winserverpowershell

How to format a large external usb hard drive for use between both an OS X Mac and a Windows 10 PC

All versions of Windows since Windows Vista should be able to access a GUID drive. Because OS X is able to partition a GUID partition, we want to partition our large external hard drives with this compatible partition table. So, any modern computer since 2006 should be compatible. GUID doesn’t suffer from the restriction of a maximum partition size of 2TB, so if we have a hard drive larger than 2TB, we won’t be required to build multiple partitions with MBR.

Here’s a good quote for other important features regarding GUID (GPT stands for GUID Partition Table).

“On an MBR disk, the partitioning and boot data is stored in one place. If this data is overwritten or corrupted, you’re in trouble. In contrast, GPT stores multiple copies of this data across the disk, so it’s much more robust and can recover if the data is corrupted. GPT also stores cyclic redundancy check (CRC) values to check that its data is intact — if the data is corrupted, GPT can notice the problem and attempt to recover the damaged data from another location on the disk. MBR had no way of knowing if its data was corrupted — you’d only see there was a problem when the boot process failed or your drive’s partitions vanished.”

exFAT was released in 2006 as well, but Microsoft added backwards-compatibility to previous Windows versions from before Vista. The main benefit to it is that it doesn’t have the file size restrictions of FAT32, so individual files with exFAT can be larger than 4GB each. It probably isn’t super important for smaller files, but it could be a necessity for people working on larger files like videos or disk images.

Below is a step-by-step procedure for formatting a large External USB drive which can be used by both a Mac and a PC. This setup will utilize the newest, most fault-tolerant partition tables, and allows for the largest volume and file size capabilities. In my case I am formatting an 8TB Seagate Backup Plus+ USB 3.0 external HDD hard drive.

First, plug a new USB drive into a Mac:

  1. The Mac will automatically prompt if you want to use the drive as a Time Machine backup Disk – click “Don’t Use”
  2. Open Disk Utility
  3. On the left side of Disk Utility, under External, you should see your drive listed.
  4. Select the “highest-level” of the drive, not the partitions located underneath. In my case, Seagate Backup+ Desk Media.PC Mac External drive format (1)
  5. At the top of Disk Utility, click the “Erase” button.PC Mac External drive format (2)
  6. Name your disk, such as “JC-External”.
  7. Under “Format” drop-down menu, select “ExFAT”
  8. Under “Scheme” drop-down menu, select “GUID Partition Map”PC Mac External drive format (3)
  9. Click “Erase”
  10. Once the drive has been erased, again, Time Machine will prompt to use as a backup disk – select “Don’t Use”PC Mac External drive format (4)
  11. Click “Done”
  12. Your drive should now be listed under Devices in the Finder.PC Mac External drive format (5)
  13. Control-click or right-click on the device in the Finder, and click “Get Info”.  You can see that indeed it created an 8TB ExFAT Volume, but the Sharing and Permissions cannot be modified. Permissions can only be set if the drive is formatted with  “OS X Extended”. Also, notice that the Created/Modified dates may not be accurate, however, files and folders contained in the drive will display accurate modified dates/times.PC Mac External drive format (6)
  14. One thing to note, is after initially formatting the drive on a Mac, and then attaching the external drive to a Windows 10 PC, the drive may not immediately display with a drive letter by default in the Windows File Explorer. Go into Windows 10 Disk Management and find the drive listed in the discovered drives, but you may find that a drive letter is not associated with the volume.
  15. To fix this, in Disk Management, right-click on the large/unidentified new data volume and click “Change Drive Letter and Paths…”. Next, click the Add.. button, assign a drive letter (D:) and then OK. You should now find your external drive listed in Windows Explorer and see the files and folders you copied into it while it had been connected to your Mac.

Raspberry Pi 3 Model B 32 GB Setup and Config

Raspberry Pi 3 Model B 32GB Initial Setup and Configuration

So my first Raspberry Pi 3 Model B 32GB just arrived which is part of a “Canakit” on Amazon which can be found here. Below is a general setup and config step by step guide to get you started with your own Pi. I may follow up this post with the progress of my pie-in-the-sky project to build a miniature hyperloop “pod” and track, controlled by a stand-alone Raspberry Pi. But before I get into powering my Pi with an electrified rail, we need to get the Pi setup and configured. 

  1. Unbox, connect peripherals & power on (I swear, every video and tutorial spends too much time on this topic.) But I will say that the little machine is very quick and responsive, and I’m really happy with it’s performance so far!
  2. Initial power up. The Red LED powers on, and my monitor stays black, hmm, it’s not booting… Oh duh, it will help if I insert the included 32GB MicroSD. Important to note is the SD card does not click-eject or click-insert but is friction-based receptacle.
  3. Ok 2nd power up – it’s alive! Boots to the desktop and looks great – except the resolution. I used the Wifi config to get connected to my WAP easy. But it’s strange that I can’t ping anything. A quick search found this post, and the command:
     sudo chmod u+s /bin/ping

    With that command I can now ping out and about.

  4. Now I can go online with the default web-browser (Web 3.8.2) and find a fix for my monitor’s resolution. To set a raspberry pi 3 monitor resolution, follow the instructions in this post – which told me to first check my monitor’s capabilities with the commands:
    tvservice -d edid
    edidparser edid

    and then seeing that I do have a DMT monitor (group 2) and an hdmi mode 82, I edited /boot/config.txt with the new editor named Geany. I started geany with sudo so I could edit the protected file with the command:

    sudo geany
    

    Which brings up the Geany file editor running as sudo, and then I could open and browse to the File System > /boot/ directory where I could edit the file config.txt to include the following lines:

    hdmi_group=2
    hdmi_mode=82

    After a restart my monitor’s resolution is correct.

  5. So now to make sure my OS is up to date. By default the version I installed is
    Linux raspberrypi 4.4.9-v7+ #884 SMP Fri May 6 17:28:59 BST 2016 armv7l GNU/Linux
    

    So it is time to run an update. It’s so nice that the distro is debian-based and the familiar apt package management system is installed. No dist-upgrade necessary.

    sudo apt-get update
    sudo apt-get upgrade

OS X new domain migration – retaining user profile with terminal commands

If you’ve been tasked with the domain migration of a number of OS X El Capitan and Mavericks iMacs or MacBook Pro or Mac Air workstations, you may need to retain the user profiles. Normally, when unbinding, and then binding to a new domain, your user’s settings will be lost. You may be tempted to use Migration Assistant, but this usually requires copying the entire profile somewhere else which can take a long time and use a lot of disk space.

With this list of steps, you can use commands, scripting, and setting permissions and ownership of the user directories to perform the domain migration in-place.

Below is the sequence of commands and workflow step by step to migrate an OS X mac to a different domain. The key is to delete the sqlindex files, and prepare the user account for it’s new permissions. Please note the guide may not make sense at first while reading, but it will allow you to migrate your macs so that the users keep their same profile. Let me know if this guide helps you in your domain migration and if you find any better solutions.

Tasks Commands
1 Login as admin user and list users  Terminal -> ls -alh /Users/
2 move domain User folders to .old sudo mv /Users/johndoe /Users/johndoe.old
3 Unbind Machine  Preferences->Accounts->Login Options->Network account server -> Directory utility ->Active directory->Unbind
4 Delete sqlindex files found in ls /var/db/dslocal/nodes/Default/ sudo rm -f /var/db/dslocal/nodes/Default/sqlindex
sudo rm -f /var/db/dslocal/nodes/Default/sqlindex-shm
sudo rm -f /var/db/dslocal/nodes/Default/sqlindex-wal
5 reboot sudo reboot
6 Bind to new domain Preferences->Accounts->Login Options->Network account server -> Directory utility ->Active directory->Unbind
7 reboot
8 login as user
9 Logout and login as admin
10 move User folder .new After you have logged in as the user under the new domain you need to move the newly created User home folder to johndoe.new and move the .old User folder to /Users/johndoe with the command:
sudo mv /Users/johndoe /Users/johndoe.new
11 move .old to new username sudo mv /Users/johndoe.old /Users/johndoe
12 Change ownership of user home folder sudo chown -R johndoe:”Domain\Domain Users” /Users/johndoe
13 logout as admin
14 Reboot
15 login as that user (johndoe)
16 Click on “Create a new keychain” much easier in El Capitan and Yosemite If “Create new Keychain” fails then goto Keychain Access –> Preferences –> Reset Default Keychain

Windows 10 Best Free Video Screen Capture Open Broadcaster Software Install Tutorial

This video demonstrates how to use Open Broadcaster Software for capturing your desktop into a record-able video. OBS is free software that you can also use to record your gaming sessions to never miss that moment during your computer game. Here is a good post on Reddit.com describing how to set up OBS for capturing your game with a 20 second “buffer” so you can show your frags on youtube or convert them to a gif. But for now, below I put together a tutorial on how to setup OBS to record your desktop screen and audio to make videos like the one here:

 

How to Setup User Account for Child on Windows 10 Tutorial

This video shows you how to setup a user account for your kid/child without creating an email address. Windows 10 wants you to use an email address to create a user account. When you try to setup an account, it asks you to use an existing email and if not, it tries to force you to sign up for an outlook.com account. This video shows you how to bypass the Windows User account setup and use Computer Management to create a normal/local user account on Windows 10 Pro version for your kids.

Microsoft Bizspark – free business software for 3 years

If you’re thinking about which cloud service to use for a startup business, Microsoft just upped the ante with BizSpark.

Microsoft BizSpark https://www.microsoft.com/bizspark#start-two is really an amazing deal for business start-ups. If you wish you could get Microsoft software for free or for a huge discount check out their offer. BizSpark offers the following services and software for free for three years:

BizSpark gives startups 3 years of free stuff – software, services, tech support, and Azure cloud. Your startup qualifies if it is less than 5 years old, is privately held, and earns less than $1M annually. And at the end of your 3 years, you keep all the software you’ve downloaded – at no cost.

To expand on this service what you get with the Microsoft Bizspark details are the following:

Get up to $750 per month of FREE Azure cloud services for 3 years; that’s $150 per month each for up to 5 developers.

This potentially is a $27000 value!

Membership puts all Microsoft development and test software at your fingertips, including Azure, Windows, and Office 365 – for free. Plus, enjoy access to hundreds of free training classes, technical content, and 4 break-fix phone support incidents to help you on your journey.

It’s pretty amazing that BizSpark, in addition, also offers up to $120,000 worth of Azure credit.

Makes me want to go out and start a new business – hmm, maybe jasoncoltrin.com would qualify?

Moodle 2.4 – Recover uploaded course files from server even if corrupt

If for example, a new faculty member does not have the original files for an old moodle course, and the files uploaded to moodle the last semester are corrupt, you still can extract the files from a backup of the course with a tool I found here: DownloadAll

(DownloadAll.jar – cudos and thank you to OP Veronica Liesaputra !):

In order to extract all files from a course backup mbz file, please follow the guide below. Even if the files that were uploaded and are corrupt, and cannot be viewed/downloaded in moodle, you may be able to download the originals, repair the files, and then re-upload to moodle again:

    1. Go into the course where files are located (may be in an old location, even though current/copied course is valid with same corrupt files)
    1. Backup the course without user data. An mbz file will be generated. Copy this file to a Windows computer eg. c:\Users\jcoltrin\Desktop\moodlebackups\coursename.mbz
    1. Copy the linked jar script to the same folder
  1. Make sure 7zip is installed. Extract all the files in the mbz file to a directory with the same name just under the location of the mbz file. The script will not work unless you first extract all the files! For example, your folder structure will now look like this:
   Desktop\
     moodlebackups\
          DownloadAll.jar
          backup-moodle2-course-269-1509-bus302-va-20160114-1-28-nu.mbz
          backup-moodle2-course-269-1509-bus302-va-20160114-1-28-nu\
                   activities\
                   course\
                   files\
                         1b\
                              1b23cd2aaf9c0e8829407fc46c6b4b4c4f8d1a7c
                         3d\
                              3ddb69ac1035d0a51c4d1a3e767391d21f70c895
                   sections\
                   files.xml\

… This step may take a little bit of cut/paste as the mbz file has to be extracted twice with 7zip.

    1. Run the DownloadAll.jar script with the command java -jar DownloadAll.jar (PS C:\Users\jcoltrin\Desktop\moodlebackups> java -jar DownloadAll.jar)
  1. You’ll be prompted to enter the full path to the mbz file: “Enter the full path location to the Moodle’s backup (.mbz) file, e.g. C:/Users/Moodle/Backup/backup-moodle2-course-592-nu.mbz” – so in this case, I used: C:\Users\jcoltrin\Desktop\moodlebackups\backup-moodle2-course-269-1509-bus302-va-20160114-1028-nu.mbz

Output should return the names of the files that are recovered and start extracting (files even though errors occur):

       C:\Users\jcoltrin\Desktop\moodlebackups\backup-moodle2-course-269-1509-bus302-va-20160114-1028-nu created
       IOError :java.util.zip.ZipException: error in opening zip file
       Copy C:\Users\jcoltrin\Desktop\moodlebackups\backup-moodle2-course-269-1509-bus302-va-20160114-1028-nu\files\74\74ada129
       b720c6266753b54e5c5af614274bfcfe to C:\Users\jcoltrin\Desktop\moodlebackups\backup-moodle2-course-269-1509-bus302-va-201
       60114-1028-nu\Legal StructureLawsuits .pdf
       Copy C:\Users\jcoltrin\Desktop\moodlebackups\backup-moodle2-course-269-1509-bus302-va-20160114-1028-nu\files\6d\6db0919b
       e36df971bd7780defd8802ba119d4e80 to C:\Users\jcoltrin\Desktop\moodlebackups\backup-moodle2-course-269-1509-bus302-va-201
       60114-1028-nu\Sample-Negligence-Complaint.html

7. Once files have completed Extracting, gather the files and distribute as necessary.

8. In this case, many of the files that were corrupt in moodle had contained spaces in the filenames. I find that files uploaded to moodle work best with filenames that do not contain spaces or special characters. Also it’s smart to test opening each file in moodle first, to make sure repairs and download actions for each file work correctly.