Category Archives: Windows

Windows OS Issues. windows servers and workstations.

grant permissions to windows cluster object via the container to enable MSSQL Cluster installation.

CNO = When the Windows Failover Cluster (WFC) is initially configured a Cluster Name object (CNO) will be created. this is the windows cluster object in the AD.

1. Open the Active Directory Users and Computers Snap-in (dsa.msc).

2. Locate “Computers” container:

3. Make sure “Advanced Features” is selected:

4. Open the properties of the container and click the “Security” tab. Click “Add” and add the CNO. Make sure to select “Computers” option in the “Object Types” window:

5. Click “Advanced”, highlight the CNO, and click “Edit”:

6. Make sure “Read all properties” and “Create Computer objects” are checked. Click OK until you’re back to the AD Users and Computer window:

7. Retry your previously failed installation. Note that with SQL Server 2012 there will be a “retry” button.

via Error during installation of an SQL server Failover Cluster Instance – CSS SQL Server Engineers

Which Files Should You Back Up On Your Windows PC?

via Which Files Should You Back Up On Your Windows PC?

Your PC’s hard drive could fail tomorrow, or a software bug could erase your files, so backups are critical. But you don’t need to back up all the files on your PC. That would just waste space and make your backups take longer to complete.

The All-Important Rule of Backups

The most important rule of backups is that any important data should exist in two or more physical locations at once. You cannot create a backup and delete the original. If you do, it’s no longer really a backup. You still have just one copy of your data—you just moved it to a different place.

You might think this is obvious, but you’d be surprised how often we’ve been approached by readers that lost their data after their “backup” drive died.

There are many ways to back up your data, from backing up to an external drive to uploading copies of your data to a remote server over the Internet. You can use the tools integrated into Windows or download a third-party backup tool. Choose the best backup solution that works for you—we discuss some of our favorites here.

We also recommend using multiple types of backups for maximum data security. For example, if you store your sole backup drive next to your computer, you’ll lose all copies of your files if your hardware is ever stolen or damaged in a fire. So having a backup in the cloud is a good idea.

Back Up Your Files, Not Your Full System

There are two types of backups you can create. Most common backup tools will back up a list of files and folders you specify. This allows you to back up just the files and folders you need. Your backups won’t be any larger than they need to be, and they’ll complete quickly.

However, it’s also possible to create full system image backups of your computer’s hard drive using built-in or third-party tools. These will back up everything, from your Windows system directory and installed program files to your personal data. These backups will be much larger and take much longer to create.

For most people, we recommend you stick with just backing up your files and folders. System image backups sound nice, but there are some big catches. For example, you can’t easily restore a system image on another computer, as a Windows installation will generally only run properly on its original system. You’re better off just starting from a fresh Windows installation and reinstalling your programs.

System image backups have their place, but avoid them unless you’re sure you need them. They’re not the best general purpose backup solution.

Files You Should Back Up

The most important thing is to back up your personal files. On a modern Windows PC, you’ll generally find these under C:\Windows\USERNAME, where USERNAME is your user account name.

By default, this directory contains your user account’s data folders. These include the Documents folder where your documents are saved to by default, the Pictures folder that likely contains any family photos you have, the Downloads folder where files are downloaded, the Music folder where your music files are probably stored, and the Videos folder where videos are stored. If you use iTunes for your music, iTunes stores its music library in your music folder by default. It even includes your Desktop folder, where many people store files.

It also includes other important folders, like OneDrive, Dropbox, and Google Drive, where offline copies of your cloud files are stored if you use these services.

There’s also an AppData folder here, but you won’t see it unless you’re showing hidden files and folders. This is where programs store the settings and data specific to your user account. You may be able to use this data to restore an individual program’s settings if you ever need to recover from a backup.

With that in mind, we recommend you back up your entire user account directory, including the hidden AppData folder. This ensures you have all your personal files and settings, and you don’t have to spend much time thinking about it. If multiple people use the same PC and have their own files, back up each user account’s folder.

You may choose to exclude certain folders from the backup if you don’t want them present. For example, if you store a bunch of downloaded videos in the Videos folder and you don’t mind redownloading them in the future, exclude it from the backup. If you have a many gigabytes of virtual machines that take a large amount of space and you wouldn’t mind setting them up from scratch again, exclude the virtual machine folder. But, if those virtual machines are important and it would take you a good amount of time to configure them again, you probably want to back them up.

You’ll notice that we’re using a lot of words like “by default”, “likely”, and “probably” when saying where your files are stored. That’s because Windows lets you store your files in any location you like. If you moved them, only you know where all your files are stored.

For example, it’s easy to move a folder like Music, Videos, Downloads, Pictures, or Documents to another location on your PC. These files may be stored on another drive, for example. Or you may not use the default folders at all and simply dump files in a folder elsewhere on your PC’s hard drive. If you store your files in non-standard locations like this, it’s crucial you identify the folders containing your important files and add them to the backup.

Your browser’s bookmarks and other settings are located somewhere in the AppData folder, so backing up your entire user folder will save these files as well. However, you may want to use your browser’s sync feature and sync its settings with a Google, Firefox, or Microsoft account. This will save you from having to dig through your AppData folder.

If you use a desktop email client, you may also want to back up your emails. This isn’t necessary if you use the modern IMAP protocol for your email, as the master copies of your emails are still stored on the remote server. However, if you’ve downloaded emails via the POP3 protocol, it’s crucial you back up your emails as they may only be stored on your PC.

The good news is that your emails are likely stored in your user account’s AppData folder, so they’ll be automatically backed up if you back up your entire user folder. You may still want to check the location of your email files just to ensure they’re backed up, however. Here’s how to find the location where Outlook stores your emails.

Any other personal data and settings that aren’t located in your user account folder should be backed up, if you care about it. For example, you may want to back up application settings that are located in the C:\ProgramData folder for some applications.

PC games in particular have files all over the place. Many games synchronize their save files online using Steam Cloud or a similar service, so they won’t need backups. Many store their save games in your Documents or AppData folders, while others dump their save games in C:\ProgramData or another location, like somewhere in your Steam folder. The PCGamingWiki website has a good database of games with information about whether they synchronize their save games or not and exactly where their save files are located on your PC.

Ensure whatever data you care about—whether it’s your family photos, settings for a mission-critical application, or save games for that RPG you’ve been playing for 100 hours—is backed up.

Files You Shouldn’t Back Up

There’s never a reason to back up your Windows directory or Program Files folder. Leave these folders alone.

The Windows directory contains Windows system files, and they aren’t portable between different PC hardware. Windows will set up these files when it’s installed on a new PC, so you don’t need them.

The Program Files folder contains files for your installed applications. You usually can’t just copy these folders over. You’ll have to reinstall most applications from scratch, so there’s generally no point in backing up this folder.

A handful of programs can be simply moved between PCs. For example, you can back up your Steam or Battle.net directories and copy them over to a new PC, saving the big download of these games. However, even these folders aren’t critical to back up. They can make setting up a new PC faster and save some of download time, but they aren’t full of critical files you can never get back. You can always just reinstall your programs, so they aren’t the priority if you’re limited on space.

Back Up Regularly

Once you’ve started backing up your files, you should continue creating regular backups. Back up your files daily, if possible. This will be a fast process if you back up regularly, as your backup tool will just back up the few personal files that have changed.

Automating your backups helps ensure those backups get performed regularly. That’s one reason why online backup solutions are so good. They can be configured to automatically back up your PC every day when you aren’t using your computer, so you won’t even have to think about it.

How to manage vmware ESX with PowerShell

  1. Prerequisites:
    • Windows .Net Framework 2.0 (3.5 latest SP Recommended).
    • Windows PowerShell (V2 Recommended).
  2. Install vSphere client.
  3. Set the ‘Execution Policy’ of PowerShell to Remote Signed.
    • Run PowerShell as administrator.
    • Set-ExecutionPolicy RemoteSigned
  4. Type Exit and press Enter to leave the PowerShell prompt.
  5. Do it on both PowerShell consoles: x86 and x64.
  6. Download the PowerCLI software to your workstation from the following URL: http://vmware.com/go/PowerCLI
  7. Run the PowerCLI exe file.
  8. Install it all the way with default values. Click next until you arrived to finish screen and click finish.
  9. On your desktop you will now have two icons, which allow you to launch PowerCLI, a 64 bit version and a 32 bit version.
  10. Copy the PowerCLI modules folder to the PowerShell modules folder:
  11. C:\Program Files (x86)\VMware\Infrastructure\PowerCLI\Modules -> C:\Windows\System32\WindowsPowerShell\v1.0\Modules
  12. View the new vmware modules: Get-Module -ListAvailable | ? {$_.name -like “*VMware*”}
  • Example

C:\WINDOWS\system32> Get-Module -ListAvailable | ? {$_.name -like “*VMware*”}

    Directory: C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\PowerCLI\Modules

ModuleType Version    Name                                ExportedCommands

———- ——-    —-                                —————-

Binary     6.0.0.0    VMware.DeployAutomation

Binary     6.0.0.0    VMware.ImageBuilder

Binary     6.5.0.4… VMware.VimAutomation.Cis.Core

Binary     6.5.0.4… VMware.VimAutomation.Cloud

Manifest   6.5.0.4… VMware.VimAutomation.Common

Binary     6.5.0.2… VMware.VimAutomation.Core           HookGetViewAutoCompleter

Binary     6.0.0.0    VMware.VimAutomation.HA

Binary     7.0.2.4… VMware.VimAutomation.HorizonView

Binary     6.5.0.4… VMware.VimAutomation.License

Binary     6.5.0.4… VMware.VimAutomation.PCloud

Manifest   6.5.0.4… VMware.VimAutomation.Sdk            Get-PSVersion

Binary     6.5.0.4… VMware.VimAutomation.Storage

Binary     6.5.0.4… VMware.VimAutomation.Vds

Binary     6.5.0.4… VMware.VimAutomation.vROps

Binary     6.0.0.0    VMware.VumAutomation

  1. Import the modules you need: Import-Module -Name VMware.VimAutomation.Core
  2. The end.

Source: Back to Basics: Part 1 – Installing PowerCLI – VMware PowerCLI Blog – VMware Blogs

https://blogs.vmware.com/PowerCLI/2015/03/powercli-6-0-introducing-powercli-modules.html

Give people delegate permissions for a distribution group Office 365

 

 

Give people delegate permissions for a distribution group

If you are an Office 365 admin, you can give people delegate permissions to send email from, and on behalf of a distribution group.

  1. Log in to your office 365 admin center.
  2. Click the Admin tile.
  3. In the Office 365 admin center panel, click Groups.
  4. In the Groups panel, check the box next to the group you want to add delegates to.
  5. In the right panel, under Distribution list, click Edit Exchange properties.
  6. Click group delegation.
  7. Use the following to help you determine whether you want to assign Send As or Send on Behalf permissions

Send As:

This allows a member of the group to send email as the distribution group address. To a recipient, the From line will display the group name only.

Send on Behalf:

This allows a member of the group to send email on behalf of the group. To a recipient, the From line will display the sender “on behalf of” the group.

To send as the distribution group, you need to show the From field in your email composer. To show the From field in Outlook, open a new email, click Options, and select From.

Source: Give people delegate permissions for a distribution group | Office 365 from GoDaddy – GoDaddy Help GB

How to Check MD5 checksum of a File on Windows

What is MD5 Sum?

MD5 is a widely known term in the tech world but if you are an active Android users, you must have confronted the terms like “md5sum”, “md5 hash” or “md5 checksum” quite frequently. Most official and custom ROMs, mods and recovery flushable ZIPs come pre-encrypted with a unique code for security reasons. It’s a kind of password that is used to ensure the integrity of files inside a ZIP or a software package.

An MD5 checksum is a mathematical algorithm is usually a set of 32-character hexadecimal letters and numbers that are computed on a file with a tool. These numbers are generated using special tools that employ “cryptographic hash function producing a 128-bit (16-byte) hash value”. It is used not only to encrypt a ZIP archive or an EXE installer but all kinds of files. You can assign an MD5 sum even to a text or document file. The perfect match of MD5 checksum value ensures that the digital integrity and security of a file has not been broken by someone else and also that it is the accurate copy of the original file.

Thus, there are the two main reasons if the MD5 hash value of a file you downloaded does not match against the original sum:

  1. The file might be modified by someone else in an unauthorized way.
  2. The file was not downloaded properly and some of its elements might have been corrupted.

The MD5 checksum or hash value of a file might look like these:

25912deacc5d55528e223ec7b99705cc

220c41f3b03f42190899db8cb081b5c6

a578d837343fe2542ecf405a630d46a0

8223ec1c2aa71503b431a0daabb23154

Why to Verify MD5?

Installing an official firmware, a custom ROM or even a Kernel file with corrupt MD5 value can lead to a bricked phone or tablet. It is, therefore, very important that whenever you download such files with a purpose to install them on your device, make sure to compare/match the computed MD5 checksum against the one provided on the download page to verify their integrity. I have seen various cases where people report that their device went to bricked state after installing a certain file. In many cases, you might get an installation failed error if the MD5 hash value is not correct.

It is a customary practice among Android developers to mention the MD5 sum of their ROMs, mods, and kernels when they share them. Having downloaded such files, you can run an MD5 checker program on your computer to match the MD5 value. It the sum matches perfectly; you can proceed to install the file. In case there is a mismatch between the values, you should avoid installing such files.

To make sure that it is just a case of bad download, try downloading the file again, preferably from a different mirror or browser. If the match fails again, contact the developer and report it. He/she might check if the MD5 they provided was correct or give you an alternate link to get the file.

Verify MD5 Checksum on Windows

If you are a Windows user. you can find a variety of MD5 checksum programs available on the internet that can be used for the purpose. Personally, I use a very nice and easy to use a tool called WinMD5Free. Here is how you can use it to verify:

  1. Download the latest version of WinMD5Free from the official site: Click Here  [mirror]
  2. Extract the downloaded zip and launch the WinMD5.exe file.
  3. Click on the Browse… button, navigate to the file that you want to check and select it.
  4. Just as you select the file, the tool will show you its MD5 checksum.
  5. Now copy and paste the original MD5 value provided by the developer or the download page in the box below.
  6. Then click on Verify button.
  1. The tool will then give you the match results and shown above.

How to Check/ Verify MD5 CheckSum of a File on Windows, Mac and Linux

Add PowerShell to Windows Explorer Context Menu in Windows 10

Here’s a quick tutorial on how to add PowerShell to the Windows Explorer context menu in Windows 10.

Source: Add PowerShell to Windows Explorer Context Menu in Windows 10 – Petri

1. Open the Registry Editor. You can do this by clicking on Start and typing regedit.

2. Navigate to the following path:

HKEY_CLASSES_ROOT\Directory\Shell

Create a new key by clicking Edit > New > Key.

Call the new key “PowerShell.”

3. Modify the default string in the “PowerShell” key by right-clicking it and selecting “Modify…”

Call the new value “Open PowerShell Here.” Click “OK.

4. In the PowerShell key, create a new key by clicking Edit > New > Key.

5. Call the new key “command.”

6. Modify the default string in the command key by using the following text:

C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe -NoExit -Command Set-Location -LiteralPath ‘%L’

Click “OK.”

7. Add a new string by clicking Edit > New > String value.

Let’s call it “Icon.”

8. Modify the value by using the following text:

“C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe”,0

Click “OK.”

9. After completing these steps, close the registry, and open Windows Explorer. Go to any folder of your choice and right-click the folder

 

 

 

 

Process Monitoring with PowerShell

PowerShell MVP Jeff Hicks shares his script for watching processes using a WMI event subscription using the CIM cmdlets.

Source: Process Monitoring with PowerShell – Petri

$Poll = 120 #check the computer every two minutes

<#
I want to select all properties from the WMI class called CIM_InstModification.
This is a special system class that’s triggered when an object is modified.
I don’t want to find every object, as it is changed every second. So I tell WMI to check within a time frame of seconds.
When this event fires, WMI will have a new object called the TargetInstance.
This will be the changed object, and I only care about those that are Win32_Process objects.
The ISA operator accomplishes that.
The last part of the query is to limit results to those process objects, which is what the TargetInstance is, with a WorkingSetSize property of greater or equal to 500 MB.
#>

$query = “Select * from CIM_InstModification within $Poll where TargetInstance ISA ‘Win32_Process’ AND TargetInstance.WorkingSetSize>=$(1000MB)” #WMI query

<#
When you create the event subscriber, you can choose to simply record the events in your PowerShell session as matching events are detected.
Or you can take action.
In my case, I want to do a few things everytime a matching process is found.
I want to create a log file, and I want to display a popup message.
#>

$action={
#create a log file
$logPath= “C:\Work\HighMemLog.txt”
“[$(Get-Date)] Computername = $($Event.SourceEventArgs.NewEvent.SourceInstance.CSName)” | Out-File -FilePath $logPath -Append -Encoding ascii
“[$(Get-Date)] Process = $($Event.SourceEventArgs.NewEvent.SourceInstance.Name)” | Out-File -FilePath $logPath -Append -Encoding ascii
“[$(Get-Date)] Command = $($Event.SourceEventArgs.NewEvent.SourceInstance.Commandline)” | Out-File -FilePath $logPath -Append -Encoding ascii
“[$(Get-Date)] PID = $($Event.SourceEventArgs.NewEvent.SourceInstance.ProcessID)” | Out-File -FilePath $logPath -Append -Encoding ascii
“[$(Get-Date)] WS(MB) = $([math]::Round($Event.SourceEventArgs.NewEvent.SourceInstance.WorkingSetSize/1MB,2))” | Out-File -FilePath $logPath -Append -Encoding ascii
“[$(Get-Date)] $(‘*’ * 60)” | Out-File -FilePath $logPath -Append -Encoding ascii

#create a popup
$wsh = New-Object -ComObject Wscript.shell
$Title = “$(Get-Date) High Memory Alert”
$msg = @”
Process = $($Event.SourceEventArgs.NewEvent.SourceInstance.Name)
PID = $($Event.SourceEventArgs.NewEvent.SourceInstance.ProcessID)
WS(MB) = $([math]::Round($Event.SourceEventArgs.NewEvent.SourceInstance.WorkingSetSize/1MB,2))
“@

#timeout in seconds. Use -1 to require a user to click OK.
$Timeout = 10
$wsh.Popup($msg,$TimeOut,$Title,16+32)

}

#Now that I have the action scriptblock all that remains is to register the subscription with the Register-CimIndicationEvent.#
Register-CimIndicationEvent -Query $query -SourceIdentifier “HighProcessMemory” -Action $action

#You can see the registration with the Get-EventSubscriber cmdlet.
#This subscription will run for as long as my PowerShell session is running.
#The corollary is that I will need to recreate it every time I want to start monitoring.
#If this is a daily task, I could put it in my PowerShell profile script.

#If you want to get rid of the subscriber, simply unregister it.
#Get-EventSubscriber -SourceIdentifier “HighProcessMemory” | Unregister-Event

 

How to Create a Bootable USB Drive

Step 1: Using DISKPART command

  1. Insert your USB flash drive to your running computer.
  2. Run Command Prompt as administrator.
  3. Type ‘diskpart‘ on Command Prompt (without quotes) and hit Enter.
  4. Type ‘list disk‘ to view active disks on your computer and hit Enter and find the USB drive disk #.
  5. Type ‘select disk 1‘ (or whatever the USB drive is).
  6. Type ‘clean‘ and hit Enter to remove all of data in the drive.
  7. Type ‘create partition primary‘ and hit Enter. Creating a primary partition and further recognized by Windows as ‘partition 1‘.
  8. Type ‘select partition 1‘ and hit Enter. Choosing the ‘partition 1‘ for setting up it as an active partition.
  9. Type ‘active‘ and hit Enter. Activating current partition.
  10. Type ‘format fs=ntfs quick‘ and hit Enter. Formatting current partition as NTFS file system quickly.
  11. Type ‘exit‘ and hit Enter. Leaving DISKPART program but don’t close the Command Prompt instead. We would still need it for next process.

Step 2: Creating Boot Sector

Mount the ISO file to a drive.

Let us assume that the flash / USB drive is the D: drive and the DVD installer located on drive F:The first step, we will navigate Command Prompt to set installation DVD as its active directory.

  • (if you want to create boot from ISO file then, first thing to do is to mount the ISO of the Windows OS you just downloaded. Double-click the ISO file to mount it. Check the drive letter and make note of the drive letter).
  1. By default, Command Prompt’s active directory for Administrator permission is on C:\Windows\System32>. We will navigate Command Prompt to set on DVD (F:) as its active directory. Just type ‘f:‘ then hit Enter, and the active directory changed to F:
  2. Type ‘cd boot‘ and hit Enter. Active directory changed to F:\boot>.
  3. Type ‘bootsect /nt60 d:‘ and hit Enter. Creating boot sector on D: drive (USB flash drive).
  4. Type ‘exit‘ and hit Enter to close the Command Prompt. Until this step we have made a bootable USB drive successfully, and the flash drive is ready to be used as a boot media.

Step 3: Copying Installation Files

To install Windows from a bootable USB drive, we just need to copy the whole installation files contained on the DVD installer to flash drive. To do this, open the Command Prompt as in previous steps. Once it opens, type ‘xcopy f:\*.* d:\ /E /H /F‘ and then press Enter. Wait until all the files in the DVD installer copied to the flash drive. Now bootable USB drive is ready to be used for installing Windows from flash drive and you’re done !

 

How to Shutdown a Failover Cluster or a Node.

Shutting Down a Node

When shutting down or rebooting a node in a Failover Cluster, you first want to drain (move off) any roles running on that server (such as a virtual machine).  This ensures that the shutting down of a node is graceful to any applications running on that node.

  1. Open Failover Cluster Manager (CluAdmin.msc)
  2. Click on “Nodes”
  3. Right-click on the node name and under ‘Pause’ click on ‘Drain Roles’
  4. Under Status the node will appear as ‘Paused’.  At the bottom of the center pane click on the ‘Roles’ tab.  Once all roles have moved off this node, it is safe to shut down or reboot the node.

    To resume the node after it has been restarted…

    When the node is once again powered on and ready to be put back into service, use the Resume action to re-enable the node to host roles.

    1. Open Failover Cluster Manager (CluAdmin.msc)
    2. Click on “Nodes”
    3. Right-click on the node name and select ‘Resume’, then select either:
      1. Fail Roles Back’ – This will resume the node and move any roles which were running on the node prior to the node back.  Caution:  This could incur downtime based on the role
      2. Do Not Fail Roles Back’ – This will resume the node and not move any roles back.

Shutting Down a Node with Windows PowerShell®

  1. Open a PowerShell window as Administrator
  2. Type:  Suspend-ClusterNode -Drain
  3. Type:  Get-ClusterGroup
    1. Verify that there are no roles listed under “OwnerNode” for that node
    2. This could be scripted with the following syntax:
      PS C:\> (Get-ClusterGroup).OwnerNode –eq “NodeBeingDrained”
  4. Shutdown or restart the computer by typing either:
    1. Stop-Computer
    1. Restart-Computer

To resume the node after it has been restarted…

  1. Open a PowerShell window as Administrator
  2. Type:  Resume-ClusterNode
    1. If you wish to fail back the roles which were previously running on this node type:

PS C:\> Resume-ClusterNode –Failback Immediate

Shutting Down a Cluster

Shutting down the entire cluster involves stopping all roles and then stopping the Cluster Service on all nodes.  While you can shut down each node in the cluster individually, using the cluster UI will ensure the shutdown is done gracefully.

  1. Open Failover Cluster Manager (CluAdmin.msc)
  2. Right-click on the cluster name, select ‘More Actions’, then “Shut Down Cluster…”
  3. When prompted if you are sure you want to shut down the cluster, click “Yes”

Shutting Down a Cluster with PowerShell

  1. Open a PowerShell window as Administrator
  2. Type:  Stop-Cluster

Controlling VM Behavior on Shutdown

When the cluster is shut down, the VMs will be placed in a Saved state.  This can be controlled using the OfflineActionproperty.

To configure the shut down action for an individual VM (where “Virtual Machine” is the name of the VM):

PS C:\> Get-ClusterResource “Virtual Machine” | Set-ClusterParameter OfflineAction 1

 

 Value  Effect
 0  The VM is turned off
 1 (default)  The VM is saved
 2  The guest OS is shut down
 3  The guest OS is shut down forcibly

To start the cluster after it has been shut down

  1. Type:  Start-Cluster

Source: How to Properly Shutdown a Failover Cluster or a Node – Clustering and High-Availability – Site Home – MSDN Blogs