Category Archives: Virtualization

IIS Backup Script

To Backup and Restore IIS configuration to Another Server you could try below steps:

1)if you configured the certificate with old iis site you need to Backup (export) of IIS certificates.

2)open the command prompt as administrator and create IIS configuration backup on the first server by using below command:

cd c:\Windows\system32\inetsrv


appcmd add backup srviis1-backup-2019

srviis1-backup-2019 this is a backup folder name.

After the command has been executed, a folder with your backup name appears in c:\Windows\system32\inetsrv\backup. Here is its contents for my simple website:

  • administration.config
  • applicationHost.config
  • MBSchema.xml
  • MetaBase.xml
  • redirection.config
enter image description here

3)Copy the backup folder to the same directory c:\windows\system32\backup on another server.

To display the list of all available backups, run the following command:

appcmd list backup
enter image description here

4)Recover IIS configuration from this backup:

appcmd restore backup srviis1-backup-2019

The list of restrictions and important issues:

  • The same IIS version has to be used on both servers
  • If any application pool is run not from the integrated accounts, they have to be available on another server as well
  • Before recovery, you should export and migrate all current certificates to the new server

February 19, 2020

Upgrade XCP Remotely

First you need to have an XCP ISO Image mounted somewhere on an HTTP accessable server!

1.get uuid of host

[root@xen-to-xcp-test2 ~]# xe host-list 
uuid ( RO)                : 7b2ebfd3-f33a-4025-b757-e91d26a46242
         name-label ( RW): xen-to-xcp-test1
   name-description ( RW): Default install


uuid ( RO)                : 750d9176-6468-4a08-8647-77a64c09093e
         name-label ( RW): xen-to-xcp-test2
   name-description ( RW): Default install
  1. Test URL access
    xe host-call-plugin plugin=prepare_host_upgrade.py host-uuid=750d9176-6468-4a08-8647-77a64c09093e fn=testUrl args:url=http://<ip-address>/xcp-ng/7.4.1/
    Output must be true
  2. Run the Upgrade/prepare function
    xe host-call-plugin plugin=prepare_host_upgrade.py host-uuid=750d9176-6468-4a08-8647-77a64c09093e fn=main args:url=http://<ip-address>/xcp-ng/7.4.1/
    Output should be true as well

This adds a temporary entry to grub bootloader which will automatically invoked on next reboot. This runs the upgrade to XCP-NG, it will do the normal backup to secondary partition as well.

It’s good to have some remote KVM access to the machine to watch the output.

NEC SL1100 Autoattendant

This Example Covers:

  • How to record an Auto Attendant Greeting using a multiline telephone set on an NEC SL1100. While you have the option of importing custom greetings using Web Pro, some customers may want to record their own greetings or announcements using their own phone.

Requirements:

  • NEC Multiline telephone connected to NEC SL1100 KSU
  • Extension being used must be in class of service 15. Extension 101 is the only extension in class of service 15 by default. (Class of service can be changed in Program 20-06 Class of Service for Extensions)
  • Program 47-02 InMail Station Mailbox Options: “12 – System Administrator” must be enabled for each mailbox extension you would like to have access to system administrator privileges. (This is needed in order to record an Auto Attendant Greeting from phones other than the Operator Extension 101)

Steps:

  1. Find a multiline phone which is in class of service 15. Extension 101 is in class of service 15 by default. This class gives the phone higher level privileges which are required to access the system manager part of the InMail system.
  2. Press the Voice Mail soft key (Labeled VM) or dial *8 to access the InMail Voice Mail System.
  3. Now you are in Extension User 101’s Voice Mail box.
  4. Now we want to get into the System Administrator. We will do this by dialing 72 or SA on the phone keypad.
  5. Now we are logged into the System Administrator where we can record, listen and delete recordings.Here you can access Instruction Messages (Instr) also known as Routing Mailboxes, Announcement Messages (Annc) , Subscriber Maintenance (Subs) and others.
  6. Now press the soft key labeled “Instr” to access instruction message recordings for Routing Mailboxes. There are 32 Routing Mailboxes by default and must be entered with three digits. Example: 001
  7. In our case, we will be recording greeting 1. Therefore we must enter in 001. The InMail prompts on the phone always have to be 3 digits hence the two zeroes in front of the one.

  8. Now pickup your handset to prepare for recording. You may record the message using the speakerphone however the quality of the recording will be better using the microphone in the handset.
  9. Record your message by pressing the record button labeled as “Rec”
  10. When you are finished with your recording press the # key.
  11. If you desire to preview your recording, you can listen to it by pressing the softkey labeled “Lstn”
  12. If you are satisfied with your recording, simply hang up.

This concludes the tutorial for recording an auto attendant greeting through the phone.

How To Activate Windows 10 / Server 2016 Through Command Line

If you are having problems activating Windows 10, Server 2016, Windows 8, or Server 2012 one of these three solutions below should get you through:

Command Line to Launch Activation GUI:

This is handy if the GUI won’t start and you want to skip some steps to get it to work.

  1. click START (gets you to the tiles)4-no-change-product-key-link-missing-dns-error-0x8007232b-dns-error-activate
  2. type RUN
  3. type slui 3 and press ENTER
    1. yes, SLUI: which stands for SOFTWARE LICENSING USER INTERFACE
      1. SLUI 1 brings up the activation status window
      2. SLUI 2 brings up the activation window
      3. SLUI 3 brings up the CHANGE PRODUCT KEY window
      4. SLUI 4 brings up the CALL MICROSOFT & MANUALLY ACTIVATE window
  4. Type in your product key
  5. Have a nice day.

Command Line to Activate Windows Through Command Line:

  1. Launch a CMD as an Administratorcommand-line-to-activate-windows-slmgr-slui
  2. Type: slmgr.vbs /ipk xxxxx-xxxxx-xxxxx-xxxxx-xxxxx
  3. Press Enter

If your key is valid and you are connected to the internet, it should activate within a second or two.

XenServer Management Command Line

Copied from https://console.kim.sg/xenserver-management-command-line/

In a pool without HA.

Check who is alive and dead

xe host-list params=uuid,name-label,host-metrics-live

Login to any of the slave and check if it’s in emergency mode

xe host-is-in-emergency-mode

View all server hosts

xe host-list

Elect a new Poolmaster.

xe pool-emergency-transition-to-master

Recover the other pool servers

xe pool-recover-slaves

Determine the VMs still running on that failed server.

xe vm-list is-control-domain=false resident-on=UUID_OF_Failed_server

Reset the power state

xe vm-reset-powerstate resident-on= UUID_of_failed_server –-force –-multiple

 

This server can not be forgotten because there are some user VMs still running.

Get list of servers

xe host-list

Find what’s runnong on each server

xe vm-list resident-on=58ee6a78-c20c-4069-b07d-0b092e15fc1c

Reset the power state

xe vm-reset-powerstate uuid=603432e2-c85c-42fa-7bcd-430ddef6688a --force
xe vm-reset-powerstate uuid=062a61b6-0ee3-9383-adf9-e2a506e5e3be --force

Forget the dead poolmaster server

xe host-forget uuid=58ee6a78-c20c-4069-b07d-0b092e15fc1c

How to apply xenserver patches on CLI

Assign UUID to the patch

xe patch-upload file-name=path_to_update_file\XS000.xsupdate

Apply the patch using the generated uuid

xe patch-pool-apply uuid=

Confirm the patch

xe patch-list
xe patch-list | grep name-label | sort

 

Export & import VM to windows share

Login to the server hosting the vm you wish to export and mount destination

mount -t cifs -o username=xxx@xxx.com.sg //192.168.1.9/Common /mnt/

Export/import your vm

xe vm-export vm=xxx filename=/mnt/xxx.xva
xe vm-import filename=xxx.xva

Import vm to shared storage in a pool

xe sr-list
xe vm-import filename=Ubuntu.xva sr-uuid=214b4445-ef9b-626f-ca8b-58b8cbf4b281

Umount them once completed

umount /mnt

 

Export vm to external USB drive

Verify USB drive

fdisk -l

Format USB drive if required

mkfs -t ext3 /dev/sdx1

Mount USB

mkdir /mnt/usb
mount /dev/sdx1 /mnt/usb

Export vm using xenserver XAPI

xe vm-export vm=XXX filename=/mnt/usb/xxx.xva

Umount once completed

umount /mnt/usb

 

How to remove local SR (Storage Repository)

Identify UUID of SR you wish to remove

xe sr-list name-label=Local\ storage

Identify UUID of PBD (physical block device)

xe pbd-list sr-uuid=<UUID-OF-SR)

Remove by unplugging UUID of PBD

xe pbd-unplug uuid=<UUID-OF-PBD>

Remove completely by forgetting UUID of SR

xe sr-forget uuid=<UUID-OF-SR>

If you have trouble removing, check below logs

/var/log/messages.*
/var/log/SMlog.*

 

How to add local SR (Storage Repository)

Find disk ID of new device

cat /proc/partitions
ll /dev/disk/by-id

Create new SR type LVM

xe sr-create content-type=user device-config:device=/dev/disk/by-id/<scsi-xx> host-uuid=<host-uuid> name-label=”Local Storage 2” shared=false type=lvm

Create new SR type EXT

xe sr-create content-type=user device-config:device=/dev/sdx4 host-uuid=<host-uuid> name-label="Local EXT3" shared=false type=ext

 

Check VM running on which host

VM is running on which Host?

xe vm-list resident-on=

 

Check Xen server host spec & version

more /proc/cpuinfo
more /etc/redhat-release
xe patch-list
xe patch-list | grep name-label | sort

Change Xenserver hostname

xe host-set-hostname-live host-uuid=xx-xx-xx-xx-xx host-name=xxxx

 

 

Troubleshooting HA

Get list of xenserver hosts (alive & dead)

xe host-list
xe host-list params=uuid,name-label,host-metrics-live

Find what’s runnong on each host

xe vm-list resident-on=uuid-of-each-xen-server-host

Who is master now?

xe pool-list
more /etc/xensource/pool.conf

 

Change pool master in HA mode

Check HA status

xe pool-list params=name-label,uuid,ha-enabled

Disable HA

xe pool-ha-disable

Choose a new host to become a new pool master

xe host-list
xe pool-designate-new-master host-uuid=

Finally enable back HA

xe pool-ha-enable

 

Lost pool storage repository (SR) and heartbeat (lost everything)

Error: “The host could not join the liveset because the HA daemon could not access the heartbeat disk.”
Confirm that you lost everything and hosts are all in emergency mode

xe host-is-in-emergency-mode

Disable HA and unplug lost SR

xe host-emergency-ha-disable --force
xe pool-emergency-transition-to-master
xe sr-list name-label=XXX
xe pbd-list sr-uuid=<UUID-OF-SR)
xe pbd-unplug uuid=<UUID-OF-PBD>
xe-toolstack-restart
# Never get to use below command 
xe pool-designate-new-master
xe pool-emergency-reset-master

Use your backup to import your VMs

 

Adding a new network card to Xenserver

Scan to see if hwardware has dedected new NIC

lspci
lspci | grep -i ethernet
ifconfig -a

Scan and allow Xenserver to use new NIC

xe pif-scan host-uuid=xxxxxx-xxxxx-xxxx-xxxx-xxxxxx

#You can get host uuid by
xe host-list

Check for interface detected by Xenserver

xe pif-list

You may wish to set some custom param

xe pif-param-set uuid=<UUID of physical interface> other-config:ethtool-autoneg=”off”
xe pif-param-set uuid=<UUID of physical interface> other-config:ethtool-duplex=”full”
xe pif-param-set uuid=<UUID of physical interface> other-config:ethtool-speed=1000

To remove interface

xe pif-forget uuid=

 

Troubleshooting Xenserver

Temporarily enable DNS for ntp update

sudo echo "nameserver 8.8.8.8" | sudo tee -a /etc/resolv.conf
/etc/init.d/ntpd restart

Restart toolstack on master

xe-toolstack-restart

Running MYSQL/MariaDB Commands Remotely

Some remote Administration consoles will only allow running a command without output for a few seconds before terminating it, So running mysql updates with the -p and entering the password after the command is not possible.


"C:\Program Files\MariaDB 10.1\bin\mysql.exe" -u root -p12345678 geolog -e "Update data set state='TX' where jid=16206;"

make sure the password ,{12345678} here, is touching the -p if there is a space in it it will not work.

Notepadd++ Dark Theme

Here is a link to the Git
https://github.com/Nidre/VS2015-Dark-Npp/

Installation

Right Click HERE and select Save As to download the theme.
Go to %APPDATA%\Notepad++.
Open themes folder, create a new folder named themes if it doesn’t exists.
Place downloaded .xml file inside the folder.
Restart Notepad++.
Open Settings->Style Configurator.
Select VS2015-Dark from the theme drop-down box.
Click Save & Close

Windows 10 Decrapifier

A repair install of Windows can bring back the store/apps and undo the changes here, if you need to.

——————————————————————————-
INSTRUCTIONS:

To use this on your own PC:

– Open administrative Powershell console (type Powershell into the search bar, right click it, run as administrator)
get-executionpolicy

– This will show what the current policy is, usually restricted

set-executionpolicy remotesigned
*Allows you to run the script.

(A) for yes to all

– Navigate to the directory that your script (.ps1 file) is in and type:
.\script.ps1
*Add desired switches.

– The script will run.

– When it’s done set the execution policy back to what it was before:
set-executionpolicy restricted (or whatever it was). Choose restricted if you don’t know.

– Reboot the computer.


#Latest version, April 7, 2017

Write-Host "*******Decrapifying Windows 10...*******"
Write-Host "***Removing App Packages...***"

#I recommend running this script on a fresh install, though it should work fine anyways. Should ;)
#This part removes all the apps. By default, it removes everything except the calculator, photos, sound recorder, and the store. To remove all apps including the store, comment out this part...

Get-AppxPackage -AllUsers | where-object {$_.name -notlike "*Store*" -and $_.name -notlike "*Calculator*" -and $_.name -notlike "*Windows.Photos*" -and $_.name -notlike "*SoundRecorder*"} | Remove-AppxPackage -erroraction silentlycontinue
Get-AppxPackage -AllUsers | where-object {$_.name -notlike "*Store*" -and $_.name -notlike "*Calculator*" -and $_.name -notlike "*Windows.Photos*" -and $_.name -notlike "*SoundRecorder*"} | Remove-AppxPackage -erroraction silentlycontinue

Get-AppxProvisionedPackage -online | where-object {$_.displayname -notlike "*Store*" -and $_.displayname -notlike "*Calculator*" -and $_.displayname -notlike "*Windows.Photos*" -and $_.displayname -notlike "*SoundRecorder*"} | Remove-AppxProvisionedPackage -online -erroraction silentlycontinue

#... and comment in this one:

#Get-AppxPackage -AllUsers | Remove-AppxPackage -erroraction silentlycontinue
#Get-AppxPackage -AllUsers | Remove-AppxPackage -erroraction silentlycontinue

#Get-AppXProvisionedPackage -Online | Remove-AppxProvisionedPackage -online -erroraction silentlycontinue

#Now apps are removed, below we will disable a bunch of features. The rabbit hole is deep, this are the ones I thought most important.

Write-Host "***Disabling delivery optimization for local machine...***"

Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization" /T REG_DWORD /V "DODownloadMode" /D 0 /F
Reg Add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" /V "DownloadMode" /T REG_DWORD /D 0 /F
Reg Add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" /V "DODownloadMode" /T REG_DWORD /D 0 /F

Write-Host "***Changing delivery optimization download mode for this user...*** "

Reg Add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization" /T REG_DWORD /V "SystemSettingsDownloadMode" /D 3 /F

#This part disables auto-update and auto-download of Store apps for all users. Set value to 2=always off, 4=always on

Write-Host "***Disabling auto update and download of Windows Store Apps...***"

Reg Add "HKCU\SOFTWARE\Policies\Microsoft\WindowsStore" /T REG_DWORD /V "AutoDownload" /D 2 /F

#Next Section is for Anniversary Edition, comment it in if you are on 1607+, no effect it seems on previous editions

Write-Host "***Disabling Suggested Apps, Feedback, Lockscreen Spotlight, File Explorer ads (WTF??? seriously M$!!!), and unwanted app installs for this user...***"

Reg Add "HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager\" /T REG_DWORD /V "SystemPaneSuggestionsEnabled" /D 0 /F
Reg Add "HKCU\Software\Microsoft\CurrentVersion\ContentDeliveryManager\" /T REG_DWORD /V "SoftLandingEnabled" /D 0 /F
Reg Add "HKCU\Software\Microsoft\CurrentVersion\ContentDeliveryManager\" /T REG_DWORD /V "RotatingLockScreenEnable" /D 0 /F
Reg Add "HKCU\Software\Microsoft\CurrentVersion\ContentDeliveryManager\" /T REG_DWORD /V "PreInstalledAppsEnabled" /D 0 /F
Reg Add "HKCU\Software\Microsoft\CurrentVersion\ContentDeliveryManager\" /T REG_DWORD /V "SilentInstalledAppsEnabled" /D 0 /F
Reg Add "HKCU\Software\Microsoft\CurrentVersion\ContentDeliveryManager\" /T REG_DWORD /V "ContentDeliveryAllowed" /D 0 /F
Reg Add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\" /T REG_DWORD /V "ShowSyncProviderNotifications" /D 0 /F

#1607+ Features end

Write-Host "***Disabling Cloud-Content for this machine...***"
Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\CloudContent\" /T REG_DWORD /V "DisableWindowsConsumerFeatures" /D 1 /F

Write-Host "***Disabling OneDrive for local machine...***"

Reg Add "HKLM\Software\Policies\Microsoft\Windows\OneDrive" /T REG_DWORD /V "DisableFileSyncNGSC" /D 1 /F
Reg Add "HKLM\Software\Policies\Microsoft\Windows\OneDrive" /T REG_DWORD /V "DisableFileSync" /D 1 /F

Write-Host "***Disabling Onedrive startup run for this user...***"

Reg Add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run" /T REG_BINARY /V "OneDrive" /D 0300000021B9DEB396D7D001 /F

Write-Host "***Disabling telemetry for local machine...***"

Reg Add "HKLM\Software\Policies\Microsoft\Windows\DataCollection" /T REG_DWORD /V "AllowTelemetry" /D 0 /F
Reg Add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Device Metadata" /V "PreventDeviceMetadataFromNetwork" /T REG_DWORD /D 1 /F
Reg Add "HKLM\SOFTWARE\Policies\Microsoft\MRT" /V "DontOfferThroughWUAU" /T REG_DWORD /D 1 /F
Reg Add "HKLM\SOFTWARE\Policies\Microsoft\SQMClient\Windows" /V "CEIPEnable" /T REG_DWORD /D 0 /F
Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\AppCompat" /V "AITEnable" /T REG_DWORD /D 0 /F
Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\AppCompat" /V "DisableUAR" /T REG_DWORD /D 1 /F

Write-Host "***Setting Windows 10 privacy options for this user...***"

Reg Add "HKLM\Software\Policies\Microsoft\Windows\AppPrivacy" /T REG_DWORD /V "LetAppsAccessAccountInfo" /D 2 /F
Reg Add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo" /T REG_DWORD /V "Enabled" /D 0 /F
Reg Add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost" /T REG_DWORD /V "EnableWebContentEvaluation" /D 0 /F
Reg Add "HKCU\SOFTWARE\Microsoft\Input\TIPC" /T REG_DWORD /V "Enabled" /D 0 /F
Reg Add "HKCU\Control Panel\International\User Profile" /T REG_DWORD /V "HttpAcceptLanguageOptOut" /D 1 /F
Reg Add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" /T REG_SZ /V Value /D DENY /F
Reg Add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{E5323777-F976-4f5b-9B55-B94699C46E44}" /T REG_SZ /V Value /D DENY /F
Reg Add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{2EEF81BE-33FA-4800-9670-1CD474972C3F}" /T REG_SZ /V Value /D DENY /F
Reg Add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{C1D23ACC-752B-43E5-8448-8D0E519CD6D6}" /T REG_SZ /V Value /D DENY /F
Reg Add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{E5323777-F976-4f5b-9B55-B94699C46E44}" /T REG_SZ /V Value /D DENY /F
Reg Add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{D89823BA-7180-4B81-B50C-7E471E6121A3}" /T REG_SZ /V Value /D DENY /F
Reg Add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{992AFA70-6F47-4148-B3E9-3003349C1548}" /T REG_SZ /V Value /D DENY /F
Reg Add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{A8804298-2D5F-42E3-9531-9C8C39EB29CE}" /T REG_SZ /V Value /D DENY /F
Reg Add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\LooselyCoupled" /T REG_SZ /V Value /D DENY /F
Reg Add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{D89823BA-7180-4B81-B50C-7E471E6121A3}" /T REG_SZ /V Value /D DENY /F
Reg Add "HKCU\SOFTWARE\Microsoft\Personalization\Settings" /T REG_DWORD /V "AcceptedPrivacyPolicy" /D 0 /F
Reg Add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\SettingSync\Groups\Language" /T REG_DWORD /V "Enabled" /D 0 /F
Reg Add "HKCU\SOFTWARE\Microsoft\InputPersonalization" /T REG_DWORD /V "RestrictImplicitTextCollection" /D 1 /F
Reg Add "HKCU\SOFTWARE\Microsoft\InputPersonalization" /T REG_DWORD /V "RestrictImplicitInkCollection" /D 1 /F
Reg Add "HKCU\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" /T REG_DWORD /V "HarvestContacts" /D 0 /F
Reg Add "HKCU\SOFTWARE\Microsoft\Siuf\Rules" /T REG_DWORD /V "NumberOfSIUFInPeriod" /D 0 /F

Write-Host "***Disallowing apps from accessing account info on this machine...***"

Reg Add "HKLM\Software\Policies\Microsoft\Windows\AppPrivacy" /T REG_DWORD /V "LetAppsAccessAccountInfo" /D 2 /F

Write-Host "***Disallowing Cortana and web connected search through local machine policy...***"

Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /V "AllowCortana" /T REG_DWORD /D 0 /F
Reg Add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /V "ConnectedSearchUseWeb" /T REG_DWORD /D 0 /F

Write-Host "***Disabling Cortana and Bing search for this user...***"

Reg Add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /V "CortanaEnabled" /T REG_DWORD /D 0 /F
Reg Add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /V "SearchboxTaskbarMode" /T REG_DWORD /D 0 /F
Reg Add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /V "BingSearchEnabled" /T REG_DWORD /D 0 /F
Reg Add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /V "DeviceHistoryEnabled" /T REG_DWORD /D 0 /F

Write-Host "***Disabling some unecessary scheduled tasks...***"

Get-Scheduledtask "SmartScreenSpecific","Microsoft Compatibility Appraiser","Consolidator","KernelCeipTask","UsbCeip","Microsoft-Windows-DiskDiagnosticDataCollector", "GatherNetworkInfo","QueueReporting" | Disable-scheduledtask

Write-Host "***Stopping and disabling diagnostics tracking services, Onedrive sync service, various Xbox services, Distributed Link Tracking, and Windows Media Player network sharing (you can turn this back on if you share your media libraries with WMP)...***"

Get-Service Diagtrack,DmwApPushService,OneSyncSvc,XblAuthManager,XblGameSave,XboxNetApiSvc,TrkWks,WMPNetworkSvc | stop-service -passthru | set-service -startuptype disabled

Write-Host "*******Decrapification complete.*******"

Write-Host "If you have unremovable tiles on your start menu afterwards, copy c:\users\USER\appdata\local\tiledatalayer from a fresh profile, AFTER running the script, to your profile, overwriting what is there. The main file is tiledatelayer.edb. This will give you a default start menu but without all the useless app icons."
Write-Host "This doesn't seem to be an issues with 1511 +"

Write-Host "*******Reboot your computer now!*******"

XenServer Add autostart to VM’s

you can run this in putty.exe

#Autostart VM

xe pool-list
xe pool-param-set uuid=POOL_UUID other-config:auto_poweron=true
xe vm-list

xe vm-param-set uuid=VM_UUID other-config:auto_poweron=true

xevm-param-set uuid=VM_UUID other-config:auto_poweron=true