POUWIEL|COM

JeroenPouwiel

HYPER-V :: backup VM’s locally

Running Windows Server 2012 R2 HYPER-V Core but what to do regarding backups..!?

Easy.

Install the Windows Server Backup feature. As I am using HYPER-V Core, I can install the feature using server manager on my laptop.
Than, create a shared folder on my HYPER-V server with:

net share BCK=C:\BCK /GRANT:Everyone,FULL

And finally, backup the virtual machine using wbadmin.exe, like so:

WBADMIN START BACKUP -backupTarget:\\<servername>\BCK -hyperv:<vm_name>

Because I’ve got Swiss cheese for memory, I created a little script to do this for me:

@ECHO OFF

:HOUSEKEEPING
ECHO.

:CHECKFORSWITCHES
IF -%1-==-- (
    ECHO.:: ##########!! WARNING !!##############################################################
    ECHO.:: ## No parameters were passed. Please look through the Usage section
    ECHO.:: ##  & GOTO DISPINFO
) ELSE IF '%1'=='/H' (
    GOTO DISPINFO
) ELSE IF '%1'=='/h' (
    GOTO DISPINFO
) ELSE IF '%1'=='/?' (
    GOTO DISPINFO
) ELSE IF EXIST "C:\VMS\%1" (
    GOTO MAIN
) ELSE (
    ECHO.:: ##########!! WARNING !!##############################################################
    ECHO.:: ## Provided parameter was not recognized/valid. Please look through the Usage section
    ECHO.:: ##  & GOTO DISPINFO    
)

:DISPINFO
ECHO.:: ##########~~ INFORMATION ~~##########################################################
ECHO.:: ## BACKUP
ECHO.::
ECHO.:: Description:
ECHO.::     Backs up a single Virtual Machine to the local shared folder BCK @ \\<servername>\BCK
ECHO.::     The command used is: "WBADMIN START BACKUP -backupTarget:\\<servername>\BCK -hyperv:{vm_name}"
ECHO.::
ECHO.:: Usage:
ECHO.::     c:\Users\Administrator\Documents\backup.bat {vm_name}
ECHO.::
ECHO.:: Parameter List:
ECHO.::     /?             Displays this help message.
ECHO.::     vm_name        When given a vm_name, it will be passed as argument to the wbadmin program
ECHO.::
ECHO.:: Resources:
ECHO.::     WBADMIN        @ https://blogs.msdn.microsoft.com/virtual_pc_guy/2013/02/25/backing-up-hyper-v-virtual-machines-from-the-command-line/
ECHO.::                    @ https://virtualizationreview.com/blogs/virtual-insider/2013/02/back-up-hyper-v-vms.aspx
ECHO.::
ECHO.::     BATCH script   @ http://stackoverflow.com/questions/26551/how-to-pass-command-line-parameters-to-a-batch-file
ECHO.::                    @ http://stackoverflow.com/questions/13684259/show-help-message-if-any-command-line-argument-equals
ECHO.
ECHO.
GOTO :END

:MAIN
set arg1=%1
echo starting "WBADMIN START BACKUP -backupTarget:\\<servername>1\BCK -hyperv:%arg1%"
WBADMIN START BACKUP -backupTarget:\\<servername>\BCK -hyperv:%arg1%
:END



May not be the most elegant of code or robust, but it gets the job done.

//JP

Sym links in Windows CLI

I was just playing on the windows cli, trying to create a shortcut to a mysql binary directory, where I noticed that a shortcut/link to a directory didn’t behave as I initially expected it to do. Enter Jon Coombs on superuser.com:

:\Users\user5\Desktop>mklink /D mysymlink  "C:\ProgramData\Microsoft\Windows\S
tart Menu\Programs\G"
symbolic link created for mysymlink <<===>> C:\ProgramData\Microsoft\Windows\Sta
rt Menu\Programs\G

C:\Users\user5\Desktop>cd mysymlink

C:\Users\user5\Desktop\mysymlink>

Because I created my symlink outside of my user directory, I had to create it using administrator privileges and added privileges to my user via advanced security settings.

HYPER-V | Working without the Local Security Policy snap-in

When working with Windows Server products any security setting can be altered by using the local security policy.
Enter HYPER-V server core.

Because I’m just meddling around with it, I definitely want to be able to use it on a as much as TeleTubby level as possible. Queue Josip Medved. Following his post:
Run this on a server where the configuration already meets your requirements or where you can edit the file created in the code below:
secedit /export /cfg X:\new.cfg

The task has completed successfully.
See log %windir%\security\logs\scesrv.log for detail info.

When needed, edit the part below:
[System Access]
MinimumPasswordAge = 0
MaximumPasswordAge = 39
MinimumPasswordLength = 0
PasswordComplexity = 1
PasswordHistorySize = 0
...

In this case you’d want to set the PasswordComplexity to 0.
Move the file to your HyperV server and run the following code:
secedit /configure /db C:\Windows\security\new.sdb /cfg X:\new.cfg /areas SECURITYPOLICY

The task has completed successfully.
See log %windir%\security\logs\scesrv.log for detail info.

Worked for me!

## Update::
OR!..
You can just
cmd::> gpedit.msc /gpcomputer: remote-computer
powershell::> Invoke-Command -ComputerName FQDN-of-computer {gpupdate /force}

Also works very nice and isn’t that cumbersome.

MicroSoft Windows | DiskPart.exe

Ran too many times into issues with GUI Disk Management when trying to repartition a non-Windows partitioned thumb-drive:
1.Connect your disk.
2.Run cmd as an Administrator.
3.Run diskpart.exe. Use ? if you need help in this program.
4.list disk
5.Find the disk that corresponds to your USB disk. select disk n where n is the number of the disk. Confirm that you’re using the right disk with detail disk.
6.clean (Warning: This command erases the disk’s partition information)
7.create partition primary. No size is needed if you want to use the whole disk
8.active. Optional. Marks the partition as potentially bootable.
9.format fs=fat32 quick. You can choose NTFS or exFAT instead of FAT32 if you want.
10.assign. Assigns the disk a drive letter.
11.exit to quit.

estimation

All rights belong to their respective owners, etc., etc.
Almost there...

SQL Server built-in functions

Just a quick note: this page@developer center contains an index of all (?) built-in functions that SQL Server 2008 has.

Put it to good use…

Also found a ‘best practices’ link.

Howto’s

Howto Microsoft loopback adapter
Howto RSS Feed from a Oracle database
Howto create SSO in APEX

Group Policy Object Editor

Quite a mouthfull to refer to something that takes privileges away or adds them.
I needed/wanted to take the “System shutdown” privileges away from my kids on my computer, once in a while i might be downloading something that might otherwise take unnecassary longer.
Read the rest of this entry »

Mapping the client connections to a shared port on Wintel

source:

USE_SHARED_SOCKET
You can set parameter USE_SHARED_SOCKET to true to enable use of shared sockets. If this parameter is set to true, the network listener passes the socket descriptor for client connections to the database thread. As a result, the client does not need to establish a new connection to the database thread and database connection time improves. Also, all database connections share the port number used by the network listener, which can be useful if you are setting up third-party proxy servers.
This parameter only works in dedicated server mode in a TCP/IP environment.
If this parameter is set, you cannot use the 9.0 listener to spawn Oracle7 release 7.x databases.
To spawn a dedicated server for an Oracle database not associated with the same Oracle home as the listener and have shared socket enabled, you must also set parameter USE_SHARED_SOCKET for both Oracle homes.

USE_SHARED_SOCKET could be a performance bottleneck if you have more connections to the database. The load on using the same socket on Windows has been very weak with respect to performance.
So the answer would depend on how many simultaneous connections will hit the listener at a point of time.
I don’t have any benchmark values for this ( there was never a need for this ).
But we decided against the use of this with just 50 connections.

IE7 Delete Browsing History hangs

Appearantly Nero Scout mucks about in the browser history, causing the “delete all” to hang.
I’m using IE7 in combination with Nero8, here’s how to solve it:

* Start
* All Programs
* Nero 8
* Nero Toolkit
* Nero Scout -> clear the “enable” check box

    Problem solved !

    DB console on windows

    In order to log on to DB console running on a Windows platform, the user with which you (want to) log onto the host must be granted the privilege to log on as a batch job.

    * Go to control panel/administrative tools.
    * click on “local security policy”.
    * click on “local policies”.
    * click on “user rights assignments”.
    * double click on “log on as a batch job”.
    * click on “add” and add the user that was entered in the “normal username” or “privileged username” section of the EM Console.

    Categories